From ac2845b70d7e5a5ab0b9af0610910bc8e59a1fda Mon Sep 17 00:00:00 2001 From: Andrea Lepori Date: Tue, 12 Nov 2024 15:53:42 +0100 Subject: add option to change to new css --- accounts/templates/accounts/index.html | 27 +++++++++++++++++++++++++++ accounts/views.py | 6 +++++- 2 files changed, 32 insertions(+), 1 deletion(-) (limited to 'accounts') diff --git a/accounts/templates/accounts/index.html b/accounts/templates/accounts/index.html index 921cc81..aaba6a8 100644 --- a/accounts/templates/accounts/index.html +++ b/accounts/templates/accounts/index.html @@ -59,6 +59,33 @@ +
+
+ {% csrf_token %} + +
+
+
Opzioni di visualizzazione
+
+
+
+
+ Stile + +
+
+
+
+ +
+
+
+
{% endblock %} diff --git a/accounts/views.py b/accounts/views.py index 3cffa09..f00cfe9 100644 --- a/accounts/views.py +++ b/accounts/views.py @@ -419,7 +419,10 @@ def personal_wrapper(request, errors): errors.append("La password deve contenere lettere") elif err.code == "password_incorrect": errors.append("La password attuale รจ incorretta") - + elif request.POST['action'] == "css": + print("setting new_css", "css" in request.POST) + request.session["new_css"] = "css" in request.POST + usable_password = request.user.has_usable_password() # fill context @@ -428,6 +431,7 @@ def personal_wrapper(request, errors): 'errors': errors, 'ok_message': ok_message, 'usable_password': usable_password, + 'css_check': "checked='checked'" if request.session.get("new_css", False) else "", } return render(request, 'accounts/index.html', context) -- cgit v1.2.1