forked from mrlan/EnglishPal
Merge branch 'Bug422-XuXing' into Bug422-XuXing
commit
69835c7f8d
|
@ -27,8 +27,12 @@
|
|||
<a class="btn btn-secondary" href="/reset" role="button">重设密码</a>
|
||||
</p>
|
||||
{{ flashed_messages|safe }}
|
||||
{% if session.get('articleID') != session.get('temp') %}
|
||||
{% if session.get('temp') != None %}
|
||||
<p><a class="btn btn-success" href="/{{ username }}/back" role="button"> 上一篇 Previous Article </a>
|
||||
{% endif%}
|
||||
{% endif %}<a class="btn btn-success" href="/{{ username }}/reset" role="button"> 下一篇 Next Article </a>
|
||||
|
||||
<p><a class="btn btn-success" href="/{{ username }}/reset" role="button"> 下一篇 Next Article </a></p>
|
||||
<p><b>阅读文章并回答问题</b></p>
|
||||
<div id="text-content">{{ today_article|safe }}</div>
|
||||
|
||||
|
|
|
@ -22,6 +22,20 @@ path_prefix = '/var/www/wordfreq/wordfreq/'
|
|||
path_prefix = './' # comment this line in deployment
|
||||
|
||||
|
||||
|
||||
#@userService.route("/<username>/reset", methods=['GET', 'POST'])
|
||||
#def user_reset(username):
|
||||
#'''
|
||||
#用户界面
|
||||
#:param username: 用户名
|
||||
#:return: 返回页面内容
|
||||
#'''
|
||||
# if request.method == 'GET':
|
||||
# session['articleID'] = None
|
||||
# return redirect(url_for('user_bp.userpage', username=username))
|
||||
# else:
|
||||
# return 'Under construction'
|
||||
|
||||
@userService.route("/<username>/reset", methods=['GET', 'POST'])
|
||||
def user_reset(username):
|
||||
'''
|
||||
|
@ -29,12 +43,25 @@ def user_reset(username):
|
|||
:param username: 用户名
|
||||
:return: 返回页面内容
|
||||
'''
|
||||
session['temp'] = session.get('articleID')
|
||||
if request.method == 'GET':
|
||||
session['articleID'] = None
|
||||
return redirect(url_for('user_bp.userpage', username=username))
|
||||
else:
|
||||
return 'Under construction'
|
||||
|
||||
@userService.route("/<username>/back", methods=['GET'])
|
||||
def user_back(username):
|
||||
'''
|
||||
用户界面
|
||||
:param username: 用户名
|
||||
:return: 返回页面内容
|
||||
'''
|
||||
if request.method == 'GET':
|
||||
session['articleID'] = session.get('temp')
|
||||
return redirect(url_for('user_bp.userpage', username=username))
|
||||
|
||||
|
||||
|
||||
@userService.route("/<username>/<word>/unfamiliar", methods=['GET', 'POST'])
|
||||
def unfamiliar(username, word):
|
||||
|
|
Loading…
Reference in New Issue