{% extends 'base.html' %} {% block title %}Panel administratora{% endblock %} {% block content %}

⚙️ Panel administratora

Wgląd w użytkowników, listy, paragony, wydatki i ustawienia aplikacji.

← Powrót do strony głównej
{% include 'admin/_nav.html' %}
📊 Statystyki ogólne
👤 Użytkownicy {{ user_count }}
📝 Listy zakupowe {{ list_count }}
🛒 Produkty na listach {{ item_count }}
✅ Zakupione {{ purchased_items_count }}
🚫 Nieoznaczone jako kupione {{ not_purchased_count }}
✍️ Produkty z notatkami {{ items_with_notes }}
🕓 Śr. czas do zakupu (h) {{ avg_hours_to_purchase }}
💸 Średnia kwota na listę {{ format_currency(avg_list_expense) }}

📈 Średnie tempo tworzenia list:
  • 📆 Tygodniowo: {{ avg_per_week }}
  • 🗓️ Miesięcznie: {{ avg_per_month }}
🔥 Najczęściej kupowane produkty
{% if top_products %} {% set max_count = top_products[0][1] %} {% for name, count in top_products %}
{{ name }} {{ count }}x
{% endfor %} {% else %}

Brak danych

{% endif %}
💸 Podsumowanie wydatków
Typ listy Miesiąc Rok Całkowite
Wszystkie {{ format_currency(expense_summary.all.month) }} {{ format_currency(expense_summary.all.year) }} {{ format_currency(expense_summary.all.total) }}
Aktywne {{ format_currency(expense_summary.active.month) }} {{ format_currency(expense_summary.active.year) }} {{ format_currency(expense_summary.active.total) }}
Archiwalne {{ format_currency(expense_summary.archived.month) }} {{ format_currency(expense_summary.archived.year) }} {{ format_currency(expense_summary.archived.total) }}
Wygasłe {{ format_currency(expense_summary.expired.month) }} {{ format_currency(expense_summary.expired.year) }} {{ format_currency(expense_summary.expired.total) }}
📊 Pokaż wykres wydatków
{% if expiring_lists %}
⏰ Listy tymczasowe wygasające w ciągu 24h
{% endif %}
{# panel wyboru miesiąca zawsze widoczny #}
{# LEWA STRONA — przyciski ← → TYLKO gdy nie show_all #}
{% 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') %} {% if prev_month in month_options %} ← {{ prev_month }} {% else %} {% endif %} {% if next_month in month_options %} {{ next_month }} → {% else %} {% endif %} {% else %} {# Tryb wszystkie miesiące — możemy pokazać skrót do bieżącego miesiąca #} 📅 Przejdź do bieżącego miesiąca {% endif %}
{# PRAWA STRONA — picker miesięcy zawsze widoczny #}
📅

📄 Listy zakupowe {% if show_all %} — wszystkie miesiące {% else %} — {{ month_str|replace('-', ' / ') }} {% endif %}

{% for e in enriched_lists %} {% set l = e.list %} {% endfor %} {% if enriched_lists|length == 0 %} {% endif %}
ID Tytuł Status Utworzono Właściciel Produkty Progress Koment. Paragony Wydatki Akcje
{{ l.id }} {{ l.title }}{% if l.is_temporary and l.expires_at %}
wygasa: {{ l.expires_at.strftime('%Y-%m-%d %H:%M') }}
{% endif %} {% if l.categories %} 🏷 {% endif %}
{% if l.is_archived %} Archiwalna {% elif e.expired %} Wygasła {% else %} Aktywna {% endif %} {{ l.created_at.strftime('%Y-%m-%d %H:%M') if l.created_at else '-' }} {% if l.owner %} 👤 {{ l.owner.username }} ({{ l.owner.id }}) {% else %} - {% endif %} {{ e.total_count }}
{{ e.purchased_count }}/{{ e.total_count }}
{{ e.comments_count }} {{ e.receipts_count }} {% if e.total_expense > 0 %} {{ format_currency(e.total_expense) }} {% else %} - {% endif %}
✏️
Brak list zakupowych do wyświetlenia
Python: {{ python_version.split()[0] }} | {{ system_info }} | RAM app: {{ app_memory }} | DB: {{ db_info.engine|upper }}{% if db_info.version %} v{{ db_info.version[0] }}{% endif %} | Tabele: {{ table_count }} | Rekordy: {{ record_total }} | Uptime: {{ uptime_minutes }} min
{% block scripts %} {% endblock %} {% endblock %}