Arvados-DCO-1.1-Signed-off-by: Radhika Chippada <radhika@curoverse.com>
[arvados.git] / apps / workbench / app / views / trash_items / _show_trash_rows.html.erb
index 73b89dd5493c8a45dcc1c8030d7d0c4fb1f5b127..6fc1676b85dbcb378d300f5efffb67c2edde98a3 100644 (file)
@@ -1,36 +1,33 @@
-<% @objects.sort_by { |obj| obj.created_at }.reverse.each do |obj| %>
+<%# Copyright (C) The Arvados Authors. All rights reserved.
+
+SPDX-License-Identifier: AGPL-3.0 %>
+
+<% @objects.each do |obj| %>
     <tr data-object-uuid="<%= obj.uuid %>" data-kind="<%= obj.kind %>" >
       <td>
-        <%= check_box_tag 'uuids[]', obj.uuid, false, :class => 'persistent-selection' %>
+        <% if obj.editable? %>
+          <%= check_box_tag 'uuids[]', obj.uuid, false, :class => 'persistent-selection', style: 'cursor: pointer;' %>
+        <% end %>
       </td>
       <td>
-        <%= link_to_if_arvados_object obj, friendly_name: true %>
+        <%= if !obj.name.blank? then obj.name else obj.uuid end %>
+      <td>
+        <%= render_localized_date(obj.trash_at) if obj.trash_at %>
       <td>
-        <%= obj.created_at.to_s if obj.created_at %>
+        <%= render_localized_date(obj.delete_at) if obj.delete_at %>
+      </td>
       <td>
-        <%= obj.trash_at.to_s if obj.trash_at %>
+        <%= link_to_if_arvados_object obj.owner_uuid, friendly_name: true %>
       </td>
       <td>
-        <% i = 0 %>
-        <% while i < 3 and i < obj.files.length %>
+        <% for i in (0..[2, obj.files.length-1].min) %>
           <% file = obj.files[i] %>
           <% file_path = "#{file[0]}/#{file[1]}" %>
-          <%= link_to file[1], {controller: 'collections', action: 'show_file', uuid: obj.uuid, file: file_path, size: file[2], disposition: 'inline'}, {title: 'View in browser'} %><br />
-          <% i += 1 %>
+          <%= file_path %><br />
         <% end %>
-        <% if i < obj.files.length %>
-          &vellip;
-        <% end %>
-      </td>
-      <td>
-        <span class="tag-container">
-        <% if @collection_info[obj.uuid] %>
-          <% @collection_info[obj.uuid][:tag_links].each do |tag_link| %>
-            <span class="label label-info" data-tag-link-uuid="<%= tag_link.uuid %>"><%= tag_link.name %>
-            </span>&nbsp;
-          <% end %>
+        <% if obj.files.length > 3 %>
+          <%= "(#{obj.files.length-3} more files)" %>
         <% end %>
-        </span>
       </td>
       <td>
         <%= render partial: 'untrash_item', locals: {object:obj} %>