Add documentation to doc.arvados.org for the local Docker install.
[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_projects? and @object.owner_uuid == current_user.uuid and not @name_link %>
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 projects. If you want it to be easy to find in the future, you should move it to a project.<br />
7         <%= button_to(choose_projects_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 project...
16         <% end %>
17       </div>
18     </div>
19   <% end %>
20 <% end %>
21
22 <% content_for :js do %>
23   tab_pane_valid_state = {};
24
25   function ajaxRefreshTabPane(pane) {
26     if (!tab_pane_valid_state[pane]) {
27       tab_pane_valid_state[pane] = true;
28       $.ajax('<%=j url_for() %>?<%= raw(controller.request.query_string) %>&tab_pane='+pane, {dataType: 'html', type: 'GET'}).
29         done(function(data, status, jqxhr) {
30           $('#' + pane + ' > div > div').html(data);
31           ajaxRefreshTabPane(pane);
32         });
33     }
34   }
35
36   $(window).on('load', smart_scroll_fixup);
37   $(document).on('shown.bs.tab', 'ul.nav-tabs > li > a', smart_scroll_fixup);
38
39   $(document).on('shown.bs.tab', function(e) {
40     ajaxRefreshTabPane(e.target.id.slice(0, -4));
41   });
42
43   $(document).on('arv-log-event', function() {
44     <% pane_list.each do |pane| %>
45     tab_pane_valid_state['<%=j pane %>'] = false;
46     <% end %>
47     ajaxRefreshTabPane($('.tab-pane.active')[0].id);
48   });
49 <% end %>
50
51 <% content_for :tab_panes do %>
52
53 <% comparable = controller.respond_to? :compare %>
54
55 <ul class="nav nav-tabs">
56   <% pane_list.each_with_index do |pane, i| %>
57     <li class="<%= 'active' if i==0 %>"><a href="#<%= pane %>" data-toggle="tab" id="<%= pane %>-tab"> <%= pane.gsub('_', ' ') %></a></li>
58   <% end %>
59 </ul>
60 <div class="tab-content">
61 <% pane_list.each_with_index do |pane, i| %>
62   <div id="<%= pane %>"
63        class="tab-pane fade <%= 'in active' if i==0 %> arv-log-event-listener"
64 <% if controller.action_name == "index" %>
65        data-object-kind="arvados#<%= ArvadosApiClient.class_kind controller.model_class %>"
66 <% else %>
67        data-object-uuid="<%= @object.uuid %>"
68 <% end %>
69   >
70
71 <% content_for :js do %>
72   <% if i == 0 %>
73     tab_pane_valid_state['<%=j pane %>'] = true;
74   <% else %>
75     tab_pane_valid_state['<%=j pane %>'] = false;
76     $(document).on('ready', function() {
77       ajaxRefreshTabPane('<%=j pane %>');
78     });
79   <% end %>
80 <% end %>
81
82     <div id="<%= pane %>-scroll" style="margin-top:0.5em;">
83       <div class="pane-content">
84         <% if i == 0 %>
85           <%= render(partial: 'show_' + pane.downcase,
86                      locals: { comparable: comparable, objects: @objects }) %>
87           <% else %>
88             <%= image_tag 'ajax-loader.gif' %>
89         <% end %>
90       </div>
91     </div>
92   </div>
93 <% end %>
94 </div>
95
96 <% end %>