Compare commits
4 Commits
54d09469f5
...
3383e411ec
Author | SHA1 | Date |
---|---|---|
|
3383e411ec | |
|
f4488672ec | |
|
00ae770195 | |
|
3db629b57d |
|
@ -89,7 +89,7 @@ def article():
|
||||||
flash(f'Article ID {delete_id} deleted successfully.') # 刷新页首提示语
|
flash(f'Article ID {delete_id} deleted successfully.') # 刷新页首提示语
|
||||||
_update_context()
|
_update_context()
|
||||||
except ValueError:
|
except ValueError:
|
||||||
flash('Invalid article ID for deletion.')
|
flash('Invalid article ID for deletion.') # 刷新页首提示语
|
||||||
|
|
||||||
content = data.get("content", "")
|
content = data.get("content", "")
|
||||||
source = data.get("source", "")
|
source = data.get("source", "")
|
||||||
|
@ -99,9 +99,9 @@ def article():
|
||||||
if level not in ['1', '2', '3', '4']:
|
if level not in ['1', '2', '3', '4']:
|
||||||
return "Level must be between 1 and 4."
|
return "Level must be between 1 and 4."
|
||||||
add_article(content, source, level, question)
|
add_article(content, source, level, question)
|
||||||
_update_context()
|
|
||||||
title = content.split('\n')[0]
|
title = content.split('\n')[0]
|
||||||
flash(f'Article added. Title: {title}')
|
flash(f'Article added. Title: {title}')
|
||||||
|
_update_context() # 这行应在flash之后 否则会发生新建的文章即点即删
|
||||||
|
|
||||||
return render_template("admin_manage_article.html", **context)
|
return render_template("admin_manage_article.html", **context)
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
<a href="http://youdao.com/w/eng/{{x[0]}}/#keyfrom=dict2.index">{{x[0]}}</a> {{x[1]}}
|
<a href="http://youdao.com/w/eng/{{x[0]}}/#keyfrom=dict2.index">{{x[0]}}</a> {{x[1]}}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<p class="text-muted">Version: 20230810</p>
|
<p class="text-muted">Version: 20240618</p>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
|
||||||
</div>
|
</div>
|
||||||
{{ yml['footer'] | safe }}
|
{{ yml['footer'] | safe }}
|
||||||
|
|
Loading…
Reference in New Issue