diff options
author | Andrea Lepori <aleporia@gmail.com> | 2024-11-12 15:53:42 +0100 |
---|---|---|
committer | Andrea Lepori <aleporia@gmail.com> | 2024-11-12 15:53:42 +0100 |
commit | ac2845b70d7e5a5ab0b9af0610910bc8e59a1fda (patch) | |
tree | 10fec1166a85538b26942efb2471faef4575cdf9 /accounts | |
parent | add new materialize v2 (diff) | |
download | scout-subs-ac2845b70d7e5a5ab0b9af0610910bc8e59a1fda.tar.gz scout-subs-ac2845b70d7e5a5ab0b9af0610910bc8e59a1fda.zip |
add option to change to new css
Diffstat (limited to 'accounts')
-rw-r--r-- | accounts/templates/accounts/index.html | 27 | ||||
-rw-r--r-- | accounts/views.py | 6 |
2 files changed, 32 insertions, 1 deletions
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 @@ </div> </div> </div> + <div class="card-panel"> + <form action="{% url 'personal'%}" id="form3" method="post"> + {% csrf_token %} + <input type="hidden" name="action" id="action" value="css"> + <div class="row"> + <div class="col s12"> + <h5>Opzioni di visualizzazione</h5> + </div> + </div> + <div class="row"> + <div class="switch col s12"> + Stile + <label> + Vecchio + <input name="css" type="checkbox" {{css_check}}> + <span class="lever"></span> + Nuovo (beta, potrebbero esserci problemi di visualizzazione) + </label> + </div> + </div> + <div class="row"> + <div class="col s12"> + <button onclick="document.getElementById(form3).submit()" class="btn waves-effect waves-light {{color}}">Applica</button> + </div> + </div> + </form> + </div> </div> </div> {% 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) |