zmiany ux

This commit is contained in:
Mateusz Gruszczyński
2025-07-06 22:52:13 +02:00
parent a90fc66c06
commit ef7a2c0df9
12 changed files with 69 additions and 21 deletions

View File

@ -15,13 +15,13 @@
<nav class="navbar navbar-dark bg-dark mb-3">
<div class="container-fluid">
<a class="navbar-brand fw-bold fs-4 text-success" href="/">
🛒 Live <span class="text-warning">Lista</span> Zakupów
🛒 <span class="text-warning">Lista</span> Zakupów
</a>
{% if has_authorized_cookie %}
{% if current_user.is_authenticated %}
<span class="mx-auto text-white">
Zalogowany jako:
Zalogowany:
<span class="badge bg-success">{{ current_user.username }}</span>
</span>
{% else %}
@ -39,7 +39,7 @@
{% if current_user.is_authenticated %}
<a href="{{ url_for('logout') }}" class="btn btn-outline-light btn-sm">🚪 Wyloguj</a>
{% else %}
<a href="{{ url_for('login') }}" class="btn btn-outline-light btn-sm">🔑 Zaloguj się</a>
<a href="{{ url_for('login') }}" class="btn btn-outline-light btn-sm">🔑 Zaloguj</a>
{% endif %}
</div>
</div>
@ -70,9 +70,9 @@
<script src="{{ url_for('static_bp.serve_js_lib', filename='bootstrap.bundle.min.js') }}"></script>
<script src="{{ url_for('static_bp.serve_js_lib', filename='socket.io.min.js') }}"></script>
{% if request.endpoint != 'system_auth' %}
<script src="{{ url_for('static_bp.serve_js', filename='live.js') }}"></script>
<script src="{{ url_for('static_bp.serve_js', filename='hide_list.js') }}"></script>
<script src="{{ url_for('static_bp.serve_js', filename='socket_reconnect.js') }}"></script>
<script src="{{ url_for('static_bp.serve_js', filename='live.js') }}"></script>
<script src="{{ url_for('static_bp.serve_js', filename='hide_list.js') }}"></script>
<script src="{{ url_for('static_bp.serve_js', filename='socket_reconnect.js') }}"></script>
{% endif %}
<script src="{{ url_for('static_bp.serve_js', filename='toasts.js') }}"></script>
{% block scripts %}{% endblock %}

View File

@ -84,17 +84,17 @@ Lista: <strong>{{ list.title }}</strong>
{% endif %}
</span>
{% if item.note %}
<small class="text-danger">[ Notatka: <b>{{ item.note }}</b> ] </small>
<small class="text-danger ms-4">[ <b>{{ item.note }}</b> ]</small>
{% endif %}
</div>
<div class="mt-2 mt-md-0 d-flex gap-1">
<button class="btn btn-sm btn-outline-warning"
{% if list.is_archived %}disabled{% else %}onclick="editItem({{ item.id }}, '{{ item.name }}', {{ item.quantity or 1 }})"{% endif %}>
✏️ Edytuj
✏️
</button>
<button class="btn btn-sm btn-outline-danger"
{% if list.is_archived %}disabled{% else %}onclick="deleteItem({{ item.id }})"{% endif %}>
🗑️ Usuń
🗑️
</button>
</div>
</li>
@ -105,7 +105,7 @@ Lista: <strong>{{ list.title }}</strong>
<div class="input-group mb-3">
<input type="text" id="newItem" name="name" class="form-control" placeholder="Dodaj produkt" required>
<input type="number" id="newQuantity" name="quantity" class="form-control" placeholder="Ilość" min="1" value="1" style="max-width: 80px;">
<button type="button" class="btn btn-success" onclick="addItem({{ list.id }})"> Dodaj</button>
<button type="button" class="btn btn-success rounded" onclick="addItem({{ list.id }})"> Dodaj</button>
</div>
{% endif %}

View File

@ -21,7 +21,7 @@
<ul id="items" class="list-group mb-3">
{% for item in items %}
<li class="list-group-item d-flex justify-content-between align-items-center flex-wrap clickable-item {% if item.purchased %}bg-success text-white{% else %}item-not-checked{% endif %}" id="item-{{ item.id }}"> <div class="d-flex align-items-center gap-3 flex-grow-1">
<input type="checkbox" class="form-check-input large-checkbox" {% if item.purchased %}checked{% endif %} {% if list.is_archived %}disabled{% endif %}>
<input type="checkbox" {% if item.purchased %}checked{% endif %} {% if list.is_archived %}disabled{% endif %}>
<span id="name-{{ item.id }}" class="{% if item.purchased %}text-white{% else %}text-white{% endif %}">
{{ item.name }}
{% if item.quantity and item.quantity > 1 %}
@ -30,7 +30,7 @@
</span>
{% if item.note %}
<small class="text-danger ms-4">[ Notatka: <b>{{ item.note }}</b> ]</small>
<small class="text-danger ms-4">[ <b>{{ item.note }}</b> ]</small>
{% endif %}
</div>
<button type="button" class="btn btn-sm btn-outline-info"
@ -43,9 +43,9 @@
{% if not list.is_archived %}
<div class="input-group mb-2">
<input id="newItem" class="form-control" placeholder="Dodaj produkt">
<input id="newItem" class="form-control" placeholder="Dodaj produkt i ilość">
<input id="newQuantity" type="number" class="form-control" placeholder="Ilość" min="1" value="1" style="max-width: 90px;">
<button onclick="addItem({{ list.id }})" class="btn btn-success"> Dodaj</button>
<button onclick="addItem({{ list.id }})" class="btn btn-success rounded"> Dodaj</button>
</div>
{% endif %}
@ -54,7 +54,7 @@
<h5>💰 Dodaj wydatek</h5>
<div class="input-group mb-2">
<input id="expenseAmount" type="number" step="0.01" min="0" class="form-control" placeholder="Kwota (PLN)">
<button onclick="submitExpense({{ list.id }})" class="btn btn-success">💾 Zapisz</button>
<button onclick="submitExpense({{ list.id }})" class="btn btn-success rounded">💾 Zapisz</button>
</div>
{% endif %}
<p id="total-expense2"><b>💸 Łącznie wydano:</b> {{ '%.2f'|format(total_expense) }} PLN</p>
@ -83,7 +83,7 @@
<form action="{{ url_for('upload_receipt', list_id=list.id) }}" method="post" enctype="multipart/form-data">
<div class="input-group mb-2">
<input type="file" name="receipt" accept="image/*" capture="environment" class="form-control custom-file-input" id="receiptInput">
<button type="submit" class="btn btn-success"> Wgraj</button>
<button type="submit" class="btn btn-success rounded"> Wgraj</button>
</div>
</form>
{% endif %}