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