zbiorki_app/templates/index.html
2025-03-08 09:22:32 +01:00

26 lines
1.0 KiB
HTML

{% extends 'base.html' %}
{% block title %}Lista Zbiórek{% endblock %}
{% block content %}
<h1 class="mb-4">Lista Zbiórek</h1>
<div class="row">
{% for z in zbiorki %}
<div class="col-sm-12 col-md-6 col-lg-4 mb-4">
<div class="card">
<div class="card-body">
<h5 class="card-title">{{ z.nazwa }}</h5>
{% set progress = (z.stan / z.cel * 100) if z.cel > 0 else 0 %}
<div class="progress mb-3" style="height: 20px;">
<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>
<a href="{{ url_for('zbiorka', zbiorka_id=z.id) }}" class="btn btn-primary btn-sm">Wejdź do zbiórki</a>
</div>
</div>
</div>
{% else %}
<p>Brak zbiórek</p>
{% endfor %}
</div>
{% endblock %}