diff --git a/static/css/style.css b/static/css/style.css index 2f98d04..b644d70 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -977,3 +977,14 @@ td select.tom-dark { font-size: 0.75rem; } } + +/* Mobile-only / Desktop-only helpery (jeśli nie chcesz polegać na d-sm-*) */ +@media (max-width: 420px) { + .user-label-desktop { display: none !important; } + .user-label-mobile { display: inline !important; } +} + +@media (min-width: 421px) { + .user-label-desktop { display: inline !important; } + .user-label-mobile { display: none !important; } +} \ No newline at end of file diff --git a/templates/base.html b/templates/base.html index 3ac9bf3..02c660e 100644 --- a/templates/base.html +++ b/templates/base.html @@ -1,146 +1,160 @@ - - {% block title %}Live Lista Zakupów{% endblock %} - {# --- Bootstrap i główny css zawsze --- #} - - + {# --- Style CSS ładowane tylko dla niezablokowanych --- #} {% set exclude_paths = ['/system-auth'] %} {% if (exclude_paths | select("in", request.path) | list | length == 0) and has_authorized_cookie and not is_blocked %} - - + + {% endif %} - {# --- Cropper CSS tylko dla wybranych podstron --- #} {% set substrings_cropper = ['/admin/receipts', '/edit_my_list'] %} {% if substrings_cropper | select("in", request.path) | list | length > 0 %} - + {% endif %} - {# --- Tom Select CSS tylko dla wybranych podstron --- #} {% set substrings_tomselect = ['/edit_my_list', '/admin/edit_list', '/admin/edit_categories'] %} {% if substrings_tomselect | select("in", request.path) | list | length > 0 %} - + {% endif %} - - -
{% block content %}{% endblock %}
-
- - + {% if not is_blocked %} - {% if request.endpoint != 'system_auth' %} @@ -149,32 +163,24 @@ {% endif %} + - {% set substrings = ['/admin/receipts', '/edit_my_list'] %} {% if substrings | select("in", request.path) | list | length > 0 %} {% endif %} - {% set substrings = ['/edit_my_list', '/admin/edit_list', '/admin/edit_categories'] %} {% if substrings | select("in", request.path) | list | length > 0 %} - + {% endif %} - {% endif %} - {% block scripts %}{% endblock %} - - diff --git a/templates/main.html b/templates/main.html index e82fe87..edefd39 100644 --- a/templates/main.html +++ b/templates/main.html @@ -2,20 +2,17 @@ {% block title %}Twoje listy zakupów{% endblock %} {% block content %} - {% if not current_user.is_authenticated %} {% endif %} - {% if current_user.is_authenticated %}

Stwórz nową listę

-
@@ -34,16 +31,13 @@
{% endif %} - {% set month_names = ["styczeń", "luty", "marzec", "kwiecień", "maj", "czerwiec", "lipiec", "sierpień", "wrzesień", "październik", "listopad", "grudzień"] %} -
- {% for m in month_options %} {% set year, month = m.split('-') %}
-
- {% if current_user.is_authenticated %}

Twoje listy -

+ {% if user_lists %}
- - {% endfor %} @@ -166,12 +159,13 @@ {% endif %} {% endif %} - - -

{% if current_user.is_authenticated %}Udostępnione i publiczne listy innych użytkowników {% else %} - Publiczne listy innych użytkowników {% endif %}

- - +

+ {% if current_user.is_authenticated %} + Udostępnione i publiczne listy innych użytkowników + {% else %} + Publiczne listy innych użytkowników + {% endif %} +

{% set lists_to_show = accessible_lists %} {% if lists_to_show %} @@ -180,45 +174,44 @@ {% set purchased_count = l.purchased_count %} {% set total_count = l.total_count %} {% set percent = (purchased_count / total_count * 100) if total_count > 0 else 0 %} +
  • {{ l.title }} (Autor: {{ l.owner.username if l.owner else '—' }}) {% for cat in l.category_badges %} - + {{ cat.name }} {% endfor %} - + + class="btn btn-sm btn-outline-light d-none d-sm-flex align-items-center"> + ✏️ Odznaczaj + + + + ✏️ Odznaczaj
    -
    - + style="width: {{ (purchased_count / total_count * 100) if total_count > 0 else 0 }}%" aria-valuemin="0" aria-valuemax="100">
    {% set not_purchased_count = l.not_purchased_count if l.total_count else 0 %}
    - + style="width: {{ (not_purchased_count / total_count * 100) if total_count > 0 else 0 }}%" aria-valuemin="0" aria-valuemax="100">
    - Produkty: {{ purchased_count }}/{{ total_count }} ({{ percent|round(0) }}%) {% if l.total_expense > 0 %} — 💸 {{ '%.2f'|format(l.total_expense) }} PLN{% endif %} @@ -231,7 +224,6 @@

    Brak list do wyświetlenia

    {% endif %} -
  • {% endfor %} @@ -267,7 +257,6 @@ -