first commit
This commit is contained in:
16
templates/admin/add_wplata.html
Normal file
16
templates/admin/add_wplata.html
Normal file
@ -0,0 +1,16 @@
|
||||
{% extends 'base.html' %}
|
||||
{% block title %}Dodaj wpłatę{% endblock %}
|
||||
{% block content %}
|
||||
<h1>Dodaj wpłatę do zbiórki: {{ zbiorka.nazwa }}</h1>
|
||||
<form method="post">
|
||||
<div class="mb-3">
|
||||
<label for="kwota" class="form-label">Kwota wpłaty (PLN)</label>
|
||||
<input type="number" step="0.01" class="form-control" id="kwota" name="kwota" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="opis" class="form-label">Opis wpłaty (opcjonalnie)</label>
|
||||
<textarea class="form-control" id="opis" name="opis" rows="3"></textarea>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-success">Dodaj wpłatę</button>
|
||||
</form>
|
||||
{% endblock %}
|
43
templates/admin/add_zbiorka.html
Normal file
43
templates/admin/add_zbiorka.html
Normal file
@ -0,0 +1,43 @@
|
||||
{% extends 'base.html' %}
|
||||
{% block title %}Dodaj zbiórkę{% endblock %}
|
||||
{% block content %}
|
||||
<h1>Dodaj nową zbiórkę</h1>
|
||||
<form method="post">
|
||||
<!-- Pozostałe pola formularza -->
|
||||
<div class="mb-3">
|
||||
<label for="nazwa" class="form-label">Nazwa zbiórki</label>
|
||||
<input type="text" class="form-control" id="nazwa" name="nazwa" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="opis" class="form-label">Opis</label>
|
||||
<textarea class="form-control" id="opis" name="opis" rows="6" required></textarea>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="numer_konta" class="form-label">Numer konta</label>
|
||||
<input type="text" class="form-control" id="numer_konta" name="numer_konta" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="numer_telefonu_blik" class="form-label">Numer telefonu BLIK</label>
|
||||
<input type="text" class="form-control" id="numer_telefonu_blik" name="numer_telefonu_blik" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="cel" class="form-label">Cel zbiórki (PLN)</label>
|
||||
<input type="number" step="0.01" class="form-control" id="cel" name="cel" required>
|
||||
</div>
|
||||
<div class="form-check mb-3">
|
||||
<input type="checkbox" class="form-check-input" id="ukryj_kwote" name="ukryj_kwote">
|
||||
<label class="form-check-label" for="ukryj_kwote">Ukryj kwoty (cel i stan)</label>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-success">Dodaj zbiórkę</button>
|
||||
</form>
|
||||
|
||||
<!-- Inicjalizacja edytora Markdown (SimpleMDE) -->
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.css">
|
||||
<script src="https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.js"></script>
|
||||
<script>
|
||||
var simplemde = new SimpleMDE({
|
||||
element: document.getElementById("opis"),
|
||||
forceSync: true
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
50
templates/admin/dashboard.html
Normal file
50
templates/admin/dashboard.html
Normal file
@ -0,0 +1,50 @@
|
||||
{% extends 'base.html' %}
|
||||
{% block title %}Panel Admina{% endblock %}
|
||||
{% block content %}
|
||||
<h1>Panel Admina</h1>
|
||||
<div class="mb-3">
|
||||
<a href="{{ url_for('dodaj_zbiorka') }}" class="btn btn-success">Dodaj zbiórkę</a>
|
||||
</div>
|
||||
<table class="table table-dark table-striped">
|
||||
<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">Brak zbiórek</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endblock %}
|
43
templates/admin/edit_zbiorka.html
Normal file
43
templates/admin/edit_zbiorka.html
Normal file
@ -0,0 +1,43 @@
|
||||
{% extends 'base.html' %}
|
||||
{% block title %}Edytuj zbiórkę{% endblock %}
|
||||
{% block content %}
|
||||
<h1>Edytuj zbiórkę</h1>
|
||||
<form method="post">
|
||||
<!-- Pozostałe pola formularza -->
|
||||
<div class="mb-3">
|
||||
<label for="nazwa" class="form-label">Nazwa zbiórki</label>
|
||||
<input type="text" class="form-control" id="nazwa" name="nazwa" value="{{ zbiorka.nazwa }}" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="opis" class="form-label">Opis</label>
|
||||
<textarea class="form-control" id="opis" name="opis" rows="6" required>{{ zbiorka.opis }}</textarea>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="numer_konta" class="form-label">Numer konta</label>
|
||||
<input type="text" class="form-control" id="numer_konta" name="numer_konta" value="{{ zbiorka.numer_konta }}" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="numer_telefonu_blik" class="form-label">Numer telefonu BLIK</label>
|
||||
<input type="text" class="form-control" id="numer_telefonu_blik" name="numer_telefonu_blik" value="{{ zbiorka.numer_telefonu_blik }}" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="cel" class="form-label">Cel zbiórki (PLN)</label>
|
||||
<input type="number" step="0.01" class="form-control" id="cel" name="cel" value="{{ zbiorka.cel }}" required>
|
||||
</div>
|
||||
<div class="form-check mb-3">
|
||||
<input type="checkbox" class="form-check-input" id="ukryj_kwote" name="ukryj_kwote" {% if zbiorka.ukryj_kwote %}checked{% endif %}>
|
||||
<label class="form-check-label" for="ukryj_kwote">Ukryj kwoty (cel i stan)</label>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Zaktualizuj zbiórkę</button>
|
||||
</form>
|
||||
|
||||
<!-- Inicjalizacja edytora Markdown (SimpleMDE) -->
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.css">
|
||||
<script src="https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.js"></script>
|
||||
<script>
|
||||
var simplemde = new SimpleMDE({
|
||||
element: document.getElementById("opis"),
|
||||
forceSync: true
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
13
templates/admin/edytuj_stan.html
Normal file
13
templates/admin/edytuj_stan.html
Normal file
@ -0,0 +1,13 @@
|
||||
{% extends 'base.html' %}
|
||||
{% block title %}Edytuj stan zbiórki{% endblock %}
|
||||
{% block content %}
|
||||
<h1>Edytuj stan zbiórki: {{ zbiorka.nazwa }}</h1>
|
||||
<form method="post">
|
||||
<div class="mb-3">
|
||||
<label for="stan" class="form-label">Nowy stan zbiórki (PLN)</label>
|
||||
<input type="number" step="0.01" class="form-control" id="stan" name="stan" value="{{ zbiorka.stan }}" required>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Aktualizuj stan</button>
|
||||
<a href="{{ url_for('admin_dashboard') }}" class="btn btn-secondary">Powrót</a>
|
||||
</form>
|
||||
{% endblock %}
|
Reference in New Issue
Block a user