zmiany w ux
This commit is contained in:
@@ -159,111 +159,163 @@
|
||||
|
||||
<!-- Kolumna prawa: płatności (sticky) -->
|
||||
<div class="col-md-4">
|
||||
<div class="card shadow-sm wspomoz-card position-sticky" style="top: 1rem;">
|
||||
<div class="card-body">
|
||||
<div class="mb-3">
|
||||
<div class="d-flex align-items-center justify-content-between">
|
||||
<strong>Numer konta</strong>
|
||||
<button class="btn btn-sm btn-outline-light border" type="button"
|
||||
data-copy-target="#ibanDisplay">Kopiuj</button>
|
||||
</div>
|
||||
<div class="fs-5" id="ibanDisplay">{{ zbiorka.numer_konta }}</div>
|
||||
<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="d-flex align-items-center justify-content-between">
|
||||
<h5 class="mb-0">Jak wspomóc?</h5>
|
||||
{% if has_cel and not zbiorka.ukryj_kwote %}
|
||||
{% set brak = (zbiorka.cel - zbiorka.stan) %}
|
||||
{% if brak > 0 %}
|
||||
<span class="badge bg-warning text-dark border border-warning">
|
||||
Brakuje: {{ brak|round(2) }} PLN
|
||||
</span>
|
||||
{% else %}
|
||||
<span class="badge rounded-pill" style="background: var(--accent); color:#111;">
|
||||
Zrealizowana
|
||||
</span>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<div class="d-flex align-items-center justify-content-between">
|
||||
<strong>Telefon BLIK</strong>
|
||||
<button class="btn btn-sm btn-outline-light border" type="button"
|
||||
data-copy-target="#blikDisplay">Kopiuj</button>
|
||||
|
||||
<!-- Numer konta -->
|
||||
<div>
|
||||
<label for="ibanInput" class="form-label fw-semibold mb-1">Numer konta</label>
|
||||
<div class="input-group">
|
||||
<input id="ibanInput" type="text"
|
||||
class="form-control form-control-sm 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 border copy-btn" type="button" data-copy-input="#ibanInput"
|
||||
aria-label="Kopiuj numer konta">Kopiuj</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Telefon BLIK -->
|
||||
<div>
|
||||
<label for="blikInput" class="form-label fw-semibold mb-1">Telefon BLIK</label>
|
||||
<div class="input-group">
|
||||
<input id="blikInput" type="text"
|
||||
class="form-control form-control-sm 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 border copy-btn" type="button" data-copy-input="#blikInput"
|
||||
aria-label="Kopiuj numer BLIK">Kopiuj</button>
|
||||
</div>
|
||||
<div class="fs-5" id="blikDisplay">{{ zbiorka.numer_telefonu_blik }}</div>
|
||||
</div>
|
||||
|
||||
{% if not zbiorka.ukryj_kwote %}
|
||||
<hr class="my-3">
|
||||
<div class="d-flex flex-column gap-1">
|
||||
<ul class="list-group list-group-flush small">
|
||||
{% if has_cel %}
|
||||
<div><strong>Cel:</strong> <span class="fs-6">{{ zbiorka.cel|round(2) }} PLN</span></div>
|
||||
<li class="list-group-item bg-transparent d-flex justify-content-between">
|
||||
<span>Cel</span>
|
||||
<span class="fw-semibold">{{ zbiorka.cel|round(2) }} PLN</span>
|
||||
</li>
|
||||
{% endif %}
|
||||
<div><strong>Stan:</strong> <span class="fs-6">{{ zbiorka.stan|round(2) }} PLN</span></div>
|
||||
<li class="list-group-item bg-transparent d-flex justify-content-between">
|
||||
<span>Stan</span>
|
||||
<span class="fw-semibold text-success">{{ zbiorka.stan|round(2) }} PLN</span>
|
||||
</li>
|
||||
{% if has_cel %}
|
||||
{% set brak = (zbiorka.cel - zbiorka.stan) %}
|
||||
<small class="text-muted">
|
||||
{% if brak > 0 %}
|
||||
Do celu brakuje: {{ brak|round(2) }} PLN
|
||||
{% elif brak == 0 %}
|
||||
Cel osiągnięty.
|
||||
{% else %}
|
||||
Przekroczono cel o: {{ (brak * -1)|round(2) }} PLN
|
||||
{% endif %}
|
||||
</small>
|
||||
<li class="list-group-item bg-transparent d-flex justify-content-between">
|
||||
<span>
|
||||
{% if brak > 0 %}Brakuje{% elif brak == 0 %}Cel{% else %}Nadwyżka{% endif %}
|
||||
</span>
|
||||
<span class="fw-semibold {% if brak > 0 %}text-warning{% elif brak < 0 %}text-success{% endif %}">
|
||||
{% if brak > 0 %}
|
||||
{{ brak|round(2) }} PLN
|
||||
{% elif brak == 0 %}
|
||||
osiągnięty
|
||||
{% else %}
|
||||
{{ (-brak)|round(2) }} PLN
|
||||
{% endif %}
|
||||
</span>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
||||
|
||||
{% if current_user.is_authenticated and current_user.is_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>
|
||||
<a href="{{ url_for('edytuj_stan', zbiorka_id=zbiorka.id) }}" class="btn btn-outline-light btn-sm">Edytuj
|
||||
stan</a>
|
||||
<a href="{{ url_for('formularz_zbiorek', zbiorka_id=zbiorka.id) }}"
|
||||
class="btn btn-outline-light btn-sm">Edytuj opis</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if current_user.is_authenticated and current_user.is_admin %}
|
||||
<div class="d-grid mt-3">
|
||||
<a href="{{ url_for('dodaj_wplate', zbiorka_id=zbiorka.id) }}" class="btn btn-primary">Dodaj wpłatę</a>
|
||||
</div>
|
||||
<div class="d-grid mt-2">
|
||||
<a href="{{ url_for('dodaj_wydatek', zbiorka_id=zbiorka.id) }}" class="btn btn-outline-light border">Dodaj
|
||||
wydatek</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Aktywność -->
|
||||
<div class="card shadow-sm mt-4">
|
||||
<div class="card-header d-flex align-items-center justify-content-between">
|
||||
<h5 class="card-title mb-0">Aktywność / Transakcje</h5>
|
||||
{% if aktywnosci and aktywnosci|length > 0 %}
|
||||
<small class="text-muted">Łącznie pozycji: {{ aktywnosci|length }}</small>
|
||||
{% endif %}
|
||||
</div>
|
||||
<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-center">
|
||||
<div class="me-3">
|
||||
<strong>{{ a.data|dt("%d.%m.%Y %H:%M") }}</strong>
|
||||
<span class="badge {% if a.typ == 'wpłata' %}bg-success{% else %}bg-danger{% endif %} ms-2">
|
||||
{{ a.typ|capitalize }}
|
||||
</span>
|
||||
{% if a.opis %}
|
||||
<span class="text-muted">— {{ a.opis }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if not zbiorka.ukryj_kwote %}
|
||||
<span class="badge bg-dark border ms-auto" style="border-color: var(--border);">
|
||||
{% if a.typ == 'wpłata' %}+{% else %}-{% endif %} {{ a.kwota|round(2) }} PLN
|
||||
</span>
|
||||
|
||||
<!-- 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 %}
|
||||
</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>
|
||||
{% if current_user.is_authenticated and current_user.is_admin %}
|
||||
<a href="{{ url_for('transakcje_zbiorki', zbiorka_id=zbiorka.id) }}"
|
||||
class="btn btn-sm btn-outline-light border">
|
||||
Zarządzaj
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<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-center">
|
||||
<div class="me-3">
|
||||
<strong>{{ a.data|dt("%d.%m.%Y %H:%M") }}</strong>
|
||||
<span class="badge {% if a.typ == 'wpłata' %}bg-success{% else %}bg-danger{% endif %} ms-2">
|
||||
{{ a.typ|capitalize }}
|
||||
</span>
|
||||
{% if a.opis %}
|
||||
<span class="text-muted">— {{ a.opis }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if not zbiorka.ukryj_kwote %}
|
||||
<span class="badge bg-dark border ms-auto" style="border-color: var(--border);">
|
||||
{% if a.typ == 'wpłata' %}+{% else %}-{% endif %} {{ a.kwota|round(2) }} PLN
|
||||
</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>
|
||||
{% endif %}
|
||||
</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 border">Powrót do listy</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
<!-- 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 border">Powrót do listy</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block extra_scripts %}
|
||||
{{ super() }}
|
||||
<script src="{{ url_for('static', filename='js/zbiorka.js') }}?v={{ APP_VERSION }}"></script>
|
||||
<script src="{{ url_for('static', filename='js/progress.js') }}?v={{ APP_VERSION }}"></script>
|
||||
{% endblock %}
|
||||
{% block extra_scripts %}
|
||||
{{ super() }}
|
||||
<script src="{{ url_for('static', filename='js/zbiorka.js') }}?v={{ APP_VERSION }}"></script>
|
||||
<script src="{{ url_for('static', filename='js/progress.js') }}?v={{ APP_VERSION }}"></script>
|
||||
<script src="{{ url_for('static', filename='js/progress.js') }}?v={{ APP_VERSION }}"></script>
|
||||
{% endblock %}
|
Reference in New Issue
Block a user