2872: Add selection checkboxes to folder view. Compare pipeline instances and remove...
[arvados.git] / apps / workbench / app / views / application / _content.html.erb
1 <% content_for :content_top do %>
2   <% if @object and not @object.is_a?(Group) and @object.class.goes_in_folders? and @object.owner_uuid == current_user.uuid %>
3     <div class="pull-right" style="width: 40%">
4       <div class="alert alert-warning alert-dismissable">
5         <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
6         <strong>Hey.</strong> This <%= @object.class_for_display.downcase %> belongs to your account, but it's not in any of your folders. If you want it to be easy to find in the future, you should move it to a folder.<br />
7         <%= button_to(choose_folders_path(
8                    title: 'Move to...',
9                    editable: true,
10                    action_name: 'Move',
11                    action_href: url_for(action: :update),
12                    action_method: 'patch',
13                    action_data: {selection_param: @object.resource_param_name+'[owner_uuid]', success: 'page-refresh'}.to_json),
14                   { class: "btn btn-primary btn-sm", remote: true, method: 'get' }) do %>
15           <i class="fa fa-fw fa-folder"></i> Choose a folder...
16         <% end %>
17       </div>
18     </div>
19   <% end %>
20 <% end %>
21
22 <% content_for :tab_panes do %>
23
24 <% comparable = controller.respond_to? :compare %>
25 <% pane_list ||= %w(recent) %>
26 <% panes = Hash[pane_list.map { |pane|
27      [pane, render(partial: 'show_' + pane.downcase,
28                    locals: { comparable: comparable, objects: @objects })]
29    }.compact] %>
30
31 <ul class="nav nav-tabs">
32   <% panes.each_with_index do |(pane, content), i| %>
33     <li class="<%= 'active' if i==0 %>"><a href="#<%= pane %>" data-toggle="tab" id="<%= pane %>-tab"> <%= pane.gsub('_', ' ') %></a></li>
34   <% end %>
35 </ul>
36 <div class="tab-content">
37 <% panes.each_with_index do |(pane, content), i| %>
38   <div id="<%= pane %>" class="tab-pane fade <%= 'in active' if i==0 %>">
39     <div id="<%= pane %>-scroll" class="<%= 'smart-scroll' if pane.match(/graph/) %>" style="margin-top:0.5em;">
40       <%= content %>
41     </div>
42   </div>
43 <% end %>
44 </div>
45
46 <% end %>
47
48 <% content_for :js do %>
49     $(window).on('load', smart_scroll_fixup);
50     $(document).on('shown.bs.tab', 'ul.nav-tabs > li > a', smart_scroll_fixup);
51 <% end %>