{% extends 'base.html' %} {% block title %}{{ zbiorka.nazwa }}{% endblock %} {% block content %}
{# Wyliczenia postępu finansowego #} {% set has_cel = (zbiorka.cel is defined and zbiorka.cel and zbiorka.cel > 0) %} {% set progress = (zbiorka.stan / zbiorka.cel * 100) if has_cel else 0 %} {% set progress_clamped = 100 if progress > 100 else (0 if progress < 0 else progress) %} {% set is_done=(progress_clamped>= 100) %}

{{ zbiorka.nazwa }}

{% if is_done %} Zrealizowana {% endif %} {% if zbiorka.ukryj_kwote %} Kwoty niepubliczne {% else %} Kwoty widoczne {% endif %}
Opis

{{ zbiorka.opis | markdown }}
{# Czy są produkty? #} {% set items = zbiorka.przedmioty or [] %} {% set has_items = (items|length > 0) %} {% if has_items %}
Lista zakupów

{% set posortowane = items|sort(attribute='kupione') %}
    {% for it in posortowane %}
  • {% if it.kupione %} Kupione {% else %} Do kupienia {% endif %} {{ it.nazwa }} {% if it.link %} Sklep ↗ {% endif %}
    {% if not zbiorka.ukryj_kwote %} {% if it.cena is not none %} {{ it.cena|round(2) }} PLN {% else %} {% endif %} {% else %} {% endif %}
  • {% endfor %}
{% endif %} {# Dodatkowe wyliczenia do postępu zakupów #} {% set total_cnt = items|length %} {% set kupione_cnt = (items|selectattr('kupione')|list|length) %} {% set items_pct = (kupione_cnt / total_cnt * 100) if total_cnt > 0 else 0 %} {% if not zbiorka.ukryj_kwote %} {% set suma_all = (items|selectattr('cena')|map(attribute='cena')|sum) or 0 %} {% set suma_kupione = (items|selectattr('kupione')|selectattr('cena')|map(attribute='cena')|sum) or 0 %} {% set suma_pct = (suma_kupione / suma_all * 100) if suma_all > 0 else 0 %} {% endif %}
Postęp
{% if has_cel and not zbiorka.ukryj_kwote and zbiorka.pokaz_postep_finanse %} Finanse: {{ zbiorka.stan|round(2) }} / {{ zbiorka.cel|round(2) }} PLN {% endif %} {% if has_items and zbiorka.pokaz_postep_pozycje %} Pozycje: {{ kupione_cnt }}/{{ total_cnt }} {% endif %} {% if has_items and not zbiorka.ukryj_kwote and (suma_all or 0) > 0 and zbiorka.pokaz_postep_kwotowo %} Zakupy (kwotowo): {{ (suma_kupione or 0)|round(2) }} / {{ (suma_all or 0)|round(2) }} PLN {% endif %}

{# Pasek: Finanse #} {% if zbiorka.pokaz_postep_finanse %}
Finanse
{% if zbiorka.ukryj_kwote %}—{% else %}{{ progress|round(1) }}%{% endif %}
{% endif %} {# Pasek: Zakupy sztukami #} {% if has_items and zbiorka.pokaz_postep_pozycje %}
Zakupy (liczba pozycji)
{{ items_pct|round(1) }}%
{% endif %} {# Pasek: Zakupy kwotowo #} {% if has_items and not zbiorka.ukryj_kwote and (suma_all or 0) > 0 and zbiorka.pokaz_postep_kwotowo %}
Zakupy (kwotowo)
{{ suma_pct|round(1) }}%
{% endif %}
{% set show_iban = zbiorka.uzyj_konta and zbiorka.numer_konta %} {% set show_blik = zbiorka.uzyj_blik and zbiorka.numer_telefonu_blik %}
Jak wspomóc?
{% if has_cel and not zbiorka.ukryj_kwote %} {% set brak = (zbiorka.cel - zbiorka.stan) %} {% if brak > 0 %} Brakuje: {{ brak|round(2) }} PLN {% else %} Zrealizowana {% endif %} {% endif %}
{% if show_iban or show_blik %} {% if show_iban %}
{% endif %} {% if show_blik %}
{% endif %} {% else %}
Kanały płatności są wyłączone dla tej zbiórki.
{% endif %} {% if not zbiorka.ukryj_kwote %}
    {% if has_cel %}
  • Cel {{ zbiorka.cel|round(2) }} PLN
  • {% endif %}
  • Stan {{ zbiorka.stan|round(2) }} PLN
  • {% if has_cel %}
  • {% if brak > 0 %}Brakuje{% elif brak == 0 %}Cel{% else %}Nadwyżka{% endif %} {% if brak > 0 %} {{ brak|round(2) }} PLN {% elif brak == 0 %} osiągnięty {% else %} {{ (-brak)|round(2) }} PLN {% endif %}
  • {% endif %}
{% endif %} {% if current_user.is_authenticated and current_user.czy_admin %}
{% endif %}
Aktywność / Transakcje
{% if aktywnosci and aktywnosci|length > 0 %} Łącznie pozycji: {{ aktywnosci|length }} {% endif %} {% if current_user.is_authenticated and current_user.czy_admin %} Zarządzaj {% endif %}
{% if aktywnosci and aktywnosci|length > 0 %}
    {% for a in aktywnosci %}
  • {{ a.data|dt("%d.%m.%Y %H:%M") }} {{ a.typ|capitalize }} {% if a.opis %} — {{ a.opis }} {% endif %}
    {% if not zbiorka.ukryj_kwote %} {% if a.typ == 'wpłata' %}+{% else %}-{% endif %} {{ a.kwota|round(2) }} PLN {% endif %}
  • {% endfor %}
{% else %}
Brak aktywności

Gdy pojawią się pierwsze wpłaty lub wydatki, zobaczysz je tutaj.

{% endif %}
{% endblock %} {% block extra_scripts %} {{ super() }} {% endblock %}