From 9c22da94a9caec01391ac054e86d93134f4c53b7 Mon Sep 17 00:00:00 2001 From: lemon <601749122@qq.com> Date: Tue, 11 May 2021 11:04:17 +0800 Subject: [PATCH 1/6] add testip page for test --- database.sqlite | Bin 73728 -> 73728 bytes service.py | 13 +++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/database.sqlite b/database.sqlite index 4a528af037e8164c10a25969ffd93575638e1b45..f78ebf8e9087c5e02ae25d7a2a6fb09c5f669cff 100644 GIT binary patch delta 143 zcmZoTz|wGlWr8&0uZc3wtiKraWHxL}S>Vsb%zu%A{{#O6{)?Lh0}k`^^D?tA$a5GP znd=z Date: Sun, 6 Jun 2021 15:08:34 +0800 Subject: [PATCH 2/6] add requrements.txt && rm remainging testing code --- requirements.txt | 24 ++++++++++++++++++++++++ service.py | 4 +--- 2 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..a858539 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,24 @@ +alembic==1.5.2 +click==7.1.2 +et-xmlfile==1.0.1 +Flask==1.1.2 +Flask-Migrate==2.6.0 +Flask-Script==2.0.6 +Flask-SQLAlchemy==2.4.4 +itsdangerous==1.1.0 +jdcal==1.4.1 +Jinja2==2.11.2 +Mako==1.1.4 +MarkupSafe==1.1.1 +numpy==1.19.5 +openpyxl==3.0.6 +pandas==1.1.5 +PyMySQL==0.10.1 +python-dateutil==2.8.1 +python-editor==1.0.4 +pytz==2021.1 +six==1.15.0 +SQLAlchemy==1.3.22 +Werkzeug==1.0.1 +xlrd==2.0.1 +XlsxWriter==1.3.7 diff --git a/service.py b/service.py index f2790ed..0bb4563 100644 --- a/service.py +++ b/service.py @@ -397,9 +397,7 @@ def before_request(): visitvote = VisitVote(visitor_id=visitor.id, article_id=article_id) db.session.add(visitvote) db.session.add(article) -@app.route('/testip') -def testip(): - return session.get('ip') + # ============================================================================================# # index # From 362599d065afa019169dce66afb4e2e44edabe04 Mon Sep 17 00:00:00 2001 From: lemon <601749122@qq.com> Date: Sun, 6 Jun 2021 15:19:04 +0800 Subject: [PATCH 3/6] remove redundant dislike button on article page --- .gitignore | 1 + templates/article.html | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 2483976..78d8aee 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .idea/ __pycache__/ +venv/ \ No newline at end of file diff --git a/templates/article.html b/templates/article.html index 3a962c8..fe4e488 100644 --- a/templates/article.html +++ b/templates/article.html @@ -132,7 +132,7 @@

{{ article.title }}

dislike

{{ article.downvote }}

 
-

dislike

{{ article.downvote }}

  +

download number

{{ article.downloadcount }}


From b73ec46183cb2b922147e0521e3aac68bca2ab44 Mon Sep 17 00:00:00 2001 From: lemon <601749122@qq.com> Date: Sun, 6 Jun 2021 15:28:26 +0800 Subject: [PATCH 4/6] hide sort button when no comments --- templates/article.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/article.html b/templates/article.html index fe4e488..b31f5cf 100644 --- a/templates/article.html +++ b/templates/article.html @@ -193,8 +193,8 @@

{{ article.title }}

{% endfor %} - + {% if comments %} - + {% endif %} {% endblock %} From e33096230c0ca04c747cf0a21f84b3da9e71be39 Mon Sep 17 00:00:00 2001 From: lemon <601749122@qq.com> Date: Sun, 6 Jun 2021 15:30:50 +0800 Subject: [PATCH 5/6] add author page link on subject page --- templates/subject.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/subject.html b/templates/subject.html index 43c2de4..a3ae9d3 100644 --- a/templates/subject.html +++ b/templates/subject.html @@ -86,7 +86,7 @@ {% for article in articles.items %} {{ article.title }} - {{ Tool.email_display_filter(article.author.mail) }} + {{ Tool.email_display_filter(article.author.mail) }} {{ article.time.strftime("%Y-%m-%d %H:%M") }} {{ article.metric }} From 6126b3d49e0204910809642c04c4b26a59e906fa Mon Sep 17 00:00:00 2001 From: lemon <601749122@qq.com> Date: Sun, 6 Jun 2021 15:38:24 +0800 Subject: [PATCH 6/6] add author link on search page --- templates/search.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/search.html b/templates/search.html index 1d83679..ae2c943 100644 --- a/templates/search.html +++ b/templates/search.html @@ -25,7 +25,7 @@ {{ Tool.highlight_matched_parts(article.title, kwd) | safe }} {{ Tool.highlight_matched_parts(article.abstract, kwd) | safe }} {{ Tool.highlight_matched_parts(article.highlight, kwd) | safe }} - {{ Tool.email_display_filter(article.author.mail) | safe }} + {{ Tool.email_display_filter(article.author.mail) | safe }} {{ article.time.strftime('%Y-%m-%d %H:%M') | safe }} {{ article.metric }}