修复了userpage_get.html 使其在ratio和today_article为空时 不报错
parent
d9512c929b
commit
8149392fa6
|
@ -145,7 +145,7 @@ if __name__ == '__main__':
|
|||
'''
|
||||
# app.secret_key = os.urandom(16)
|
||||
# app.run(debug=False, port='6000')
|
||||
app.run(debug=True)
|
||||
app.run(host='127.0.0.1', port=5000, debug=True)
|
||||
# app.run(debug=True, port='6000')
|
||||
# app.run(host='0.0.0.0', debug=True, port='6000')
|
||||
# print(mod5('123'))
|
||||
|
|
|
@ -87,7 +87,18 @@
|
|||
|
||||
<div id="text-content">
|
||||
<div id="found">
|
||||
<div class="alert alert-success" role="alert">According to your word list, your level is <span class="text-decoration-underline" id="user_level">{{ today_article["user_level"] }}</span> and we have chosen an article with a difficulty level of <span class="text-decoration-underline" id="text_level">{{ today_article["text_level"] }}</span> for you. The Oxford word coverage is <span class="text-decoration-underline" id="ratio">{{ (today_article["ratio"] * 100) | int }}%.</span></div>
|
||||
{% if today_article and today_article["ratio"] is not none %}
|
||||
<div class="alert alert-success" role="alert">
|
||||
According to your word list, your level is
|
||||
<span class="text-decoration-underline" id="user_level">{{ today_article["user_level"] }}</span>
|
||||
and we have chosen an article with a difficulty level of
|
||||
<span class="text-decoration-underline" id="text_level">{{ today_article["text_level"] }}</span>
|
||||
for you. The Oxford word coverage is
|
||||
<span class="text-decoration-underline" id="ratio">{{ (today_article["ratio"] * 100) | int }}%.</span>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="alert alert-warning">No article or article is incomplete.</div>
|
||||
{% endif %}
|
||||
<p class="text-muted" id="date">Article added on: {{ today_article["date"] }}</p><br/>
|
||||
|
||||
<button onclick="saveArticle()" >标记文章</button>
|
||||
|
@ -114,7 +125,9 @@
|
|||
}
|
||||
</script>
|
||||
<button onclick="toggle_visibility('answer');">ANSWER</button>
|
||||
<div id="answer" style="display:none;">{{ today_article['answer'] }}</div><br/>
|
||||
<div id="answer" style="display:none;">
|
||||
{{ today_article['answer'] }}
|
||||
</div><br/>
|
||||
</div>
|
||||
<div id="tooltip"></div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue