[PATCH 27/49] base: Group username/profile/logout with a dropdown

Damien Lespiau damien.lespiau at intel.com
Fri Oct 2 00:12:32 AEST 2015


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 at intel.com>
Acked-by: Stephen Finucane <stephen.finucane at intel.com>
---
 templates/base.html | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/templates/base.html b/templates/base.html
index aa7c2b3..5e82ede 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -45,16 +45,21 @@
     <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> <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>
-- 
2.1.0



More information about the Patchwork mailing list