statystyki i optymalizacje
This commit is contained in:
@@ -12,12 +12,21 @@
|
||||
|
||||
<!-- Nagłówek -->
|
||||
<div class="d-flex flex-wrap align-items-center justify-content-between gap-2 mb-3">
|
||||
<h2 class="mb-0">
|
||||
<div>
|
||||
<h2 class="mb-0">
|
||||
{% if zbiorka.typ_zbiorki == 'rezerwa' %}
|
||||
<i class="bi bi-wallet2"></i>
|
||||
{% endif %}
|
||||
{{ zbiorka.nazwa }}
|
||||
</h2>
|
||||
{% if zbiorka.typ_zbiorki == 'rezerwa' %}
|
||||
<i class="bi bi-wallet2"></i>
|
||||
<p class="text-muted mb-0 small">Lista rezerwowa środków</p>
|
||||
{% elif is_done %}
|
||||
<p class="text-muted mb-0 small">Zbiórka zrealizowana</p>
|
||||
{% else %}
|
||||
<p class="text-muted mb-0 small">Aktywna zbiórka</p>
|
||||
{% endif %}
|
||||
{{ zbiorka.nazwa }}
|
||||
</h2>
|
||||
</div>
|
||||
<div class="d-flex flex-wrap align-items-center gap-2">
|
||||
{% if zbiorka.typ_zbiorki == 'rezerwa' %}
|
||||
<span class="badge bg-info">Lista rezerwowa</span>
|
||||
@@ -33,15 +42,15 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row g-4">
|
||||
<div class="row g-3">
|
||||
<!-- Kolumna lewa: Opis + (opcjonalnie) Lista zakupów + Postęp -->
|
||||
<div class="col-md-8">
|
||||
|
||||
<!-- Card: Opis -->
|
||||
<div class="card shadow-sm mb-4">
|
||||
<div class="card shadow-sm mb-3">
|
||||
<div class="card-body">
|
||||
<h5 class="mb-2">Opis</h5>
|
||||
<hr class="hr-bw">
|
||||
<hr class="hr-bw my-2">
|
||||
<div class="mb-0">
|
||||
{{ zbiorka.opis | markdown }}
|
||||
</div>
|
||||
@@ -54,14 +63,17 @@
|
||||
|
||||
<!-- Card: Lista zakupów (tylko gdy są produkty) -->
|
||||
{% if has_items %}
|
||||
<div class="card shadow-sm mb-4">
|
||||
<div class="card shadow-sm mb-3">
|
||||
<div class="card-body">
|
||||
<h5 class="mb-2">Lista zakupów</h5>
|
||||
<hr class="hr-bw">
|
||||
<div class="d-flex align-items-center justify-content-between mb-2">
|
||||
<h5 class="mb-0">Lista zakupów</h5>
|
||||
<span class="badge bg-secondary">{{ items|length }} pozycji</span>
|
||||
</div>
|
||||
<hr class="hr-bw my-2">
|
||||
{% set posortowane = items|sort(attribute='kupione') %}
|
||||
<ul class="list-group list-group-flush">
|
||||
{% for it in posortowane %}
|
||||
<li class="list-group-item bg-transparent d-flex flex-wrap justify-content-between align-items-center">
|
||||
<li class="list-group-item bg-transparent d-flex flex-wrap justify-content-between align-items-center py-2">
|
||||
<div class="d-flex align-items-center gap-2">
|
||||
{% if it.kupione %}
|
||||
<span class="badge bg-success">Kupione</span>
|
||||
@@ -70,8 +82,7 @@
|
||||
{% endif %}
|
||||
<span class="fw-semibold">{{ it.nazwa }}</span>
|
||||
{% if it.link %}
|
||||
<a href="{{ it.link }}" target="_blank" rel="noopener" class="btn btn-sm btn-outline-light ms-2">Sklep
|
||||
↗</a>
|
||||
<a href="{{ it.link }}" target="_blank" rel="noopener" class="btn btn-sm btn-outline-light ms-2">Sklep ↗</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div>
|
||||
@@ -131,11 +142,11 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr class="hr-bw">
|
||||
<hr class="hr-bw my-2">
|
||||
|
||||
{# Pasek: Finanse #}
|
||||
{% if zbiorka.pokaz_postep_finanse %}
|
||||
<div class="mb-3">
|
||||
<div class="mb-2">
|
||||
<small class="text-muted">Finanse</small>
|
||||
<div class="progress" role="progressbar" aria-valuenow="{{ progress_clamped|round(2) }}" aria-valuemin="0"
|
||||
aria-valuemax="100">
|
||||
@@ -149,7 +160,7 @@
|
||||
|
||||
{# Pasek: Zakupy sztukami #}
|
||||
{% if has_items and zbiorka.pokaz_postep_pozycje %}
|
||||
<div class="mb-3">
|
||||
<div class="mb-2">
|
||||
<small class="text-muted">Zakupy (liczba pozycji)</small>
|
||||
<div class="progress" role="progressbar" aria-valuenow="{{ items_pct|round(2) }}" aria-valuemin="0"
|
||||
aria-valuemax="100">
|
||||
@@ -183,7 +194,7 @@
|
||||
<!-- Kolumna prawa: płatności (sticky) -->
|
||||
<div class="col-md-4">
|
||||
<div class="card shadow-sm wspomoz-card sticky-md" style="top: var(--sticky-offset, 1rem);">
|
||||
<div class="card-body d-flex flex-column gap-3">
|
||||
<div class="card-body d-flex flex-column gap-2">
|
||||
|
||||
<div class="d-flex align-items-center justify-content-between">
|
||||
<h5 class="mb-0">
|
||||
@@ -208,12 +219,12 @@
|
||||
<!-- Numer konta -->
|
||||
<div>
|
||||
<label for="ibanInput" class="form-label fw-semibold mb-1">Numer konta</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group input-group-sm">
|
||||
<input id="ibanInput" type="text"
|
||||
class="form-control form-control-sm bg-transparent text-light border monospace-input text-truncate"
|
||||
class="form-control bg-transparent text-light border monospace-input text-truncate"
|
||||
value="{{ zbiorka.numer_konta }}" readonly autocomplete="off" autocorrect="off" autocapitalize="off"
|
||||
spellcheck="false" inputmode="text" aria-label="Numer konta do wpłaty">
|
||||
<button class="btn btn-sm btn-outline-light copy-btn" type="button" data-copy-input="#ibanInput"
|
||||
<button class="btn btn-outline-light copy-btn" type="button" data-copy-input="#ibanInput"
|
||||
aria-label="Kopiuj numer konta">Kopiuj</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -223,12 +234,12 @@
|
||||
<!-- Telefon BLIK -->
|
||||
<div>
|
||||
<label for="blikInput" class="form-label fw-semibold mb-1">Telefon / BLIK</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group input-group-sm">
|
||||
<input id="blikInput" type="text"
|
||||
class="form-control form-control-sm bg-transparent text-light border monospace-input text-truncate"
|
||||
class="form-control bg-transparent text-light border monospace-input text-truncate"
|
||||
value="{{ zbiorka.numer_telefonu_blik }}" readonly autocomplete="off" autocorrect="off"
|
||||
autocapitalize="off" spellcheck="false" inputmode="numeric" aria-label="Telefon BLIK">
|
||||
<button class="btn btn-sm btn-outline-light copy-btn" type="button" data-copy-input="#blikInput"
|
||||
<button class="btn btn-outline-light copy-btn" type="button" data-copy-input="#blikInput"
|
||||
aria-label="Kopiuj numer BLIK">Kopiuj</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -240,23 +251,23 @@
|
||||
{% endif %}
|
||||
|
||||
{% if not zbiorka.ukryj_kwote %}
|
||||
<ul class="list-group list-group-flush small">
|
||||
<ul class="list-group list-group-flush small mt-2">
|
||||
{% if zbiorka.typ_zbiorki != 'rezerwa' %}
|
||||
{% if has_cel %}
|
||||
<li class="list-group-item bg-transparent d-flex justify-content-between">
|
||||
<li class="list-group-item bg-transparent d-flex justify-content-between py-1">
|
||||
<span>Cel</span>
|
||||
<span class="fw-semibold">{{ zbiorka.cel|round(2) }} PLN</span>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
<li class="list-group-item bg-transparent d-flex justify-content-between">
|
||||
<li class="list-group-item bg-transparent d-flex justify-content-between py-1">
|
||||
<span>Stan</span>
|
||||
<span class="fw-semibold text-success">{{ zbiorka.stan|round(2) }} PLN</span>
|
||||
</li>
|
||||
|
||||
{% if zbiorka.typ_zbiorki != 'rezerwa' and has_cel %}
|
||||
<li class="list-group-item bg-transparent d-flex justify-content-between">
|
||||
<li class="list-group-item bg-transparent d-flex justify-content-between py-1">
|
||||
<span>
|
||||
{% if brak > 0 %}Brakuje{% elif brak == 0 %}Cel{% else %}Nadwyżka{% endif %}
|
||||
</span>
|
||||
@@ -275,17 +286,14 @@
|
||||
{% endif %}
|
||||
|
||||
{% if current_user.is_authenticated and current_user.czy_admin %}
|
||||
<hr>
|
||||
<div class="d-grid gap-2 mt-2">
|
||||
<a href="{{ url_for('dodaj_wplate', zbiorka_id=zbiorka.id) }}" class="btn btn-outline-light btn-sm">Dodaj
|
||||
wpłatę</a>
|
||||
<a href="{{ url_for('dodaj_wydatek', zbiorka_id=zbiorka.id) }}" class="btn btn-outline-light btn-sm">Dodaj
|
||||
wydatek</a>
|
||||
<hr class="my-2">
|
||||
<div class="d-grid gap-2">
|
||||
<a href="{{ url_for('dodaj_wplate', zbiorka_id=zbiorka.id) }}" class="btn btn-outline-light btn-sm">Dodaj wpłatę</a>
|
||||
<a href="{{ url_for('dodaj_wydatek', zbiorka_id=zbiorka.id) }}" class="btn btn-outline-light btn-sm">Dodaj wydatek</a>
|
||||
<a href="{{ url_for('dodaj_przesuniecie', zbiorka_id=zbiorka.id) }}" class="btn btn-outline-light btn-sm">
|
||||
<i class="bi bi-arrow-left-right"></i> Przesuń środki
|
||||
</a>
|
||||
<a href="{{ url_for('edytuj_stan', zbiorka_id=zbiorka.id) }}" class="btn btn-outline-light btn-sm">Edytuj
|
||||
stan</a>
|
||||
<a href="{{ url_for('edytuj_stan', zbiorka_id=zbiorka.id) }}" class="btn btn-outline-light btn-sm">Edytuj stan</a>
|
||||
{% if zbiorka.typ_zbiorki != 'rezerwa' %}
|
||||
<a href="{{ url_for('formularz_zbiorek', zbiorka_id=zbiorka.id) }}"
|
||||
class="btn btn-outline-light btn-sm">Edytuj opis</a>
|
||||
@@ -300,101 +308,102 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Aktywność -->
|
||||
<div class="card shadow-sm mt-4">
|
||||
<div class="card-header bg-transparent d-flex align-items-center justify-content-between">
|
||||
<h5 class="card-title mb-0">Aktywność / Transakcje</h5>
|
||||
<div class="d-flex align-items-center gap-2">
|
||||
{% if aktywnosci and aktywnosci|length > 0 %}
|
||||
<small class="text-muted">Łącznie pozycji: {{ aktywnosci|length }}</small>
|
||||
{% endif %}
|
||||
{% if current_user.is_authenticated and current_user.czy_admin %}
|
||||
<a href="{{ url_for('transakcje_zbiorki', zbiorka_id=zbiorka.id) }}" class="btn btn-sm btn-outline-light">
|
||||
Zarządzaj
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<!-- Aktywność -->
|
||||
<div class="card shadow-sm mt-3">
|
||||
<div class="card-header bg-transparent d-flex align-items-center justify-content-between py-2">
|
||||
<h5 class="card-title mb-0">Aktywność / Transakcje</h5>
|
||||
<div class="d-flex align-items-center gap-2">
|
||||
{% if aktywnosci and aktywnosci|length > 0 %}
|
||||
<ul class="list-group list-group-flush">
|
||||
{% for a in aktywnosci %}
|
||||
<li class="list-group-item bg-transparent d-flex flex-wrap justify-content-between align-items-start">
|
||||
<div class="me-3 flex-grow-1">
|
||||
<strong>{{ a.data|dt("%d.%m.%Y %H:%M") }}</strong>
|
||||
|
||||
{% if a.typ == 'wpłata' %}
|
||||
<span class="badge bg-success ms-2">Wpłata</span>
|
||||
{% elif a.typ == 'wydatek' %}
|
||||
<span class="badge bg-danger ms-2">Wydatek</span>
|
||||
{% elif a.typ == 'przesunięcie_przych' %}
|
||||
<span class="badge bg-info ms-2">Przesunięcie (↓ przychód)</span>
|
||||
{% elif a.typ == 'przesunięcie_wych' %}
|
||||
<span class="badge bg-warning text-dark ms-2">Przesunięcie (↑ wychód)</span>
|
||||
{% endif %}
|
||||
|
||||
{% if a.opis %}
|
||||
<span class="text-muted">— {{ a.opis }}</span>
|
||||
{% endif %}
|
||||
|
||||
{# Informacja o przesunięciu wpłaty #}
|
||||
{% if a.typ == 'wpłata' and a.przesuniecie_z %}
|
||||
<div class="text-muted small mt-1">
|
||||
<span class="badge bg-secondary">Przesunięto</span>
|
||||
Źródło:
|
||||
<a href="{{ url_for('zbiorka', zbiorka_id=a.przesuniecie_z.zbiorka_zrodlo_id) }}"
|
||||
class="text-decoration-none">
|
||||
{{ a.przesuniecie_z.zbiorka_zrodlo_nazwa }}
|
||||
</a>
|
||||
{% if a.przesuniecie_z.opis %}
|
||||
<br><span class="text-muted">{{ a.przesuniecie_z.opis }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{# Link do źródłowej/docelowej zbiórki dla przesunięć ogólnych #}
|
||||
{% if a.typ in ['przesunięcie_przych', 'przesunięcie_wych'] and a.zbiorka_id %}
|
||||
<a href="{{ url_for('zbiorka', zbiorka_id=a.zbiorka_id) }}"
|
||||
class="ms-2 text-decoration-none small">
|
||||
<i class="bi bi-link-45deg"></i>
|
||||
{% if a.typ == 'przesunięcie_przych' %}
|
||||
z: {{ a.zbiorka_nazwa }}
|
||||
{% else %}
|
||||
do: {{ a.zbiorka_nazwa }}
|
||||
{% endif %}
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% if not zbiorka.ukryj_kwote %}
|
||||
<span class="badge bg-dark border" style="border-color: var(--border);">
|
||||
{% if a.typ == 'wpłata' or a.typ == 'przesunięcie_przych' %}
|
||||
+{{ a.kwota|round(2) }} PLN
|
||||
{% else %}
|
||||
-{{ a.kwota|round(2) }} PLN
|
||||
{% endif %}
|
||||
</span>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% else %}
|
||||
<div class="text-center py-4">
|
||||
<h6 class="mb-1">Brak aktywności</h6>
|
||||
<p class="text-muted mb-0">Gdy pojawią się pierwsze wpłaty lub wydatki, zobaczysz je tutaj.</p>
|
||||
</div>
|
||||
<small class="text-muted">Łącznie pozycji: {{ aktywnosci|length }}</small>
|
||||
{% endif %}
|
||||
{% if current_user.is_authenticated and current_user.czy_admin %}
|
||||
<a href="{{ url_for('transakcje_zbiorki', zbiorka_id=zbiorka.id) }}" class="btn btn-sm btn-outline-light">
|
||||
Zarządzaj
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Akcje dolne -->
|
||||
<div class="d-flex gap-2 justify-content-between mt-3">
|
||||
<div></div>
|
||||
<a href="{{ url_for('index') }}" class="btn btn-outline-light">Powrót do listy</a>
|
||||
<div class="card-body">
|
||||
{% if aktywnosci and aktywnosci|length > 0 %}
|
||||
<ul class="list-group list-group-flush">
|
||||
{% for a in aktywnosci %}
|
||||
<li class="list-group-item bg-transparent d-flex flex-wrap justify-content-between align-items-start py-2">
|
||||
<div class="me-3 flex-grow-1">
|
||||
<strong>{{ a.data|dt("%d.%m.%Y %H:%M") }}</strong>
|
||||
|
||||
{% if a.typ == 'wpłata' %}
|
||||
<span class="badge bg-success ms-2">Wpłata</span>
|
||||
{% elif a.typ == 'wydatek' %}
|
||||
<span class="badge bg-danger ms-2">Wydatek</span>
|
||||
{% elif a.typ == 'przesunięcie_przych' %}
|
||||
<span class="badge bg-info ms-2">Przesunięcie (↓ przychód)</span>
|
||||
{% elif a.typ == 'przesunięcie_wych' %}
|
||||
<span class="badge bg-warning text-dark ms-2">Przesunięcie (↑ wychód)</span>
|
||||
{% endif %}
|
||||
|
||||
{% if a.opis %}
|
||||
<span class="text-muted">— {{ a.opis }}</span>
|
||||
{% endif %}
|
||||
|
||||
{# Informacja o przesunięciu wpłaty #}
|
||||
{% if a.typ == 'wpłata' and a.przesuniecie_z %}
|
||||
<div class="text-muted small mt-1">
|
||||
<span class="badge bg-secondary">Przesunięto</span>
|
||||
Źródło:
|
||||
<a href="{{ url_for('zbiorka', zbiorka_id=a.przesuniecie_z.zbiorka_zrodlo_id) }}"
|
||||
class="text-decoration-none">
|
||||
{{ a.przesuniecie_z.zbiorka_zrodlo_nazwa }}
|
||||
</a>
|
||||
{% if a.przesuniecie_z.opis %}
|
||||
<br><span class="text-muted">{{ a.przesuniecie_z.opis }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{# Link do źródłowej/docelowej zbiórki dla przesunięć ogólnych #}
|
||||
{% if a.typ in ['przesunięcie_przych', 'przesunięcie_wych'] and a.zbiorka_id %}
|
||||
<a href="{{ url_for('zbiorka', zbiorka_id=a.zbiorka_id) }}"
|
||||
class="ms-2 text-decoration-none small">
|
||||
<i class="bi bi-link-45deg"></i>
|
||||
{% if a.typ == 'przesunięcie_przych' %}
|
||||
z: {{ a.zbiorka_nazwa }}
|
||||
{% else %}
|
||||
do: {{ a.zbiorka_nazwa }}
|
||||
{% endif %}
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% if not zbiorka.ukryj_kwote %}
|
||||
<span class="badge bg-dark border" style="border-color: var(--border);">
|
||||
{% if a.typ == 'wpłata' or a.typ == 'przesunięcie_przych' %}
|
||||
+{{ a.kwota|round(2) }} PLN
|
||||
{% else %}
|
||||
-{{ a.kwota|round(2) }} PLN
|
||||
{% endif %}
|
||||
</span>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% else %}
|
||||
<div class="text-center py-4">
|
||||
<h6 class="mb-1">Brak aktywności</h6>
|
||||
<p class="text-muted mb-0">Gdy pojawią się pierwsze wpłaty lub wydatki, zobaczysz je tutaj.</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Akcje dolne -->
|
||||
<div class="d-flex gap-2 justify-content-between mt-3">
|
||||
<div></div>
|
||||
<a href="{{ url_for('index') }}" class="btn btn-outline-light">Powrót do listy</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user