2760: Replace dashboard tables with news feed. More ability to link via names rather...
[arvados.git] / apps / workbench / app / views / collections / _feed_item.html.erb
diff --git a/apps/workbench/app/views/collections/_feed_item.html.erb b/apps/workbench/app/views/collections/_feed_item.html.erb
new file mode 100644 (file)
index 0000000..8472796
--- /dev/null
@@ -0,0 +1,36 @@
+<table class="table table-condensed table-justforlayout">
+  <colgroup>
+    <col style="width: 70%" />
+    <col style="width: 30%" />
+  </colgroup>
+  <thead>
+  </thead>
+  <tbody>
+    <% maxfiles = 5 %>
+    <% object.files[0..(maxfiles-1)].each do |dirname, basename, filesize| %>
+    <tr>
+      <td>
+        <%= dirname == '.' ? '' : '.../' %><%= basename %>
+      </td><td>
+        <%= human_readable_bytes_html filesize %>
+      </td>
+    </tr>
+    <% end %>
+    <% if object.files.count > maxfiles %>
+    <tr>
+      <td>&vellip;</td><td>&vellip;</td>
+    </tr>
+    <% end %>
+  </tbody>
+  <tfoot>
+    <% if object.files.count > 1 %>
+    <tr>
+      <td>
+        <%= object.files.count %> files
+      </td><td>
+        <%= human_readable_bytes_html object.total_bytes %>
+      </td>
+    </tr>
+    <% end %>
+  </tfoot>
+</table>