try to gain some vertical space in topmenu : show 'logged in as' in x-small
[myslice.git] / views / templates / widget-topmenu.html
index 97d20f1..1b14c8a 100644 (file)
@@ -1,28 +1,20 @@
 {# <a id='menu_logo' href="/"><img class="logo" src="{{ STATIC_URL }}img/myslice-logo.png" alt="MySlice" /></a> #}
-{% insert_str prelude "bootstrap/js/bootstrap.js" %}
-{% insert_str prelude "bootstrap/css/bootstrap.css" %}
+{% insert_str prelude "js/bootstrap.js" %}
+{% insert_str prelude "css/bootstrap.css" %}
 {% insert_str prelude "css/topmenu.css" %}
-
-<div id='topmenu' class="navbar navbar-fixed-top">
+{% insert_str prelude "js/logout.js" %}
+<div class="navbar navbar-fixed-top">
   <div class="navbar-inner">
     <div class="container-fluid">
-      <a class="brand" href="/"><img src="{{ STATIC_URL }}img/myslice-logo.png" height="30" alt="MySlice logo" /></a>
+      <a class="brand" href="/"><img src="{{ STATIC_URL }}img/onelab-logo.png" height="30" alt="OneLab logo" /></a>
+      <!--<a class="brand" href="/"><img src="{{ STATIC_URL }}img/myslice-logo.png" height="30" alt="MySlice logo" /></a>-->
       <div class="nav-collapse topmenu">
-       <ul class="nav nav-pills" id='menu_ul'>
-         {% for d in topmenu_items %}
-         {% if d.active %}
-         <li class='active'> <a href="{{ d.href }}"> {{ d.label }} </a> </li>
-         {% else %}
-         <li class='other'> <a href="{{ d.href }}"> {{ d.label }} </a> </li>
-         {% endif %}
-         {% endfor %}
-       </ul>
-       <p class="navbar-text pull-right">
-         {% if username %}
-       Logged in as <a href="/logout/">{{ username }}</a></p>
-         {% else %}
-         Not logged in
-         {% endif %}
+       <ul class="nav nav-pills" id='menu_ul'> {% for d in topmenu_items %} {% if d.is_active %}
+         <li class='active'> <a href="{{ d.href }}"> {{ d.label }} </a> </li> {% else %}
+         <li class='other'> <a href="{{ d.href }}"> {{ d.label }} </a> </li> {% endif %} {% endfor %}
+       </ul> {# logout.js will attach a click function on that button, which then retrieves the 'username' attribute #}
+       <span class="navbar-text pull-right logged-in"> {% if username %} Logged in as {{ username }}
+       <button id='logout' class='btn btn-danger' username='{{ username }}'>Logout</a> {% else %}Not logged in{% endif %}</span>
       </div><!--nav-collapse-->
     </div><!--container-fluid-->
   </div><!--navbar-inner-->