drobne UX
This commit is contained in:
13
app.py
13
app.py
@ -87,7 +87,6 @@ def get_progress(list_id):
|
||||
percent = (purchased_count / total_count * 100) if total_count > 0 else 0
|
||||
return purchased_count, total_count, percent
|
||||
|
||||
|
||||
@login_manager.user_loader
|
||||
def load_user(user_id):
|
||||
return User.query.get(int(user_id))
|
||||
@ -169,6 +168,15 @@ def index_guest():
|
||||
def page_not_found(e):
|
||||
return render_template('404.html'), 404
|
||||
|
||||
@app.route('/favicon.svg')
|
||||
def favicon():
|
||||
svg = '''
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
|
||||
<text y="14" font-size="16">🛒</text>
|
||||
</svg>
|
||||
'''
|
||||
return svg, 200, {'Content-Type': 'image/svg+xml'}
|
||||
|
||||
@app.route('/login', methods=['GET', 'POST'])
|
||||
def login():
|
||||
if request.method == 'POST':
|
||||
@ -587,7 +595,6 @@ def handle_check_item(data):
|
||||
'percent': percent
|
||||
}, to=str(item.list_id))
|
||||
|
||||
|
||||
@socketio.on('uncheck_item')
|
||||
def handle_uncheck_item(data):
|
||||
item = Item.query.get(data['item_id'])
|
||||
@ -615,8 +622,6 @@ def handle_update_note(data):
|
||||
db.session.commit()
|
||||
emit('note_updated', {'item_id': item_id, 'note': note}, to=str(item.list_id))
|
||||
|
||||
|
||||
|
||||
@app.cli.command('create_db')
|
||||
def create_db():
|
||||
db.create_all()
|
||||
|
Reference in New Issue
Block a user