From 6a0f52e214f2258c3859fb7dd3734cdefbe75e34 Mon Sep 17 00:00:00 2001 From: heyang <951513216@qq.com> Date: Mon, 27 May 2024 19:46:52 +0800 Subject: [PATCH] Fix bug 476 --- app/account_service.py | 1 + app/main.py | 2 +- app/templates/userpage_get.html | 211 ++++++++------------------------ app/user_service.py | 1 + identifier.sqlite | Bin 0 -> 12288 bytes requirements.txt | 5 +- 6 files changed, 52 insertions(+), 168 deletions(-) create mode 100644 identifier.sqlite diff --git a/app/account_service.py b/app/account_service.py index a7ed0c4..784da5c 100644 --- a/app/account_service.py +++ b/app/account_service.py @@ -1,5 +1,6 @@ from flask import * from Login import check_username_availability, verify_user, add_user, get_expiry_date, change_password, WarningMessage +from markupsafe import escape # 初始化蓝图 diff --git a/app/main.py b/app/main.py index 4e3f829..d8d8e88 100644 --- a/app/main.py +++ b/app/main.py @@ -5,7 +5,7 @@ # Copyright 2019 (C) Hui Lan # Written permission must be obtained from the author for commercial uses. ########################################################################### -from flask import escape +from markupsafe import escape from Login import * from Article import * import Yaml diff --git a/app/templates/userpage_get.html b/app/templates/userpage_get.html index 0488aea..68997ef 100644 --- a/app/templates/userpage_get.html +++ b/app/templates/userpage_get.html @@ -5,8 +5,6 @@ - - {{ yml['header'] | safe }} {% if yml['css']['item'] %} @@ -28,40 +26,12 @@ } @keyframes shakes { - 10%, 90% { - transform: translate3d(-1px, 0, 0); - } - 20%, 50% { - transform: translate3d(+2px, 0, 0); - } - 30%, 70% { - transform: translate3d(-4px, 0, 0); - } - 40%, 60% { - transform: translate3d(+4px, 0, 0); - } - 50% { - transform: translate3d(-4px, 0, 0); - } + 10%, 90% { transform: translate3d(-1px, 0, 0); } + 20%, 50% { transform: translate3d(+2px, 0, 0); } + 30%, 70% { transform: translate3d(-4px, 0, 0); } + 40%, 60% { transform: translate3d(+4px, 0, 0); } + 50% { transform: translate3d(-4px, 0, 0); } } - - .lead { - font-size: 22px; - font-family: Helvetica, sans-serif; - white-space: pre-wrap; - } - - .arrow { - padding: 0; - font-size: 20px; - line-height: 21px; - display: inline-block; - } - - .arrow:hover { - cursor: pointer; - } - @@ -69,70 +39,53 @@

English Pal for {{ username }} {% if username == admin_name %} - 管理 + 管理 {% endif %} 退出 重设密码

- {% for message in get_flashed_messages() %} - - {% endfor %} +{# {% for message in flashed_messages %}#} {# 根据user_service.userpage,取消了参数flashed_messages,因此注释了这段代码 #} +{# #} +{# {% endfor %}#} - - + +

阅读文章并回答问题

- -

Article added on: {{ today_article["date"] }}


-

-

{{ today_article["article_title"] }}


-

{{ today_article["article_body"] }}


-
-

{{ today_article['source'] }}


-
- -

{{ today_article['question'] }}


+ +

Article added on: {{ today_article["date"] }}


+

+

{{ today_article["article_title"] }}


+

{{ today_article["article_body"] }}


+

{{ today_article['source'] }}


+

{{ today_article['question'] }}


- -
+
- 生词高亮 - 大声朗读 - 划词入库 + 生词高亮 + 大声朗读 + 划词入库
@@ -144,8 +97,8 @@

收集生词吧 (可以在正文中划词,也可以复制黏贴)


- - + +
{% if session.get['thisWord'] %}