4024: scrolling + search works now that filters are included in next page href.
[arvados.git] / apps / workbench / app / views / pipeline_instances / _show_recent.html.erb
index e21111294697044acce4b3d50d1dda90d6dc0f3c..e1a7cea0ada087f0f63ef77f5783aaa4c2cba30b 100644 (file)
@@ -1,92 +1,37 @@
-<%= 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 %>
-
 <%= form_tag do |f| %>
 
-<table class="table table-hover">
+<table class="table table-condensed table-fixedlayout arv-recent-pipeline-instances">
+  <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
+       Status
       </th><th>
-       name
+       Instance
       </th><th>
-       template
+       Template
       </th><th>
-       owner
+       Owner
       </th><th>
-       components
-      </th><th>
-       dependencies
-      </th><th>
-       created
+       Created at
       </th><th>
       </th>
     </tr>
   </thead>
-  <tbody>
-
-    <% @objects.sort_by { |ob| ob.created_at }.reverse.each do |ob| %>
-
-    <tr data-object-uuid="<%= ob.uuid %>">
-      <td>
-        <%= check_box_tag 'uuids[]', ob.uuid, false %>
-      </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 %>
-      </td><td>
-        <%= ob.name %>
-      </td><td>
-        <%= link_to_if_arvados_object ob.pipeline_template_uuid %>
-      </td><td>
-        <%= link_to_if_arvados_object ob.owner_uuid %>
-      </td><td>
-        <% 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 />
-          <% end %>
-        </small>
-      </td><td>
-        <%= ob.created_at %>
-      </td>
-    </tr>
-
-    <% end %>
 
+  <tbody data-infinite-scroller="#recent-pipeline-instances" id="recent-pipeline-instances"
+         data-infinite-content-href="<%= url_for partial: :recent_rows %>" >
   </tbody>
-</table>
 
-<% end %>
+</table>
 
-<% 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 %>