diff --git a/app.py b/app.py index 55d84e3..1eb2de9 100644 --- a/app.py +++ b/app.py @@ -1550,29 +1550,6 @@ def system_auth(): return render_template("system_auth.html") -@app.route("/toggle_archive_list/") -@login_required -def toggle_archive_list(list_id): - l = db.session.get(ShoppingList, list_id) - if l is None: - abort(404) - - if l.owner_id != current_user.id: - return redirect_with_flash("Nie masz uprawnień do tej listy", "danger") - - archive = request.args.get("archive", "true").lower() == "true" - - if archive: - l.is_archived = True - flash(f"Lista „{l.title}” została zarchiwizowana.", "success") - else: - l.is_archived = False - flash(f"Lista „{l.title}” została przywrócona.", "success") - - db.session.commit() - return redirect(url_for("main_page")) - - @app.route("/edit_my_list/", methods=["GET", "POST"]) @login_required def edit_my_list(list_id): @@ -1595,6 +1572,13 @@ def edit_my_list(list_id): next_page = request.args.get("next") or request.referrer if request.method == "POST": + if "unarchive" in request.form: + l.is_archived = False + db.session.commit() + flash(f"Lista „{l.title}” została przywrócona.", "success") + return redirect(next_page or url_for("main_page")) + + # Pełna edycja formularza move_to_month = request.form.get("move_to_month") if move_to_month: try: diff --git a/templates/admin/admin_panel.html b/templates/admin/admin_panel.html index 7de09fb..c697098 100644 --- a/templates/admin/admin_panel.html +++ b/templates/admin/admin_panel.html @@ -4,7 +4,7 @@
diff --git a/templates/admin/list_products.html b/templates/admin/list_products.html index 7068a62..97ff3f7 100644 --- a/templates/admin/list_products.html +++ b/templates/admin/list_products.html @@ -137,10 +137,14 @@
- + + + + + +
@@ -152,7 +156,8 @@ {% for p in range(1, total_pages + 1) %}
  • - {{ p }} + {{ + p }}
  • {% endfor %}
  • diff --git a/templates/admin/mass_edit_categories.html b/templates/admin/mass_edit_categories.html index b774f67..3e264a0 100644 --- a/templates/admin/mass_edit_categories.html +++ b/templates/admin/mass_edit_categories.html @@ -103,7 +103,8 @@
    - diff --git a/templates/admin/receipts.html b/templates/admin/receipts.html index 23358a2..7480b8b 100644 --- a/templates/admin/receipts.html +++ b/templates/admin/receipts.html @@ -122,7 +122,8 @@
    - @@ -137,7 +138,8 @@
  • {% for p in range(1, total_pages + 1) %}
  • - {{ p }} + {{ + p }}
  • {% endfor %}
  • diff --git a/templates/base.html b/templates/base.html index d0c6afc..1f34dbc 100644 --- a/templates/base.html +++ b/templates/base.html @@ -7,16 +7,19 @@ {% block title %}Live Lista Zakupów{% endblock %} - {# --- Style CSS ładowane tylko dla niezablokowanych --- #} - {% if not is_blocked %} + {# --- 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 %} - {# --- Bootstrap zawsze --- #} - - {# --- Cropper CSS tylko dla wybranych podstron --- #} {% set substrings_cropper = ['/admin/receipts', '/edit_my_list'] %} {% if substrings_cropper | select("in", request.path) | list | length > 0 %} diff --git a/templates/edit_my_list.html b/templates/edit_my_list.html index 40bcbb8..88525c6 100644 --- a/templates/edit_my_list.html +++ b/templates/edit_my_list.html @@ -173,13 +173,13 @@
  • diff --git a/templates/main.html b/templates/main.html index 1b22c92..0575b26 100644 --- a/templates/main.html +++ b/templates/main.html @@ -15,7 +15,7 @@
    - + @@ -152,7 +149,7 @@ {% endfor %} - 📄 Otwórz + 📄 Otwórz
    {# Kupione #} @@ -200,14 +197,18 @@ {% for l in archived_lists %}
  • {{ l.title }} - ♻️ - Przywróć + + + +
  • {% endfor %} {% else %} {% endif %}