From 9fe3afcde732b7e0bc5cceddda5bf6971594ac44 Mon Sep 17 00:00:00 2001 From: Wang Yuyang Date: Tue, 30 Nov 2021 19:38:59 +0800 Subject: [PATCH 1/4] update-coverage --- ModelsTest.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ModelsTest.py b/ModelsTest.py index 5ac52f7..081f306 100644 --- a/ModelsTest.py +++ b/ModelsTest.py @@ -32,6 +32,7 @@ class TestModels(unittest.TestCase): self.assertIsNotNone(self.client) response = app.test_client().get('/', data={}) self.assertEqual(response.status_code, 200) + response = app.test_client().get('/trans', data={}) self.assertEqual(response.status_code, 308) From 540664e675af0b522043275009eb67780c9b0081 Mon Sep 17 00:00:00 2001 From: Wang Yuyang Date: Tue, 30 Nov 2021 19:39:29 +0800 Subject: [PATCH 2/4] update-coverage --- requirements.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index df4a7ec..b08856a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -12,6 +12,7 @@ cookiecutter==1.7.3 coverage==6.2 dominate==2.5.1 Faker==4.0.3 +flake8==4.0.1 Flask==2.0.2 Flask-Admin==1.5.8 Flask-Autodoc==0.1.2 @@ -35,7 +36,10 @@ jinja2-time==0.2.0 Mako==1.1.6 Markdown==3.2.1 MarkupSafe==2.0.1 +mccabe==0.6.1 poyo==0.5.0 +pycodestyle==2.8.0 +pyflakes==2.4.0 python-dateutil==2.8.2 python-dotenv==0.19.2 python-slugify==5.0.2 @@ -49,4 +53,3 @@ webencodings==0.5.1 Werkzeug==2.0.2 WTForms==2.2 WTForms-Appengine==0.1 -Flask-Docs From 0049c85fb912464ebed05aab755dcf5df81ec7a9 Mon Sep 17 00:00:00 2001 From: Wang Yuyang Date: Tue, 30 Nov 2021 19:43:47 +0800 Subject: [PATCH 3/4] update-coverage --- .gitlab-ci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 65c022d..29a77af 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -31,6 +31,11 @@ cache: test: stage: test script: + - python -V # Print out python version for debugging + - pip install virtualenv + - virtualenv venv + - source venv/bin/activate + - pip install -r requirements.txt - echo "TEST" - coverage run ModelsTest.py - coverage report -m From c6de343a98a6c75d01b660aca147b5dfdc354560 Mon Sep 17 00:00:00 2001 From: Shenyuan Jin Date: Tue, 30 Nov 2021 19:44:21 +0800 Subject: [PATCH 4/4] display --- app/static/share.css | 2 +- app/templates/post.html | 21 +++++++++++---------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/app/static/share.css b/app/static/share.css index facdbcc..121d63b 100644 --- a/app/static/share.css +++ b/app/static/share.css @@ -20,7 +20,7 @@ body > div { } div { - text-align: left + text-align: center } a img { diff --git a/app/templates/post.html b/app/templates/post.html index e7b3f16..30357c5 100644 --- a/app/templates/post.html +++ b/app/templates/post.html @@ -235,11 +235,11 @@ success: function(result) { console.log('success\n'+result); if(result.like){ - _this.innerText=' Unfollow' + _this.innerText=' Unsave' follow_icon.setAttribute('fill','#3688FF') }else{ - _this.innerText=' Follow' + _this.innerText=' Save' follow_icon.setAttribute('fill','#868686') } {#span1.setAttribute('href', '{{ url_for('.dislike', post_id=post.id) }}');#} @@ -252,10 +252,11 @@ } }) }" > - - + -
{% if current_user.is_authenticated %} +
{% if current_user.is_authenticated %} {% if not current_user.is_savinganswer(post) %} - Follow + Save {% else %} - Unfollow + Unsave {% endif %} {% else %} - Follow + Save {% endif %}