drobne UX

This commit is contained in:
Mateusz Gruszczyński
2025-07-03 15:03:33 +02:00
parent f0a60c9134
commit f03c71cb85
3 changed files with 11 additions and 7 deletions

13
app.py
View File

@ -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()