55 lines
2.2 KiB
HTML
55 lines
2.2 KiB
HTML
{% extends 'base.html' %}
|
|
{% block title %}Panel Admina{% endblock %}
|
|
{% block content %}
|
|
<div class="container my-4">
|
|
<h3 class="mb-4">Panel Admina</h3>
|
|
<div class="mb-3">
|
|
<a href="{{ url_for('dodaj_zbiorka') }}" class="btn btn-success">Dodaj zbiórkę</a>
|
|
</div>
|
|
<div class="table-responsive">
|
|
<table class="table table-dark table-striped table-hover">
|
|
<thead>
|
|
<tr>
|
|
<th>ID</th>
|
|
<th>Nazwa</th>
|
|
<th>Widoczność</th>
|
|
<th>Opcje</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for z in zbiorki %}
|
|
<tr>
|
|
<td>{{ z.id }}</td>
|
|
<td>{{ z.nazwa }}</td>
|
|
<td>
|
|
{% if z.ukryta %}
|
|
<span class="badge bg-secondary">Ukryta</span>
|
|
{% else %}
|
|
<span class="badge bg-success">Widoczna</span>
|
|
{% endif %}
|
|
</td>
|
|
<td>
|
|
<a href="{{ url_for('edytuj_zbiorka', zbiorka_id=z.id) }}" class="btn btn-primary btn-sm">Edytuj</a>
|
|
<a href="{{ url_for('admin_dodaj_wplate', zbiorka_id=z.id) }}" class="btn btn-warning btn-sm">Dodaj wpłatę</a>
|
|
<a href="{{ url_for('edytuj_stan', zbiorka_id=z.id) }}" class="btn btn-info btn-sm">Edytuj stan</a>
|
|
<form action="{{ url_for('toggle_visibility', zbiorka_id=z.id) }}" method="post" style="display: inline;">
|
|
<button type="submit" class="btn btn-secondary btn-sm">
|
|
{% if z.ukryta %} Pokaż {% else %} Ukryj {% endif %}
|
|
</button>
|
|
</form>
|
|
<form action="{{ url_for('usun_zbiorka', zbiorka_id=z.id) }}" method="post" style="display: inline;">
|
|
<button type="submit" class="btn btn-danger btn-sm" onclick="return confirm('Czy na pewno chcesz usunąć tę zbiórkę?');">Usuń</button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
{% else %}
|
|
<tr>
|
|
<td colspan="4" class="text-center">Brak zbiórek</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|