3170: On pipeline instance page, refresh the tab panes rather than the entire page.
[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 :tab_panes do %>
23
24 <% comparable = controller.respond_to? :compare %>
25
26 <ul class="nav nav-tabs">
27   <% pane_list.each_with_index do |pane, i| %>
28     <li class="<%= 'active' if i==0 %>"><a href="#<%= pane %>" data-toggle="tab" id="<%= pane %>-tab" data-pane-content-url="<%= url_for(tab_pane: pane) %>"> <%= pane.gsub('_', ' ') %></a></li>
29   <% end %>
30 </ul>
31 <div class="tab-content">
32 <% pane_list.each_with_index do |pane, i| %>
33   <div id="<%= pane %>"
34        class="tab-pane fade <%= 'in active loaded' if i==0 %> arv-log-event-listener"
35 <% if controller.action_name == "index" %>
36        data-object-kind="arvados#<%= ArvadosApiClient.class_kind controller.model_class %>"
37 <% else %>
38        data-object-uuid="<%= @object.uuid %>"
39 <% end %>
40   >
41
42     <div id="<%= pane %>-scroll" style="margin-top:0.5em;">
43       <div class="pane-content">
44         <% if i == 0 %>
45           <%= render(partial: 'show_' + pane.downcase,
46                      locals: { comparable: comparable, objects: @objects }) %>
47         <% else %>
48           <div class="spinner spinner-32px spinner-h-center"></div>
49         <% end %>
50       </div>
51     </div>
52   </div>
53 <% end %>
54 </div>
55
56 <% end %>