Smartfire portal changes
[unfold.git] / portal / templates / _widget-topmenu.html
1 {% load portal_filters %}
2 <div class="header">
3 <div class="container">
4         <div class="row">
5                 <div class="col-sm-3 col-md-3 logo">
6                         <a href="/"><img src="{{ STATIC_URL }}img/onelab-portal.png" alt="OneLab Portal - Future Internet Testbeds" /></a>
7                 </div>
8                 {% if username %}
9                 <div class="col-sm-4 col-md-4 navigation">
10                         <ul>
11                                 <li>
12                                         <a class="dropdown-toggle" data-toggle="dropdown" href="#">
13                                         EXPERIMENT <span class="caret"></span>
14                                 </a>
15                                         
16                                         <div class="dropdown-menu" style="z-index:99;">
17                                                         <ul id="dropdown-slice-list">
18                                                                 <li class="title"><a href="/portal/slice_request/">Request Slice</a></li>
19                                                         </ul>
20                                         </div>
21                                 </li>
22                                 {%if 'is_pi'  in pi %}  
23                                 <li id="nav-institution" class=""><a href="/institution">MANAGEMENT</a></li>
24                                  {%endif%}
25                                 <li><a href="/support/">SUPPORT</a></li>
26                         </ul>
27                 </div>
28                 {% else %}
29                 <div class="col-sm-4 col-md-4 navigation">
30                 </div>
31                 {% endif %}
32                 <div class="col-sm-5 col-md-5 secondary">
33                         <ul>
34                                 <li><a href="/news">News</a></li>
35                                 <li><a href="/about">About</a></li>
36                                 <li><a target="_blank" href="https://www.onelab.eu">Public Website</a></li>
37                                 <li><a target="_blank" href="http://intranet.onelab.eu">Intranet</a></li>
38                         </ul>
39                         {% if username %}
40                         <div class="account">You are logged in as &nbsp;<a href="/account/">{{ username }}</a> &nbsp;&nbsp;|&nbsp;&nbsp; <a id="logout" style="cursor:pointer;" data-username="{{ username }}"><span class="glyphicon glyphicon-off"></span> Logout</a></div>
41                         {% endif %}
42                 </div>
43         </div>
44 </div>
45 </div>
46
47 <script>
48         $(document).ready(function() {
49                 $('li.slices').mouseenter(function() {
50                         $('div#menu-slice-list').fadeIn(100);
51                 });
52                 $('div#menu-slice-list').mouseleave(function(e) {
53                         if (!$('li.slices').is(":hover")) {
54                                 $(this).fadeOut(100);
55                         }
56                 });
57                 // var slices = localStorage.getItem('slices');
58                 // if (slices.length == 0) {
59                         // $.post("/rest/user/",{'filters':{'user_hrn':'$user_hrn'}}, function( data ) {
60                         // var items = [];
61                                 // localStorage.setItem('slices', data[0].slice);
62                         // });
63                 // }
64                 // $.each(slices, function( key, val ) {
65                         // items.push( "<li><a href=\"/slice/"+val.slice_hrn+"\">" + val.slice_hrn + "</a></li>" );
66                 // });
67                 // $("div#home-slice-list").html($( "<ul/>", { html: items.join( "" ) }));
68         });
69 </script>