Basic user setting

This commit is contained in:
Edward Betts 2019-10-04 12:16:16 +01:00
parent 478d9c6806
commit 7ca90b2006
2 changed files with 11 additions and 0 deletions

7
app.py
View file

@ -181,6 +181,13 @@ def create_depicts_item(item_id):
def init_profile(): def init_profile():
g.profiling = [] g.profiling = []
@app.route('/user/settings')
def user_settings():
session['no_find_more'] = not session.get('no_find_more')
display = {True: 'on', False: 'off'}[not session['no_find_more']]
return 'flipped. find more is ' + display
@app.route('/save/Q<int:item_id>', methods=['POST']) @app.route('/save/Q<int:item_id>', methods=['POST'])
def save(item_id): def save(item_id):
depicts = request.form.getlist('depicts') depicts = request.form.getlist('depicts')

View file

@ -19,6 +19,9 @@
<a href="{{ url_for('browse_page') }}">browse paintings</a> <a href="{{ url_for('browse_page') }}">browse paintings</a>
</p> </p>
{% if session.no_find_more %}
<p>find more disabled</p>
{% else %}
{% raw %} {% raw %}
<div id="app"> <div id="app">
@ -37,6 +40,7 @@
</div> </div>
{% endraw %} {% endraw %}
{% endif %}
</div> </div>