c67fb40846b46b6304275834a403de944521e839
[arvados.git] / apps / workbench / app / views / layouts / application.html.erb
1 <!DOCTYPE html>
2 <html>
3 <head>
4   <meta charset="utf-8">
5   <title>
6     <% if content_for? :page_title %>
7     <%= yield :page_title %>
8     <% else %>
9     <%= Rails.configuration.site_name rescue Rails.application.class.parent_name %>
10     <% end %>
11   </title>
12   <meta name="viewport" content="width=device-width, initial-scale=1.0">
13   <meta name="description" content="">
14   <meta name="author" content="">
15   <%= stylesheet_link_tag    "application", :media => "all" %>
16   <%= javascript_include_tag "application" %>
17   <%= csrf_meta_tags %>
18   <%= yield :head %>
19   <%= javascript_tag do %>
20   <%= yield :js %>
21   <% end %>
22   <style>
23     body {
24     padding-top: 60px; /* 60px to make the container go all the way to the bottom of the topbar */
25     }
26   </style>
27 </head>
28 <body>
29
30   <div class="navbar navbar-inverse navbar-fixed-top">
31     <div class="navbar-inner">
32       <div class="container">
33         <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
34           <span class="icon-bar"></span>
35           <span class="icon-bar"></span>
36           <span class="icon-bar"></span>
37         </a>
38         <a class="brand" href="/"><%= Rails.configuration.site_name rescue Rails.application.class.parent_name %></a>
39         <div class="nav-collapse collapse">
40           <ul class="nav">
41             <% [
42                [false, 'Keys', authorized_keys_path],
43                [false, 'VMs', virtual_machines_path],
44                [false, 'Repos', repositories_path],
45                [false, 'Tokens', api_client_authorizations_path],
46                [false, 'Jobs', jobs_path]
47                ].each do |admin_only, name, path| %>
48             <% if !admin_only or (current_user and current_user.is_admin) %>
49             <li<%= raw ' class="active"' if request.fullpath.index(path) %>><a href="<%= path %>"><%= name %></a></li>
50             <% end %>
51             <% end %>
52           </ul>
53           <ul class="nav pull-right">
54       <% if current_user -%>
55             <li><span class="badge badge-info" style="margin: 10px auto 10px; padding-top: 4px; padding-bottom: 4px"><%= current_user.email %></span></li>
56             <li><a href="<%= logout_path %>">Log out</a></li>
57       <% else -%>
58             <li><a href="<%= root_path %>">Log in</a></li>
59       <% end -%>
60           </ul>
61         </div><!--/.nav-collapse -->
62       </div>
63     </div>
64   </div>
65
66   <div class="container">
67
68     <%= yield %>
69
70   </div> <!-- /container -->
71
72 </body>
73 </html>