Merge branch '2733-coverage-report'
[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 %> / <%= Rails.configuration.site_name %>
8     <% else %>
9     <%= Rails.configuration.site_name %>
10     <% end %>
11   </title>
12   <meta name="viewport" content="width=device-width, initial-scale=1.0">
13   <link rel="icon" href="/favicon.ico" type="image/x-icon">
14   <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
15   <meta name="description" content="">
16   <meta name="author" content="">
17   <%= stylesheet_link_tag    "application", :media => "all" %>
18   <%= javascript_include_tag "application" %>
19   <%= csrf_meta_tags %>
20   <%= yield :head %>
21   <%= javascript_tag do %>
22   <%= yield :js %>
23   <% end %>
24   <style>
25     <%= yield :css %>
26     body {
27     min-height: 100%;
28     height: 100%;
29     }
30
31     body > div.container-fluid {
32     padding-top: 70px; /* 70px to make the container go all the way to the bottom of the navbar */
33     }
34
35     @media (max-width: 979px) { body { padding-top: 0; } }
36
37     .navbar .nav li.nav-separator > span.glyphicon.glyphicon-arrow-right {
38     padding-top: 1.25em;
39     }
40
41     @media (max-width: 767px) {
42     .breadcrumbs {
43     display: none;
44     }
45     }
46   </style>
47   <link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
48 </head>
49 <body>
50   <div id="wrapper">
51     <nav class="navbar navbar-default navbar-fixed-top" role="navigation">
52       <div class="navbar-header">
53         <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
54           <span class="sr-only">Toggle navigation</span>
55           <span class="icon-bar"></span>
56           <span class="icon-bar"></span>
57           <span class="icon-bar"></span>
58         </button>
59         <a class="navbar-brand" href="/"><%= Rails.configuration.site_name rescue Rails.application.class.parent_name %></a>
60       </div>
61
62       <div class="collapse navbar-collapse">
63         <% if current_user.andand.is_active %>
64           <ul class="nav navbar-nav side-nav">
65
66             <li class="<%= 'arvados-nav-active' if params[:action] == 'home' %>">
67               <a href="/"><i class="fa fa-lg fa-dashboard fa-fw"></i> Dashboard</a>
68             </li>
69
70             <li class="dropdown">
71               <a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-lg fa-hand-o-up fa-fw"></i> Help <b class="caret"></b></a>
72               <ul class="dropdown-menu">
73                 <li><%= link_to raw('<i class="fa fa-book fa-fw"></i> Tutorials and User guide'), "#{Rails.configuration.arvados_docsite}/user", target: "_blank" %></li>
74                 <li><%= link_to raw('<i class="fa fa-book fa-fw"></i> API Reference'), "#{Rails.configuration.arvados_docsite}/api", target: "_blank" %></li>
75                 <li><%= link_to raw('<i class="fa fa-book fa-fw"></i> SDK Reference'), "#{Rails.configuration.arvados_docsite}/sdk", target: "_blank" %></li>
76               </ul>
77             </li>
78
79             <li class="dropdown">
80               <a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-lg fa-folder-o fa-fw"></i> Folders <b class="caret"></b></a>
81               <ul class="dropdown-menu">
82                 <li><%= link_to raw('<i class="fa fa-plus fa-fw"></i> Create new folder'), folders_path, method: :post %></li>
83                 <% @my_top_level_folders.call[0..7].each do |folder| %>
84                 <li><%= link_to raw('<i class="fa fa-folder-open fa-fw"></i> ') + folder.name, folder_path(folder) %></li>
85                 <% end %>
86                 <li><a href="/folders">
87                     <i class="fa fa-ellipsis-h fa-fw"></i> Show all folders
88                 </a></li>
89               </ul>
90             </li>
91             <li><a href="/collections">
92                 <i class="fa fa-lg fa-briefcase fa-fw"></i> Collections (data files)
93             </a></li>
94             <li><a href="/pipeline_instances">
95                 <i class="fa fa-lg fa-tasks fa-fw"></i> Pipeline instances
96             </a></li>
97             <li><a href="/pipeline_templates">
98                 <i class="fa fa-lg fa-gears fa-fw"></i> Pipeline templates
99             </a></li>
100             <li>&nbsp;</li>
101             <li><a href="/repositories">
102                 <i class="fa fa-lg fa-code-fork fa-fw"></i> Repositories
103             </a></li>
104             <li><a href="/virtual_machines">
105                 <i class="fa fa-lg fa-terminal fa-fw"></i> Virtual machines
106             </a></li>
107             <li><a href="/humans">
108                 <i class="fa fa-lg fa-male fa-fw"></i> Humans
109             </a></li>
110             <li><a href="/specimens">
111                 <i class="fa fa-lg fa-flask fa-fw"></i> Specimens
112             </a></li>
113             <li><a href="/traits">
114                 <i class="fa fa-lg fa-clipboard fa-fw"></i> Traits
115             </a></li>
116             <li><a href="/links">
117                 <i class="fa fa-lg fa-arrows-h fa-fw"></i> Links
118             </a></li>
119             <% if current_user.andand.is_admin %>
120               <li><a href="/users">
121                   <i class="fa fa-lg fa-user fa-fw"></i> Users
122               </a></li>
123             <% end %>
124             <li><a href="/groups">
125                 <i class="fa fa-lg fa-users fa-fw"></i> Groups
126             </a></li>
127             <li><a href="/nodes">
128                 <i class="fa fa-lg fa-cogs fa-fw"></i> Compute nodes
129             </a></li>
130             <li><a href="/keep_disks">
131                 <i class="fa fa-lg fa-hdd-o fa-fw"></i> Keep disks
132             </a></li>
133           </ul>
134         <% end %>
135
136         <ul class="nav navbar-nav navbar-left breadcrumbs">
137           <% if current_user %>
138             <% if content_for?(:breadcrumbs) %>
139               <%= yield(:breadcrumbs) %>
140             <% else %>
141               <li class="nav-separator"><span class="glyphicon glyphicon-arrow-right"></span></li>
142               <li>
143                 <%= link_to(
144                             controller.controller_name.humanize.downcase,
145                             url_for({controller: params[:controller]})) %>
146               </li>
147               <% if params[:action] != 'index' %>
148                 <li class="nav-separator">
149                   <span class="glyphicon glyphicon-arrow-right"></span>
150                 </li>
151                 <li>
152                   <%= link_to_if_arvados_object @object, {friendly_name: true}, {data: {object_uuid: @object.andand.uuid, name: 'name'}} %>
153                 </li>
154                 <li style="padding: 14px 0 14px">
155                   <%= form_tag do |f| %>
156                     <%= render :partial => "selection_checkbox", :locals => {:object => @object} %>
157                   <% end %>
158                 </li>
159               <% end %>
160             <% end %>
161           <% end %>
162         </ul>
163
164         <ul class="nav navbar-nav navbar-right">
165
166           <li>
167             <a><i class="rotating loading glyphicon glyphicon-refresh"></i></a>
168           </li>
169
170           <% if current_user %>
171           <!-- XXX placeholder for this when search is implemented
172           <li>
173             <form class="navbar-form" role="search">
174               <div class="input-group" style="width: 220px">
175                 <input type="text" class="form-control" placeholder="search">
176                 <span class="input-group-addon"><span class="glyphicon glyphicon-search"></span></span>
177               </div>
178             </form>
179           </li>
180           -->
181
182           <li class="dropdown notification-menu">
183             <a href="#" class="dropdown-toggle" data-toggle="dropdown" id="collections-menu">
184               <span class="glyphicon glyphicon-paperclip"></span>
185               <span class="badge" id="persistent-selection-count"></span>
186               <span class="caret"></span>
187             </a>
188               <ul class="dropdown-menu" role="menu" id="persistent-selection-list">
189                 <%= form_tag '/actions' do %>
190                 <%= hidden_field_tag 'uuid', @object.andand.uuid %>
191                 <div id="selection-form-content"></div>
192                 <% end %>
193             </ul>
194           </li>
195
196           <% if current_user.is_active %>
197           <li class="dropdown notification-menu">
198             <a href="#" class="dropdown-toggle" data-toggle="dropdown" id="notifications-menu">
199               <span class="glyphicon glyphicon-envelope"></span>
200               <span class="badge badge-alert notification-count"><%= @notification_count %></span>
201               <span class="caret"></span>
202             </a>
203             <ul class="dropdown-menu" role="menu">
204               <% if (@notifications || []).length > 0 %>
205                 <% @notifications.each_with_index do |n, i| %>
206                   <% if i > 0 %><li class="divider"></li><% end %>
207                   <li class="notification"><%= n.call(self) %></li>
208                 <% end %>
209               <% else %>
210                 <li class="notification empty">No notifications.</li>
211               <% end %>
212             </ul>
213           </li>
214           <% end %>
215
216           <li class="dropdown">
217             <a href="#" class="dropdown-toggle" data-toggle="dropdown" id="user-menu">
218               <span class="glyphicon glyphicon-user"></span><span class="caret"></span>
219             </a>
220             <ul class="dropdown-menu" role="menu">
221               <li role="presentation" class="dropdown-header"><%= current_user.email %></li>
222               <% if current_user.is_active %>
223               <li role="presentation" class="divider"></li>
224               <li role="presentation"><a href="/authorized_keys" role="menuitem"><i class="fa fa-key fa-fw"></i> Manage ssh keys</a></li>
225               <li role="presentation"><a href="/api_client_authorizations" role="menuitem"><i class="fa fa-ticket fa-fw"></i> Manage API tokens</a></li>
226               <li role="presentation" class="divider"></li>
227               <% end %>
228               <li role="presentation"><a href="<%= logout_path %>" role="menuitem"><i class="fa fa-sign-out fa-fw"></i> Log out</a></li>
229             </ul>
230           </li>
231           <% else %>
232             <li><a href="<%= $arvados_api_client.arvados_login_url(return_to: root_url) %>">Log in</a></li>
233           <% end %>
234         </ul>
235       </div><!-- /.navbar-collapse -->
236     </nav>
237
238     <div id="page-wrapper">
239       <%= yield %>
240     </div>
241   </div>
242
243 </div>
244
245   <%= yield :footer_html %>
246   <%= piwik_tracking_tag %>
247   <%= javascript_tag do %>
248   <%= yield :footer_js %>
249   <% end %>
250
251 </body>
252 </html>