first commit

This commit is contained in:
Mateusz Gruszczyński
2025-03-07 22:35:43 +01:00
commit 6bd6284f49
17 changed files with 652 additions and 0 deletions

60
templates/zbiorka.html Normal file
View File

@ -0,0 +1,60 @@
{% extends 'base.html' %}
{% block title %}{{ zbiorka.nazwa }}{% endblock %}
{% block content %}
<div class="container my-4">
<div class="card mb-4">
<div class="card-header">
<h1 class="card-title">{{ zbiorka.nazwa }}</h1>
</div>
<div class="card-body">
<!-- Opis zbiórki renderowany przy użyciu Markdown -->
<div class="mb-3">
{{ zbiorka.opis | markdown }}
</div>
<ul class="list-group list-group-flush mb-3">
<li class="list-group-item"><strong>Numer konta:</strong> {{ zbiorka.numer_konta }}</li>
<li class="list-group-item"><strong>Numer telefonu BLIK:</strong> {{ zbiorka.numer_telefonu_blik }}</li>
{% if not zbiorka.ukryj_kwote %}
<li class="list-group-item"><strong>Cel zbiórki:</strong> {{ zbiorka.cel }} PLN</li>
<li class="list-group-item"><strong>Stan zbiórki:</strong> {{ zbiorka.stan }} PLN</li>
{% endif %}
</ul>
{% set progress = (zbiorka.stan / zbiorka.cel * 100) if zbiorka.cel > 0 else 0 %}
<h5>Postęp zbiórki</h5>
<div class="progress mb-3" style="height: 40px;">
<div class="progress-bar progress-bar-striped progress-bar-animated" role="progressbar"
style="width: {{ progress if progress < 100 else 100 }}%;"
aria-valuenow="{{ progress }}" aria-valuemin="0" aria-valuemax="100">
{{ progress|round(2) }}%
</div>
</div>
<div class="d-flex justify-content-between">
{% if current_user.is_authenticated and current_user.is_admin %}
<a href="{{ url_for('admin_dodaj_wplate', zbiorka_id=zbiorka.id) }}" class="btn btn-primary">Dodaj wpłatę</a>
{% endif %}
<a href="{{ url_for('index') }}" class="btn btn-secondary">Powrót do listy zbiórek</a>
</div>
</div>
</div>
<div class="card">
<div class="card-header">
<h2 class="card-title">Wpłaty</h2>
</div>
<div class="card-body">
{% if zbiorka.wplaty|length > 0 %}
<ul class="list-group">
{% for w in zbiorka.wplaty %}
<li class="list-group-item">
<strong>{{ w.data.strftime('%Y-%m-%d %H:%M:%S') }}:</strong> {{ w.kwota }} PLN
{% if w.opis %} {{ w.opis }}{% endif %}
</li>
{% endfor %}
</ul>
{% else %}
<p>Brak wpłat</p>
{% endif %}
</div>
</div>
</div>
{% endblock %}