From 5db700f3b054a1d6b9f0f6b7d0ebf022d16579a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Gruszczy=C5=84ski?= Date: Thu, 11 Dec 2025 15:24:55 +0100 Subject: [PATCH] rezerwa bez progressu --- templates/index.html | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/templates/index.html b/templates/index.html index 536731b..0d2c3f9 100644 --- a/templates/index.html +++ b/templates/index.html @@ -20,21 +20,22 @@ zbiórki{% endif %}{% endblock %} href="{{ url_for('zbiorki_zrealizowane') }}">Zrealizowane - {% if zbiorki and zbiorki|length > 0 %}
{% for z in zbiorki %} {% set progress = (z.stan / z.cel * 100) if z.cel > 0 else 0 %} - {% set progress_clamped = 100 if progress > 100 else (0 if progress < 0 else progress) %}
+ {% set progress_clamped = 100 if progress > 100 else (0 if progress < 0 else progress) %} +
{{ z.nazwa }}
- {% if is_completed_view or progress_clamped >= 100 %} + {% if z.typ_zbiorki == 'rezerwa' %} + Rezerwa + {% elif is_completed_view or progress_clamped >= 100 %} Zrealizowana {% endif %}
@@ -42,7 +43,7 @@ zbiórki{% endif %}{% endblock %}
{% if not z.ukryj_kwote %} - {% if z.cel > 0 %} + {% if z.cel > 0 and z.typ_zbiorki != 'rezerwa' %} Cel: {{ z.cel|round(2) }} PLN @@ -51,23 +52,25 @@ zbiórki{% endif %}{% endblock %} Stan: {{ z.stan|round(2) }} PLN - {% if z.cel > 0 %} + {% if z.cel > 0 and z.typ_zbiorki != 'rezerwa' %} {% set delta = z.cel - z.stan %} {% if delta > 0 %} - Brakuje: {{ delta|round(2) }} PLN - {% elif delta < 0 %} + {% elif delta < 0 %} + Nadwyżka: {{ (-delta)|round(2) }} PLN - - {% endif %} - {% endif %} - {% else %} - Kwoty niepubliczne - {% endif %} + + {% endif %} + {% endif %} + {% else %} + Kwoty niepubliczne + {% endif %}
+ {# Progress bar TYLKO dla standardowych zbiórek (nie dla rezerwowych) #} + {% if z.typ_zbiorki != 'rezerwa' %}
Postęp ukryty {% endif %}
+ {% endif %}
- {# TO POWODUJE ZE BLOK JEST KLIKALNY #} @@ -96,8 +99,8 @@ zbiórki{% endif %}{% endblock %}
-
-{% endfor %} +
+ {% endfor %}
{% else %}