1 <%# Copyright (C) The Arvados Authors. All rights reserved.
3 SPDX-License-Identifier: AGPL-3.0 %>
5 <div id="wrapper" class="container-fluid">
6 <nav class="navbar navbar-default navbar-fixed-top" role="navigation">
7 <div class="navbar-header">
8 <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
9 <span class="sr-only">Toggle navigation</span>
10 <span class="icon-bar"></span>
11 <span class="icon-bar"></span>
12 <span class="icon-bar"></span>
14 <% site_name = Rails.configuration.Workbench.SiteName.downcase rescue Rails.application.class.parent_name %>
16 <a class="navbar-brand" href="/" data-push=true><%= site_name %></a>
18 <span class="navbar-brand"><%= site_name %></span>
22 <div class="collapse navbar-collapse">
23 <ul class="nav navbar-nav navbar-right">
26 <a><i class="rotating loading glyphicon glyphicon-refresh"></i></a>
30 <% if current_user.is_active %>
31 <% if !Rails.configuration.Workbench.MultiSiteSearch.empty? %>
33 <form class="navbar-form">
35 target = Rails.configuration.Workbench.MultiSiteSearch
37 target = {controller: 'search', action: 'index'}
39 link_to("Multi-site search", target, {class: 'btn btn-default'}) %>
44 <form class="navbar-form" role="search"
51 action_href: url_for(controller: :actions, action: :show),
53 action_data: {selection_param: 'uuid', success: 'redirect-to-created-object'}.to_json)
55 <div class="input-group" style="width: 220px">
56 <input type="text" class="form-control" placeholder="search this site">
57 <a class="input-group-addon"><span class="glyphicon glyphicon-search"></span></a>
63 <li class="dropdown notification-menu">
64 <a href="#" class="dropdown-toggle" data-toggle="dropdown" id="notifications-menu">
65 <span class="badge badge-alert notification-count"><%= user_notifications.length if user_notifications.any? %></span>
66 <span class="fa fa-lg fa-user"></span>
67 <span class="caret"></span>
69 <ul class="dropdown-menu" role="menu">
70 <li role="presentation" class="dropdown-header">
71 <%= current_user.email %>
73 <% if current_user.is_active %>
74 <li role="menuitem"><a href="/projects/<%=current_user.uuid%>" role="menuitem"><i class="fa fa-lg fa-home fa-fw"></i> Home project </a></li>
75 <% if Rails.configuration.Services.Composer.ExternalURL != URI("") %>
77 <form action="<%= Rails.configuration.Services.Composer.ExternalURL.to_s %>" method="GET">
78 <input type="hidden" name="api_token" value="<%= Thread.current[:arvados_api_token] %>" />
79 <button role="menuitem" type="submit">
80 <i class="fa fa-lg fa-share-alt fa-fw"></i> Workflow Composer
85 <% if Rails.configuration.Services.Workbench2.ExternalURL != URI("") %>
88 wb2_url = Rails.configuration.Services.Workbench2.ExternalURL.to_s
89 wb2_url += '/' if wb2_url[-1] != '/'
92 <form action="<%= wb2_url %>" method="GET">
93 <input type="hidden" name="api_token" value="<%= Thread.current[:arvados_api_token] %>">
94 <button role="menuitem" type="submit">
95 <i class="fa fa-lg fa-share-square fa-fw"></i> Go to Workbench 2
101 <%= link_to virtual_machines_user_path(current_user), role: 'menu-item' do %>
102 <i class="fa fa-lg fa-terminal fa-fw"></i> Virtual machines
105 <% if Rails.configuration.Workbench.Repositories %>
106 <li role="menuitem"><a href="/repositories" role="menuitem"><i class="fa fa-lg fa-code-fork fa-fw"></i> Repositories </a></li>
108 <li role="menuitem"><a href="/current_token" role="menuitem"><i class="fa fa-lg fa-ticket fa-fw"></i> Current token</a></li>
110 <%= link_to ssh_keys_user_path(current_user), role: 'menu-item' do %>
111 <i class="fa fa-lg fa-key fa-fw"></i> SSH keys
114 <li role="menuitem"><a href="/users/link_account" role="menuitem"><i class="fa fa-lg fa-link fa-fw"></i> Link account </a></li>
115 <% if !Rails.configuration.Workbench.UserProfileFormFields.empty? %>
116 <li role="menuitem"><a href="/users/<%=current_user.uuid%>/profile" role="menuitem"><i class="fa fa-lg fa-user fa-fw"></i> Manage profile</a></li>
119 <li role="presentation" class="divider"></li>
120 <li role="menuitem"><a href="<%= logout_path %>" role="menuitem"><i class="fa fa-lg fa-sign-out fa-fw"></i> Log out</a></li>
121 <% if user_notifications.any? %>
122 <li role="presentation" class="divider"></li>
123 <% user_notifications.each_with_index do |n, i| %>
124 <% if i > 0 %><li class="divider"></li><% end %>
125 <li class="notification"><%= n.call(self) %></li>
131 <% if current_user.is_admin %>
132 <li class="dropdown">
133 <a href="#" class="dropdown-toggle" data-toggle="dropdown" id="system-menu">
134 <span class="fa fa-lg fa-gear"></span>
135 <span class="caret"></span>
137 <ul class="dropdown-menu" role="menu">
138 <li role="presentation" class="dropdown-header">
141 <% if Rails.configuration.Workbench.Repositories %>
142 <li role="menuitem"><a href="/repositories">
143 <i class="fa fa-lg fa-code-fork fa-fw"></i> Repositories
146 <li role="menuitem"><a href="/virtual_machines">
147 <i class="fa fa-lg fa-terminal fa-fw"></i> Virtual machines
149 <li role="menuitem"><a href="/authorized_keys">
150 <i class="fa fa-lg fa-key fa-fw"></i> SSH keys
152 <li role="menuitem"><a href="/api_client_authorizations">
153 <i class="fa fa-lg fa-ticket fa-fw"></i> API tokens
155 <li role="menuitem"><a href="/links">
156 <i class="fa fa-lg fa-arrows-h fa-fw"></i> Links
158 <li role="menuitem"><a href="/users">
159 <i class="fa fa-lg fa-user fa-fw"></i> Users
161 <li role="menuitem"><a href="/groups">
162 <i class="fa fa-lg fa-users fa-fw"></i> Groups
164 <li role="menuitem"><a href="/nodes">
165 <i class="fa fa-lg fa-cloud fa-fw"></i> Compute nodes
167 <li role="menuitem"><a href="/keep_services">
168 <i class="fa fa-lg fa-exchange fa-fw"></i> Keep services
170 <li role="menuitem"><a href="/keep_disks">
171 <i class="fa fa-lg fa-hdd-o fa-fw"></i> Keep disks
177 <% if !Rails.configuration.Users.AnonymousUserToken.empty? and Rails.configuration.Workbench.EnablePublicProjectsPage %>
178 <li><%= link_to 'Browse public projects', "/projects/public" %></li>
180 <li class="dropdown hover-dropdown login-menu">
181 <a href="<%= arvados_api_client.arvados_login_url(return_to: request.url) %>">Log in</a>
182 <ul class="dropdown-menu">
184 <a href="<%= arvados_api_client.arvados_login_url(return_to: request.url) %>">
185 <span class="fa fa-lg fa-sign-in"></span>
186 <p style="margin-left: 1.6em; margin-top: -1.35em; margin-bottom: 0em; margin-right: 0.5em;">Log in or register with<br/>any Google account</p>
193 <li class="dropdown help-menu">
194 <a href="#" class="dropdown-toggle" data-toggle="dropdown" id="arv-help">
195 <span class="fa fa-lg fa-question-circle"></span>
196 <span class="caret"></span>
198 <ul class="dropdown-menu">
199 <li role="presentation" class="dropdown-header">
202 <% if Rails.configuration.Workbench.EnableGettingStartedPopup %>
204 <%= link_to raw('<i class="fa fa-fw fa-info"></i> Getting Started ...'), "#",
205 {'data-toggle' => "modal", 'data-target' => '#getting-started-modal-window'} %>
208 <% if !Rails.configuration.Workbench.ArvadosPublicDataDocURL.empty? %>
209 <li><%= link_to raw('<i class="fa fa-book fa-fw"></i> Public Pipelines and Data sets'), "#{Rails.configuration.Workbench.ArvadosPublicDataDocURL}", target: "_blank" %></li>
211 <li><%= link_to raw('<i class="fa fa-book fa-fw"></i> Tutorials and User guide'), "#{Rails.configuration.Workbench.ArvadosDocsite}/user", target: "_blank" %></li>
212 <li><%= link_to raw('<i class="fa fa-book fa-fw"></i> API Reference'), "#{Rails.configuration.Workbench.ArvadosDocsite}/api", target: "_blank" %></li>
213 <li><%= link_to raw('<i class="fa fa-book fa-fw"></i> SDK Reference'), "#{Rails.configuration.Workbench.ArvadosDocsite}/sdk", target: "_blank" %></li>
214 <li role="presentation" class="divider"></li>
215 <li> <%= link_to report_issue_popup_path(popup_type: 'version', current_location: request.url, current_path: request.fullpath, action_method: 'post'),
216 {class: 'report-issue-modal-window', remote: true, return_to: request.url} do %>
217 <i class="fa fa-fw fa-support"></i> Show version / debugging info ...
220 <li> <%= link_to report_issue_popup_path(popup_type: 'report', current_location: request.url, current_path: request.fullpath, action_method: 'post'),
221 {class: 'report-issue-modal-window', remote: true, return_to: request.url} do %>
222 <i class="fa fa-fw fa-support"></i> Report a problem ...
228 </div><!-- /.navbar-collapse -->
231 <% if current_user.andand.is_active %>
232 <%= render partial: 'breadcrumbs' %>
233 <% elsif !current_user %> <%# anonymous %>
234 <% if (@name_link or @object) and (project_breadcrumbs.any?) %>
235 <nav class="navbar navbar-default breadcrumbs" role="navigation">
236 <ul class="nav navbar-nav navbar-left">
238 <a href="/projects/public">Public Projects</a>
240 <% project_breadcrumbs.each do |p| %>
241 <li class="nav-separator">
242 <i class="fa fa-lg fa-angle-double-right"></i>
245 <%= link_to(p.name, project_path(p.uuid), data: {object_uuid: p.uuid, name: 'name'}) %>
253 <%= render partial: 'browser_unsupported' %><%# requires JS support below %>
254 <%= render partial: 'getting_started/getting_started_popup' %>
256 <div id="page-wrapper">
261 <%= yield :footer_html %>
263 <div class="modal-container"></div>
264 <div id="report-issue-modal-window"></div>
265 <script src="/browser_unsupported.js"></script>
267 <% if Rails.configuration.Workbench.EnableGettingStartedPopup and current_user and !current_user.prefs[:getting_started_shown] and
268 !request.url.include?("/profile") and
269 !request.url.include?("/user_agreements") and
270 !request.url.include?("/inactive")%>
272 $("#getting-started-modal-window").modal('show');
275 prefs = current_user.prefs
276 prefs[:getting_started_shown] = Time.now
277 current_user.update_attributes prefs: prefs.to_json