Bug493-GongKeCheng
parent
0549bd9035
commit
a5c792b782
|
@ -37,16 +37,16 @@
|
||||||
<body>
|
<body>
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<p><b>English Pal for <font id="username" color="red">{{ username }}</font></b>
|
<p><b>English Pal for <font id="username" color="red">{{ username }}</font></b>
|
||||||
<<<<<<< HEAD
|
|
||||||
<a class="btn btn-secondary" href="/logout" role="button">退出</a>
|
<a class="btn btn-secondary" href="/logout" role="button">退出</a>
|
||||||
<a class="btn btn-secondary" href="/reset" role="button">重设密码</a>
|
<a class="btn btn-secondary" href="/reset" role="button">重设密码</a>
|
||||||
</p>
|
</p>
|
||||||
{% if flashed_messages != "" %}
|
{% if flashed_messages != [] %}
|
||||||
<div class="alert alert-warning" role="alert" id="warn_info">{{ flashed_messages|safe }}</div>
|
<div class="alert alert-warning" role="alert" id="warn_info">
|
||||||
|
{{ flashed_messages|safe }}
|
||||||
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
=======
|
|
||||||
>>>>>>> d9f6df7fbe585395a19b9a08c411d841b6b89fd4
|
|
||||||
|
|
||||||
{% if username == admin_name %}
|
{% if username == admin_name %}
|
||||||
<a class="btn btn-secondary" href="/admin" role="button" onclick="stopRead()">管理</a>
|
<a class="btn btn-secondary" href="/admin" role="button" onclick="stopRead()">管理</a>
|
||||||
|
@ -123,7 +123,7 @@
|
||||||
|
|
||||||
{% if d_len > 0 %}
|
{% if d_len > 0 %}
|
||||||
<p>
|
<p>
|
||||||
<b>我的生词簿</b>
|
<b>我的生词簿</b>
|
||||||
<label for="move_dynamiclly">
|
<label for="move_dynamiclly">
|
||||||
<input type="checkbox" name="move_dynamiclly" id="move_dynamiclly" checked>
|
<input type="checkbox" name="move_dynamiclly" id="move_dynamiclly" checked>
|
||||||
允许动态调整顺序
|
允许动态调整顺序
|
||||||
|
|
|
@ -102,8 +102,7 @@ def deleteword(username, word):
|
||||||
'''
|
'''
|
||||||
user_freq_record = path_prefix + 'static/frequency/' + 'frequency_%s.pickle' % (username)
|
user_freq_record = path_prefix + 'static/frequency/' + 'frequency_%s.pickle' % (username)
|
||||||
pickle_idea2.deleteRecord(user_freq_record, word)
|
pickle_idea2.deleteRecord(user_freq_record, word)
|
||||||
# 模板userpage_get.html中删除单词是异步执行,而flash的信息后续是同步执行的,所以注释这段代码;同时如果这里使用flash但不提取信息,则会影响 signup.html的显示。bug复现:删除单词后,点击退出,点击注册,注册页面就会出现提示信息
|
flash(f'{word} is no longer in your word list.')
|
||||||
# flash(f'{word} is no longer in your word list.')
|
|
||||||
return "success"
|
return "success"
|
||||||
|
|
||||||
|
|
||||||
|
@ -151,7 +150,7 @@ def userpage(username):
|
||||||
admin_name=ADMIN_NAME,
|
admin_name=ADMIN_NAME,
|
||||||
username=username,
|
username=username,
|
||||||
session=session,
|
session=session,
|
||||||
# flashed_messages=get_flashed_messages(), 仅有删除单词的时候使用到flash,而删除单词是异步执行,这里的信息提示是同步执行,所以就没有存在的必要了
|
flashed_messages=get_flashed_messages(),
|
||||||
today_article=today_article,
|
today_article=today_article,
|
||||||
result_of_generate_article=result_of_generate_article,
|
result_of_generate_article=result_of_generate_article,
|
||||||
d_len=len(d),
|
d_len=len(d),
|
||||||
|
@ -193,7 +192,7 @@ def get_flashed_messages_if_any():
|
||||||
在用户界面显示黄色提示信息
|
在用户界面显示黄色提示信息
|
||||||
:return: 包含HTML标签的提示信息
|
:return: 包含HTML标签的提示信息
|
||||||
'''
|
'''
|
||||||
messages = get_flashed_messages()
|
messages = get_flashed_messages
|
||||||
s = ''
|
s = ''
|
||||||
for message in messages:
|
for message in messages:
|
||||||
s += message
|
s += message
|
||||||
|
|
Loading…
Reference in New Issue