2872: Use data chooser for running pipelines. Many presentation fixes.
[arvados.git] / apps / workbench / app / views / application / _show_recent.html.erb
index 9028c6abee4aeccf3530a500c68a86ac904105a6..800263f0f42bbabaae4897fbe732c13f64d85477 100644 (file)
@@ -1,17 +1,25 @@
-<% if @objects.empty? %>
+<% if objects.empty? %>
 <br/>
 <p style="text-align: center">
-  No <%= controller.model_class.to_s.pluralize.underscore.gsub '_', ' ' %> to display.
+  No <%= controller.controller_name.humanize.downcase %> to display.
 </p>
 
 <% else %>
 
-<% attr_blacklist = ' created_at modified_at modified_by_user_uuid modified_by_client_uuid updated_at' %>
+<% attr_blacklist = ' created_at modified_at modified_by_user_uuid modified_by_client_uuid updated_at owner_uuid group_class' %>
+
+<%= render partial: "paging", locals: {results: objects, object: @object} %>
+
+<%= form_tag do |f| %>
 
 <table class="table table-condensed arv-index">
   <thead>
     <tr>
-      <% @objects.first.attributes_for_display.each do |attr, attrvalue| %>
+      <% if objects.first and objects.first.class.goes_in_folders? %>
+        <th></th>
+      <% end %>
+      <th></th>
+      <% objects.first.attributes_for_display.each do |attr, attrvalue| %>
       <% next if attr_blacklist.index(" "+attr) %>
       <th class="arv-attr-<%= attr %>">
         <%= controller.model_class.attribute_info[attr.to_sym].andand[:column_heading] or attr.sub /_uuid/, '' %>
   </thead>
       
   <tbody>
-    <% @objects.each do |object| %>
+    <% objects.each do |object| %>
     <tr data-object-uuid="<%= object.uuid %>">
+      <% if objects.first.class.goes_in_folders? %>
+        <td>
+          <%= render :partial => "selection_checkbox", :locals => {:object => object} %>
+        </td>
+      <% end %>
+      <td>
+        <%= render :partial => "show_object_button", :locals => {object: object, size: 'xs'} %>
+      </td>
+
       <% object.attributes_for_display.each do |attr, attrvalue| %>
       <% next if attr_blacklist.index(" "+attr) %>
       <td class="arv-object-<%= object.class.to_s %> arv-attr-<%= attr %>">
         <% if attr == 'uuid' %>
-        <%= link_to_if_arvados_object object %>
-        <%= link_to_if_arvados_object(object, { link_text: raw('<i class="icon-hand-right"></i>') }) %>
+        <span class="arvados-uuid"><%= attrvalue %></span>
         <% else %>
         <% if object.attribute_editable? attr %>
         <%= render_editable_attribute object, attr %>
       </td>
       <% end %>
       <td>
-        <% if object.editable? %>
-        <%= link_to({action: 'destroy', id: object.uuid}, method: :delete, remote: true, data: {confirm: "You are about to delete #{controller.model_class} #{object.uuid}.\n\nAre you sure?"}) do %>
-        <i class="glyphicon glyphicon-trash"></i>
-        <% end %>
-        <% end %>
+        <%= render partial: 'delete_object_button', locals: {object:object} %>
       </td>
     </tr>
     <% end %>
@@ -59,3 +71,7 @@
 </table>
 
 <% end %>
+
+<%= render partial: "paging", locals: {results: objects, object: @object} %>
+
+<% end %>