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">×</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(
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...
22 <% content_for :js do %>
23 tab_pane_valid_state = {};
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);
36 $(window).on('load', smart_scroll_fixup);
37 $(document).on('shown.bs.tab', 'ul.nav-tabs > li > a', smart_scroll_fixup);
39 $(document).on('shown.bs.tab', function(e) {
40 ajaxRefreshTabPane(e.target.id.slice(0, -4));
43 $(document).on('arv-log-event', function() {
44 <% pane_list.each do |pane| %>
45 tab_pane_valid_state['<%=j pane %>'] = false;
47 ajaxRefreshTabPane($('.tab-pane.active')[0].id);
51 <% content_for :tab_panes do %>
53 <% comparable = controller.respond_to? :compare %>
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>
60 <div class="tab-content">
61 <% pane_list.each_with_index do |pane, i| %>
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 %>"
67 data-object-uuid="<%= @object.uuid %>"
71 <% content_for :js do %>
73 tab_pane_valid_state['<%=j pane %>'] = true;
75 tab_pane_valid_state['<%=j pane %>'] = false;
76 $(document).on('ready', function() {
77 ajaxRefreshTabPane('<%=j pane %>');
82 <div id="<%= pane %>-scroll" style="margin-top:0.5em;">
83 <div class="pane-content">
85 <%= render(partial: 'show_' + pane.downcase,
86 locals: { comparable: comparable, objects: @objects }) %>
88 <div class="spinner spinner-32px spinner-h-center"></div>