new fuctions

This commit is contained in:
Mateusz Gruszczyński
2025-08-11 23:44:01 +02:00
parent dc8bfacdf6
commit 9d5630bde3
4 changed files with 88 additions and 11 deletions

View File

@@ -127,6 +127,41 @@
</div>
</div>
{% if not show_all %}
{% 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') %}
{% endif %}
<div class="d-flex justify-content-between align-items-center mb-3 flex-wrap gap-2">
<div>
{% if not show_all %}
<a href="{{ url_for('admin_panel', month=prev_month) }}" class="btn btn-outline-light btn-sm">
← Poprzedni
</a>
<a href="{{ url_for('admin_panel', month=next_month) }}" class="btn btn-outline-light btn-sm">
Następny →
</a>
{% endif %}
</div>
<form method="get">
<div class="input-group input-group-sm">
<span class="input-group-text bg-secondary text-white">📅</span>
<select name="month" 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>
<div class="card bg-dark text-white mb-5">
<div class="card-body">
<h3 class="mt-4">📄 Wszystkie listy zakupowe</h3>

View File

@@ -13,7 +13,7 @@
<div class="card bg-dark text-white mb-5">
<div class="card-body p-0">
<div class="table-responsive">
<table class="table table-dark table-striped table-hover align-middle mb-0">
<table class="table table-dark table-striped table-hover align-middle mb-0 sortable">
<thead>
<tr>
<th scope="col">ID</th>
@@ -57,11 +57,4 @@
{% block scripts %}
<script src="https://cdn.jsdelivr.net/npm/tom-select/dist/js/tom-select.complete.min.js"></script>
<script src="{{ url_for('static_bp.serve_js', filename='admin_mass_categories.js') }}"></script>
<style>
.ts-dropdown {
z-index: 9999 !important;
/* 🔹 dropdown zawsze na wierzchu */
}
</style>
{% endblock %}