[PATCH 31/46] base: Group username/profile/logout with a dropdown

Damien Lespiau damien.lespiau at intel.com
Sun Nov 9 06:08:49 AEDT 2014


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>
---
 templates/base.html | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/templates/base.html b/templates/base.html
index e79c79a..d2ac7b7 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -49,16 +49,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.get_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>
-- 
1.8.3.1



More information about the Patchwork mailing list