Fix 2.4.2 upgrade notes formatting refs #19330
[arvados.git] / apps / workbench / app / views / trash_items / _show_trash_rows.html.erb
index 73b89dd5493c8a45dcc1c8030d7d0c4fb1f5b127..dd451b6eac1af0ed657069836bea1e61eab86025 100644 (file)
@@ -1,39 +1,47 @@
-<% @objects.sort_by { |obj| obj.created_at }.reverse.each do |obj| %>
-    <tr data-object-uuid="<%= obj.uuid %>" data-kind="<%= obj.kind %>" >
+<%# 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>
+      <% if obj.editable? and obj.is_trashed %>
+        <%= check_box_tag 'uuids[]', obj.uuid, false, :class => 'persistent-selection', style: 'cursor: pointer;' %>
+      <% end %>
+    </td>
+    <td>
+      <%= if !obj.name.blank? then obj.name else obj.uuid end %>
+    </td>
+    <% if obj.is_trashed %>
       <td>
-        <%= check_box_tag 'uuids[]', obj.uuid, false, :class => 'persistent-selection' %>
+        <%= link_to_if_arvados_object @owners[obj.owner_uuid], friendly_name: true %>
       </td>
+
       <td>
-        <%= link_to_if_arvados_object obj, friendly_name: true %>
-      <td>
-        <%= obj.created_at.to_s if obj.created_at %>
-      <td>
-        <%= obj.trash_at.to_s if obj.trash_at %>
-      </td>
-      <td>
-        <% i = 0 %>
-        <% while i < 3 and i < obj.files.length %>
-          <% 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 %>
+        <% if obj.trash_at %>
+          <%= render_localized_date(obj.trash_at)  %>
         <% end %>
-        <% if i < obj.files.length %>
-          &vellip;
+        <br />
+        <% if obj.delete_at %>
+          <%= render_localized_date(obj.delete_at) %>
         <% 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 %>
-        <% end %>
-        </span>
-      </td>
-      <td>
-        <%= render partial: 'untrash_item', locals: {object:obj} %>
+    <% else %>
+      <td colspan="2" class="trash-project-msg">
+        <%= link_to_if_arvados_object @owners[obj.owner_uuid], friendly_name: true %>
+        <br>
+        This item is contained within a trashed project.
       </td>
-    </tr>
+    <% end %>
+    <td>
+      <%= obj.uuid %>
+      <% if defined? obj.portable_data_hash %>
+        <br /><%= obj.portable_data_hash %>
+      <% end %>
+    </td>
+    <td>
+      <%= render partial: 'untrash_item', locals: {object:obj} %>
+    </td>
+  </tr>
+
 <% end %>