3531: Move the tab_line_buttons sections out of the tab pane partials
[arvados.git] / apps / workbench / app / views / pipeline_instances / _show_recent.html.erb
index e21111294697044acce4b3d50d1dda90d6dc0f3c..08b24f13cb03faa1dcb17c1c1830f90aa5706c64 100644 (file)
@@ -1,32 +1,30 @@
-<%= content_for :tab_line_buttons do %>
-<%= form_tag({action: 'compare', controller: params[:controller], method: 'get'}, {method: 'get', id: 'compare', class: 'pull-right small-form-margin'}) do |f| %>
-  <%= submit_tag 'Compare selected', {class: 'btn btn-primary', disabled: true, style: 'display: none'} %>
-  &nbsp;
-<% end rescue nil %>
-<% end %>
+<%= render partial: "paging", locals: {results: @objects, object: @object} %>
 
 <%= form_tag do |f| %>
 
-<table class="table table-hover">
+<table class="table table-condensed table-fixedlayout">
+  <colgroup>
+    <col width="5%" />
+    <col width="15%" />
+    <col width="25%" />
+    <col width="20%" />
+    <col width="15%" />
+    <col width="15%" />
+    <col width="5%" />
+  </colgroup>
   <thead>
     <tr class="contain-align-left">
       <th>
       </th><th>
-       status
-      </th><th>
-       id
-      </th><th>
-       name
-      </th><th>
-       template
+       Status
       </th><th>
-       owner
+       Instance
       </th><th>
-       components
+       Template
       </th><th>
-       dependencies
+       Owner
       </th><th>
-       created
+       Created at
       </th><th>
       </th>
     </tr>
 
     <tr data-object-uuid="<%= ob.uuid %>">
       <td>
-        <%= check_box_tag 'uuids[]', ob.uuid, false %>
+        <%= check_box_tag 'uuids[]', ob.uuid, false, :class => 'persistent-selection' %>
       </td><td>
-        <% if ob.success %>
-        <span class="label label-success">success</span>
-        <% elsif ob.active %>
-        <span class="label label-info">active</span>
-        <% end %>
-      </td><td>
-        <%= link_to_if_arvados_object ob %>
+        <%= render partial: 'pipeline_status_label', locals: {:p => ob} %>
+      </td><td colspan="1">
+        <%= link_to_if_arvados_object ob, friendly_name: true %>
       </td><td>
-        <%= ob.name %>
+        <%= link_to_if_arvados_object ob.pipeline_template_uuid, friendly_name: true %>
       </td><td>
-        <%= link_to_if_arvados_object ob.pipeline_template_uuid %>
+        <%= link_to_if_arvados_object ob.owner_uuid, friendly_name: true %>
       </td><td>
-        <%= link_to_if_arvados_object ob.owner_uuid %>
+        <%= ob.created_at.to_s %>
       </td><td>
+        <%= render partial: 'delete_object_button', locals: {object:ob} %>
+      </td>
+    </tr>
+    <tr data-object-uuid="<%= ob.uuid %>">
+      <td style="border-top: 0;" colspan="2">
+      </td>
+      <td style="border-top: 0; opacity: 0.5;" colspan="6">
         <% ob.components.each do |cname, c| %>
-        <% status = if !(c.is_a?(Hash) && c[:job].is_a?(Hash)) then nil elsif c[:job][:success] then 'success' elsif c[:job][:running] then 'info' else 'warning' end %>
-        <span class="label <%= "label-#{status}" if status %>"><%= cname.to_s %></span>
-        <% end %>
-      </td><td>
-        <small>
-          <% ob.dependencies.each do |d| %>
-          <%= d %><br />
+          <% if c.is_a?(Hash) and c[:job] %>
+            <%= render partial: "job_status_label", locals: {:j => c[:job], :title => cname.to_s } %>
+          <% else %>
+            <span class="label label-default"><%= cname.to_s %></span>
           <% end %>
-        </small>
-      </td><td>
-        <%= ob.created_at %>
+        <% end %>
       </td>
     </tr>
-
     <% end %>
 
   </tbody>
 
 <% end %>
 
-<% content_for :footer_js do %>
-var showhide_compare = function() {
-    var form = $('form#compare')[0];
-    $('input[type=hidden][name="uuids[]"]', form).remove();
-    $('input[type=submit]', form).prop('disabled',true);
-    $('input[name="uuids[]"]').each(function(){
-        if(this.checked) {
-            $('input[type=submit]', form).prop('disabled',false).show();
-            $(form).append($('<input type="hidden" name="uuids[]"/>').val(this.value));
-        }
-    });
-};
-$('form input[name="uuids[]"]').on('click', showhide_compare);
-showhide_compare();
-<% end %>
+<%= render partial: "paging", locals: {results: @objects, object: @object} %>