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()
|
||||
|
@ -6,6 +6,7 @@
|
||||
<title>{% block title %}Live Lista Zakupów{% endblock %}</title>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css">
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/lightbox2/2.11.4/css/lightbox.min.css" rel="stylesheet">
|
||||
<link rel="icon" type="image/svg+xml" href="{{ url_for('favicon') }}">
|
||||
|
||||
<script src="https://cdn.socket.io/4.6.1/socket.io.min.js"></script>
|
||||
<script src="{{ url_for('static_bp.serve_live_js') }}?v={{ time.time() | int }}"></script>
|
||||
@ -19,7 +20,6 @@
|
||||
🛒 Live <span class="text-warning">Lista</span> Zakupów
|
||||
</a>
|
||||
|
||||
|
||||
{% if current_user.is_authenticated %}
|
||||
<span class="mx-auto text-white">Zalogowany jako: <strong>{{ current_user.username }}</strong></span>
|
||||
{% else %}
|
||||
@ -39,7 +39,6 @@
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
|
||||
<div id="toast-container" class="toast-container position-fixed bottom-0 end-0 p-3"></div>
|
||||
|
||||
<div class="container px-2">
|
||||
|
@ -11,7 +11,7 @@
|
||||
<div class="card-body d-flex flex-column flex-md-row justify-content-between align-items-start align-items-md-center gap-2">
|
||||
<div>
|
||||
<strong>🔗 Udostępnij link:</strong><br>
|
||||
<span class="badge bg-secondary text-wrap" style="font-size: 0.9rem;">
|
||||
<span class="badge bg-secondary text-wrap" style="font-size: 0.7rem;">
|
||||
{{ request.url_root }}share/{{ list.share_token }}
|
||||
</span>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user