opcje wydatkow w zbiorce
This commit is contained in:
@@ -97,8 +97,11 @@
|
||||
|
||||
{% 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>
|
||||
<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>
|
||||
@@ -106,35 +109,40 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Historia wpłat -->
|
||||
<!-- Aktywność (wpłaty + wydatki) -->
|
||||
<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">Historia wpłat</h5>
|
||||
{% if zbiorka.wplaty|length > 0 %}
|
||||
<small class="text-muted">Łącznie pozycji: {{ zbiorka.wplaty|length }}</small>
|
||||
<h5 class="card-title mb-0">Aktywność</h5>
|
||||
{% if aktywnosci and aktywnosci|length > 0 %}
|
||||
<small class="text-muted">Łącznie pozycji: {{ aktywnosci|length }}</small>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{% if zbiorka.wplaty and zbiorka.wplaty|length > 0 %}
|
||||
{% if aktywnosci and aktywnosci|length > 0 %}
|
||||
<ul class="list-group list-group-flush">
|
||||
{% for w in zbiorka.wplaty %}
|
||||
{% 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>{{ w.data.strftime('%Y-%m-%d %H:%M:%S') }}</strong>
|
||||
{% if w.opis %}
|
||||
<span class="text-muted">— {{ w.opis }}</span>
|
||||
<strong>{{ a.data.strftime('%Y-%m-%d %H:%M:%S') }}</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);">
|
||||
{{ w.kwota|round(2) }} PLN
|
||||
{% 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 wpłat</h6>
|
||||
<p class="text-muted mb-0">Gdy pojawią się pierwsze wpłaty, zobaczysz je tutaj.</p>
|
||||
<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>
|
||||
|
Reference in New Issue
Block a user