diff options
author | Andrea Lepori <alepori@student.ethz.ch> | 2022-04-27 22:35:47 +0200 |
---|---|---|
committer | Andrea Lepori <alepori@student.ethz.ch> | 2022-04-27 22:35:47 +0200 |
commit | 6d4d9daf3defb6d2387d2cd0bab4a6833e35121d (patch) | |
tree | e157393fcbf5dc87b4f55ec47e7cc89a3ea849e1 /templates/registration | |
parent | add icons on the username based on role (diff) | |
download | scout-subs-6d4d9daf3defb6d2387d2cd0bab4a6833e35121d.tar.gz scout-subs-6d4d9daf3defb6d2387d2cd0bab4a6833e35121d.zip |
fix user switcher on admin side
Diffstat (limited to 'templates/registration')
-rw-r--r-- | templates/registration/base_admin.html | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/templates/registration/base_admin.html b/templates/registration/base_admin.html index edc3bae..e3e1e61 100644 --- a/templates/registration/base_admin.html +++ b/templates/registration/base_admin.html @@ -78,6 +78,9 @@ </head> <body> <nav class="nav-extended"> + <form id="user_form" method="post" action="{% url 'user_switcher'%}"> + {% csrf_token %} + <input type="hidden" name="metadata" id="metadata"> <div class="nav-wrapper {{color}}"> <ul class="left"> <li><a id="home_btn" href="{% url 'index' %}"><i class="material-icons">home</i></a></li> @@ -85,13 +88,19 @@ {% block breadcrumb %} {% endblock %} <ul class="right"> - <li class="userswitcher" data-target='userswitcher'><a href="#">{{ user.username }}</a></li> + {% if user.is_staff or perms.client.staff %} + <li class="userswitcher" data-target='userswitcher'><a href="#">{{ user.username }}<i class="right material-icons">shield</i></a></li> + {% elif "capi" in user|user_groups%} + <li class="userswitcher" data-target='userswitcher'><a href="#">{{ user.username }}<i class="right material-icons">supervisor_account</i></a></li> + {% else %} + <li class="userswitcher" data-target='userswitcher'><a href="#">{{ user.username }}</a></li> + {% endif %} <ul id='userswitcher' class='dropdown-content'> <li><a href="{% url 'personal' %}"><i class="material-icons">person</i>Gestione account</a></li> {% if user.is_staff or perms.client.staff %} <li><a href="{% url 'server' %}"><i class="material-icons">build</i>Pannello Admin</a></li> {% endif %} - {% if group_view %} + {% if user|user_list %} <li><a class="modal-trigger" href="#modal_capi"><i class="material-icons">list</i>Lista documenti</a></li> {% endif %} @@ -116,6 +125,7 @@ </div> {% block toolbar %} {% endblock %} + </form> </nav> <main id="main" style="margin-left: 10px;margin-right: 10px;margin-top: 10px;"> |