]> git.ipfire.org Git - thirdparty/patchwork.git/commitdiff
base: Group username/profile/logout with a dropdown
authorDamien Lespiau <damien.lespiau@intel.com>
Thu, 2 Oct 2014 23:55:28 +0000 (00:55 +0100)
committerStephen Finucane <stephen.finucane@intel.com>
Thu, 5 Nov 2015 03:51:40 +0000 (03:51 +0000)
We regoup user related information (log out and profile) in a dropdown
with the user identity as label.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Acked-by: Stephen Finucane <stephen.finucane@intel.com>
templates/base.html

index aa7c2b3b9f9b03d737b872c0e311361947b15460..5e82ede9ab57d6d1bf0026dd286e09ba80488977 100644 (file)
     <li><p class="navbar-text">|</p></li>
 {% endif %}
 {% if user.is_authenticated %}
-     <li><p class="navbar-text">Logged in as <a href="{% url 'patchwork.views.user.profile' %}"
-     ><strong>{{ user.username }}</strong></a></p></li>
      <li><a href="{% url 'patchwork.views.user.todo_lists' %}">todo
       ({{ user.profile.n_todo_patches }})</a></li>
      <li><a href="{% url 'patchwork.views.bundle.bundles' %}">bundles</a></li>
-     <li><a href="{% url 'patchwork.views.user.profile' %}">profile</a></li>
 {% if user.is_staff %}
      <li><a href="{% url 'admin:index' %}">admin</a></li>
+     <li class="dropdown">
+       <a href="#" class="dropdown-toggle" data-toggle="dropdown"
+        ><strong>{{ user.username }}</strong>&nbsp;<span
+        class="caret" /></a>
+       <ul class="dropdown-menu" role="menu">
+         <li><a href="{% url 'patchwork.views.user.profile' %}">view profile</a></li>
+         <li><a href="{% url 'auth_logout' %}">logout</a></li>
+       </ul>
+     </li>
 {% endif %}
-     <li><a href="{% url 'auth_logout' %}">logout</a></li>
 {% else %}
      <li><a href="{% url 'auth_login' %}">login</a></li>
      <li><a href="{% url 'patchwork.views.user.register' %}">register</a></li>