dropbna poprawka w stringu

This commit is contained in:
Mateusz Gruszczyński
2025-08-12 22:43:16 +02:00
parent 3dfc8c6be6
commit a2950644c1

View File

@@ -128,54 +128,50 @@
</div>
{% if not show_all %}
{# Ustal bieżący miesiąc jako początek #}
{% set current_date = now.replace(day=1) %}
{% set prev_month = (current_date - timedelta(days=1)).strftime('%Y-%m') %}
{% set next_month = (current_date + timedelta(days=31)).replace(day=1).strftime('%Y-%m') %}
<div class="d-flex justify-content-between align-items-center mb-3 flex-wrap gap-2">
<div>
{# Poprzedni miesiąc #}
{# LEWA STRONA - Przyciski #}
<div class="d-flex gap-2">
{% if prev_month in month_options %}
<a href="{{ url_for('admin_panel', m=prev_month) }}" class="btn btn-outline-light btn-sm">
← {{ prev_month }}
</a>
{% else %}
<button class="btn btn-outline-light btn-sm opacity-50" disabled>
← {{ prev_month }}
</button>
<button class="btn btn-outline-light btn-sm opacity-50" disabled>← {{ prev_month }}</button>
{% endif %}
{# Następny miesiąc #}
{% if next_month in month_options %}
<a href="{{ url_for('admin_panel', m=next_month) }}" class="btn btn-outline-light btn-sm">
{{ next_month }} →
</a>
{% else %}
<button class="btn btn-outline-light btn-sm opacity-50" disabled>
{{ next_month }} →
</button>
<button class="btn btn-outline-light btn-sm opacity-50" disabled>{{ next_month }} →</button>
{% endif %}
</div>
{# PRAWA STRONA - Picker #}
<form method="get" class="m-0">
<div class="input-group input-group-sm">
<span class="input-group-text bg-secondary text-white">📅</span>
<select name="m" class="form-select bg-dark text-white border-secondary" onchange="this.form.submit()">
<option value="all" {% if show_all %}selected{% endif %}>Wszystkie miesiące</option>
{% for val in month_options %}
{% set date_obj = (val ~ '-01') | todatetime %}
<option value="{{ val }}" {% if month_str==val %}selected{% endif %}>
{{ date_obj.strftime('%B %Y')|capitalize }}
</option>
{% endfor %}
</select>
</div>
</form>
</div>
{% endif %}
<form method="get">
<div class="input-group input-group-sm">
<span class="input-group-text bg-secondary text-white">📅</span>
<select name="m" class="form-select bg-dark text-white border-secondary" onchange="this.form.submit()">
<option value="all" {% if show_all %}selected{% endif %}>Wszystkie miesiące</option>
{% for val in month_options %}
{% set date_obj = (val ~ '-01') | todatetime %}
<option value="{{ val }}" {% if month_str==val %}selected{% endif %}>
{{ date_obj.strftime('%B %Y')|capitalize }}
</option>
{% endfor %}
</select>
</div>
</form>
<div class="card bg-dark text-white mb-5">
<div class="card-body">
<h3 class="mt-4">