Merge branch '4388-workbench-update' closes #4388
[arvados.git] / apps / workbench / app / views / layouts / body.html.erb
1   <div id="wrapper" class="container-fluid">
2     <nav class="navbar navbar-default navbar-fixed-top" role="navigation">
3       <div class="navbar-header">
4         <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
5           <span class="sr-only">Toggle navigation</span>
6           <span class="icon-bar"></span>
7           <span class="icon-bar"></span>
8           <span class="icon-bar"></span>
9         </button>
10         <a class="navbar-brand" href="/" data-push=true><%= Rails.configuration.site_name.downcase rescue Rails.application.class.parent_name %></a>
11       </div>
12
13       <div class="collapse navbar-collapse">
14         <ul class="nav navbar-nav navbar-right">
15
16           <li>
17             <a><i class="rotating loading glyphicon glyphicon-refresh"></i></a>
18           </li>
19
20           <% if current_user %>
21             <% if current_user.is_active %>
22             <li>
23               <form class="navbar-form" role="search"
24                          data-search-modal=
25                          "<%= url_for(
26                           action: 'choose',
27                           controller: 'search',
28                           title: 'Search',
29                           action_name: 'Show',
30                           action_href: url_for(controller: :actions, action: :show),
31                           action_method: 'get',
32                           action_data: {selection_param: 'uuid', success: 'redirect-to-created-object', copy_from_search_box: true}.to_json)
33                          %>">
34                 <div class="input-group" style="width: 220px">
35                   <input type="text" class="form-control" placeholder="search">
36                   <a class="input-group-addon"><span class="glyphicon glyphicon-search"></span></a>
37                 </div>
38               </form>
39             </li>
40             <% end %>
41
42             <li class="dropdown notification-menu">
43               <a href="#" class="dropdown-toggle" data-toggle="dropdown" id="notifications-menu">
44                 <span class="badge badge-alert notification-count"><%= @notification_count %></span>
45                 <%= current_user.email %> <span class="caret"></span>
46               </a>
47               <ul class="dropdown-menu" role="menu">
48                 <li role="presentation" class="dropdown-header">
49                   My account
50                 </li>
51                 <% if current_user.is_active %>
52                 <li role="menuitem"><a href="/manage_account" role="menuitem"><i class="fa fa-key fa-fw"></i> Manage account</a></li>
53                 <% if Rails.configuration.user_profile_form_fields %>
54                   <li role="menuitem"><a href="/users/<%=current_user.uuid%>/profile" role="menuitem"><i class="fa fa-key fa-fw"></i> Manage profile</a></li>
55                 <% end %>
56                 <li role="presentation" class="divider"></li>
57                 <% end %>
58                 <li role="menuitem"><a href="<%= logout_path %>" role="menuitem"><i class="fa fa-sign-out fa-fw"></i> Log out</a></li>
59                 <% if current_user.is_active and
60                       (@notifications || []).length > 0 %>
61                   <li role="presentation" class="divider"></li>
62                   <% @notifications.each_with_index do |n, i| %>
63                     <% if i > 0 %><li class="divider"></li><% end %>
64                     <li class="notification"><%= n.call(self) %></li>
65                   <% end %>
66                 <% end %>
67               </ul>
68             </li>
69
70             <% if current_user.is_admin %>
71               <li class="dropdown">
72                 <a href="#" class="dropdown-toggle" data-toggle="dropdown" id="system-menu">
73                   <span class="fa fa-lg fa-gear"></span>
74                 </a>
75                 <ul class="dropdown-menu" role="menu">
76                   <li role="presentation" class="dropdown-header">
77                     Settings
78                   </li>
79                   <li role="menuitem"><a href="/repositories">
80                       <i class="fa fa-lg fa-code-fork fa-fw"></i> Repositories
81                   </a></li>
82                   <li role="menuitem"><a href="/virtual_machines">
83                       <i class="fa fa-lg fa-terminal fa-fw"></i> Virtual machines
84                   </a></li>
85                   <li role="menuitem"><a href="/authorized_keys">
86                       <i class="fa fa-lg fa-key fa-fw"></i> SSH keys
87                   </a></li>
88                   <li role="menuitem"><a href="/api_client_authorizations">
89                       <i class="fa fa-lg fa-ticket fa-fw"></i> API tokens
90                   </a></li>
91                   <li role="menuitem"><a href="/links">
92                       <i class="fa fa-lg fa-arrows-h fa-fw"></i> Links
93                   </a></li>
94                   <li role="menuitem"><a href="/users">
95                       <i class="fa fa-lg fa-user fa-fw"></i> Users
96                   </a></li>
97                   <li role="menuitem"><a href="/groups">
98                       <i class="fa fa-lg fa-users fa-fw"></i> Groups
99                   </a></li>
100                   <li role="menuitem"><a href="/nodes">
101                       <i class="fa fa-lg fa-cloud fa-fw"></i> Compute nodes
102                   </a></li>
103                   <li role="menuitem"><a href="/keep_services">
104                       <i class="fa fa-lg fa-exchange fa-fw"></i> Keep services
105                   </a></li>
106                   <li role="menuitem"><a href="/keep_disks">
107                       <i class="fa fa-lg fa-hdd-o fa-fw"></i> Keep disks
108                   </a></li>
109                 </ul>
110               </li>
111             <% end %>
112           <% else %>
113             <li><a href="<%= arvados_api_client.arvados_login_url(return_to: root_url) %>">Log in</a></li>
114           <% end %>
115
116           <li class="dropdown help-menu">
117             <a href="#" class="dropdown-toggle" data-toggle="dropdown" id="arv-help">
118               <span class="fa fa-lg fa-question-circle"></span>
119             </a>
120             <ul class="dropdown-menu">
121               <li><%= link_to raw('<i class="fa fa-book fa-fw"></i> Tutorials and User guide'), "#{Rails.configuration.arvados_docsite}/user", target: "_blank" %></li>
122               <li><%= link_to raw('<i class="fa fa-book fa-fw"></i> API Reference'), "#{Rails.configuration.arvados_docsite}/api", target: "_blank" %></li>
123               <li><%= link_to raw('<i class="fa fa-book fa-fw"></i> SDK Reference'), "#{Rails.configuration.arvados_docsite}/sdk", target: "_blank" %></li>
124               <li role="presentation" class="divider"></li>
125               <li> <%= link_to report_issue_popup_path(popup_type: 'version', current_location: request.url, current_path: request.fullpath, action_method: 'post'),
126                       {class: 'report-issue-modal-window',  :remote => true, return_to: request.url} do %>
127                        <i class="fa fa-fw fa-support"></i> Show version / debugging info ...
128                       <% end %>
129               </li>
130               <li> <%= link_to report_issue_popup_path(popup_type: 'report', current_location: request.url, current_path: request.fullpath, action_method: 'post'),
131                       {class: 'report-issue-modal-window', :remote => true, return_to: request.url} do %>
132                        <i class="fa fa-fw fa-support"></i> Report a problem ...
133                       <% end %>
134               </li>
135             </ul>
136           </li>
137         </ul>
138       </div><!-- /.navbar-collapse -->
139     </nav>
140
141     <% if current_user.andand.is_active %>
142       <nav class="navbar navbar-default breadcrumbs" role="navigation">
143         <ul class="nav navbar-nav navbar-left">
144           <li>
145             <a href="/">
146               <i class="fa fa-lg fa-fw fa-dashboard"></i>
147               Dashboard
148             </a>
149           </li>
150           <li class="dropdown">
151             <a href="#" class="dropdown-toggle" data-toggle="dropdown" id="projects-menu">
152               Projects
153               <span class="caret"></span>
154             </a>
155             <ul class="dropdown-menu" role="menu">
156             <%= render partial: "projects_tree_menu", locals: {
157                   :project_link_to => Proc.new do |pnode, &block|
158                     link_to(project_path(pnode[:object].uuid),
159                       data: { 'object-uuid' => pnode[:object].uuid,
160                               'name' => 'name' },
161                       &block)
162                   end,
163                   :top_button => Proc.new do %>
164                     <% link_to projects_path, method: 'post', class: 'btn btn-xs btn-default pull-right' do %>
165                       <i class="fa fa-plus"></i> New project
166                     <% end %>
167                   <% end %>
168             <% } %>
169             </ul>
170           </li>
171           <% if @name_link or @object %>
172             <li class="nav-separator">
173               <i class="fa fa-lg fa-angle-double-right"></i>
174             </li>
175             <li>
176               <%= link_to project_path(current_user.uuid) do %>
177                 Home
178               <% end %>
179             </li>
180             <% project_breadcrumbs.each do |p| %>
181               <li class="nav-separator">
182                 <i class="fa fa-lg fa-angle-double-right"></i>
183               </li>
184               <li>
185                 <%= link_to(p.name, project_path(p.uuid), data: {object_uuid: p.uuid, name: 'name'}) %>
186               </li>
187             <% end %>
188           <% end %>
189         </ul>
190       </nav>
191     <% end %>
192
193     <div id="page-wrapper">
194       <%= yield %>
195     </div>
196   </div>
197
198   <%= yield :footer_html %>
199
200 <div class="modal-container"></div>
201 <div id="report-issue-modal-window"></div>