nowe funkcje i zmiany ux

This commit is contained in:
Mateusz Gruszczyński
2025-07-17 13:35:21 +02:00
parent 133b91073d
commit 377e592f90
9 changed files with 255 additions and 111 deletions

View File

@@ -117,11 +117,11 @@
<td>
{% if l.is_archived %}
<span class="badge bg-secondary">Archiwalna</span>
{% elif l.is_temporary and l.expires_at and l.expires_at < now %} <span
class="badge bg-warning text-dark">Wygasła</span>
{% else %}
<span class="badge bg-success">Aktywna</span>
{% endif %}
{% elif e.expired %}
<span class="badge bg-warning text-dark">Wygasła</span>
{% else %}
<span class="badge bg-success">Aktywna</span>
{% endif %}
</td>
<td>{{ l.created_at.strftime('%Y-%m-%d %H:%M') if l.created_at else '-' }}</td>
<td>

View File

@@ -52,13 +52,21 @@
<label class="form-check-label" for="temporary">Tymczasowa</label>
</div>
<div class="mb-3">
<label for="expires_at" class="form-label">Data wygaśnięcia</label>
<input type="datetime-local" class="form-control bg-dark text-white border-secondary rounded" id="expires_at"
name="expires_at" value="{{ list.expires_at.strftime('%Y-%m-%dT%H:%M') if list.expires_at else '' }}">
<div class="row">
<div class="col-md-6 mb-3">
<label for="expires_date" class="form-label">Data wygaśnięcia</label>
<input type="date" class="form-control bg-dark text-white border-secondary rounded" id="expires_date"
name="expires_date" value="{{ list.expires_at.strftime('%Y-%m-%d') if list.expires_at else '' }}">
</div>
<div class="col-md-6 mb-3">
<label for="expires_time" class="form-label">Godzina wygaśnięcia</label>
<input type="time" class="form-control bg-dark text-white border-secondary rounded" id="expires_time"
name="expires_time" value="{{ list.expires_at.strftime('%H:%M') if list.expires_at else '' }}">
</div>
</div>
<div class="mb-4">
<label class="form-label">Link do udostępnienia</label>
<input type="text" class="form-control bg-dark text-white border-secondary rounded" readonly

View File

@@ -39,18 +39,16 @@
<div class="d-flex align-items-center gap-2 flex-wrap">
{% if current_user.is_authenticated %}
{% if current_user.is_admin %}
<a href="{{ url_for('admin_panel') }}" class="btn btn-outline-light btn-sm">⚙️ Panel admina</a>
<a href="{{ url_for('admin_panel') }}" class="btn btn-outline-light btn-sm">⚙️</a>
{% endif %}
<a href="{{ url_for('user_expenses') }}" class="btn btn-outline-light btn-sm">📊 Statystyki</a>
<a href="{{ url_for('logout') }}" class="btn btn-outline-light btn-sm">🚪 Wyloguj</a>
<a href="{{ url_for('user_expenses') }}" class="btn btn-outline-light btn-sm">📊</a>
<a href="{{ url_for('logout') }}" class="btn btn-outline-light btn-sm">🚪</a>
{% else %}
<a href="{{ url_for('login') }}" class="btn btn-outline-light btn-sm">🔑 Zaloguj</a>
{% endif %}
</div>
{% endif %}
</div>
</nav>

View File

@@ -4,11 +4,44 @@
<h2>Edytuj listę: {{ list.title }}</h2>
<form method="post">
<div class="mb-3">
<label for="title" class="form-label">Ustaw nazwe</label>
<label for="title" class="form-label">Nazwa listy</label>
<input type="text" name="title" id="title" class="form-control" value="{{ list.title }}" required>
</div>
<div class="form-check mb-3">
<input class="form-check-input rounded" type="checkbox" name="is_public" id="is_public" {% if list.is_public
%}checked{% endif %}>
<label class="form-check-label" for="is_public">Lista publiczna</label>
</div>
<div class="form-check mb-3">
<input class="form-check-input rounded" type="checkbox" name="is_temporary" id="is_temporary" {% if
list.is_temporary %}checked{% endif %}>
<label class="form-check-label" for="is_temporary">Lista tymczasowa</label>
</div>
<div class="row mb-3">
<div class="col-md-6">
<label for="expires_date" class="form-label">Data wygaśnięcia</label>
<input type="date" class="form-control rounded" id="expires_date" name="expires_date"
value="{{ list.expires_at.strftime('%Y-%m-%d') if list.expires_at else '' }}">
</div>
<div class="col-md-6">
<label for="expires_time" class="form-label">Godzina wygaśnięcia</label>
<input type="time" class="form-control rounded" id="expires_time" name="expires_time"
value="{{ list.expires_at.strftime('%H:%M') if list.expires_at else '' }}">
</div>
</div>
<div class="form-check mb-3">
<input class="form-check-input" type="checkbox" name="is_archived" id="is_archived" {% if list.is_archived
%}checked{% endif %}>
<label class="form-check-label" for="is_archived">Zarchiwizowana</label>
</div>
<button type="submit" class="btn btn-success">Zapisz</button>
<a href="{{ url_for('main_page') }}" class="btn btn-secondary">Anuluj</a>
</form>
{% endblock %}

View File

@@ -49,19 +49,19 @@
<div class="d-flex justify-content-between align-items-center flex-wrap w-100">
<span class="fw-bold">{{ l.title }} (Autor: Ty)</span>
<div class="d-flex flex-wrap mt-2 mt-md-0">
<a href="/list/{{ l.id }}" class="btn btn-sm btn-outline-light me-1 mb-1">📄 Otwórz</a>
<a href="/copy/{{ l.id }}" class="btn btn-sm btn-outline-light me-1 mb-1">📋 Kopiuj</a>
<a href="/edit_my_list/{{ l.id }}" class="btn btn-sm btn-outline-light me-1 mb-1">✏️ Edytuj</a>
<a href="/toggle_archive_list/{{ l.id }}?archive=true" class="btn btn-sm btn-outline-light me-1 mb-1">🗄️
Archiwizuj</a>
<div class="btn-group mt-2 mt-md-0" role="group">
<a href="/list/{{ l.id }}" class="btn btn-sm btn-outline-light">📄 Otwórz</a>
<a href="/copy/{{ l.id }}" class="btn btn-sm btn-outline-light">📋 Kopiuj</a>
<a href="/edit_my_list/{{ l.id }}" class="btn btn-sm btn-outline-light">✏️ Edytuj</a>
<a href="/toggle_archive_list/{{ l.id }}?archive=true" class="btn btn-sm btn-outline-light">🗄️ Archiwizuj</a>
{% if l.is_public %}
<a href="/toggle_visibility/{{ l.id }}" class="btn btn-sm btn-outline-light me-1 mb-1">🙈 Ukryj</a>
<a href="/toggle_visibility/{{ l.id }}" class="btn btn-sm btn-outline-light">🙈 Ukryj</a>
{% else %}
<a href="/toggle_visibility/{{ l.id }}" class="btn btn-sm btn-outline-light me-1 mb-1">👁️ Odkryj</a>
<a href="/toggle_visibility/{{ l.id }}" class="btn btn-sm btn-outline-light">👁️ Odkryj</a>
{% endif %}
</div>
</div>
<div class="progress progress-dark progress-thin mt-2 position-relative">
<div class="progress-bar bg-warning text-dark" role="progressbar" style="width: {{ percent }}%;"
aria-valuenow="{{ percent }}" aria-valuemin="0" aria-valuemax="100">