Merge branch 'master' into 4036-combine-collections-in-project-issue
[arvados.git] / apps / workbench / app / views / collections / _choose_rows.html.erb
index 55e64515a4451cb4c6946e0f975eebbb1bb74f9c..da0f9759c1beae0c6f3c71786bdc438a17315fdb 100644 (file)
@@ -1,15 +1,40 @@
+<% @collections.each do |object| %>
+    <div class="row filterable selectable" data-object-uuid="<%= object.uuid %>"
+         data-preview-href="<%= chooser_preview_url_for object %>"
+         style="margin-left: 1em; border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: #DDDDDD">
+      <i class="fa fa-fw fa-archive"></i>
+      <% if object.respond_to? :name %>
+        <% if not (object.name.nil? or object.name.empty?) %>
+          <%= object.name %>
+        <% elsif object.is_a? Collection and object.files.length > 0 %>
+          <%= object.files[0][1] %>
+          <%= "+ #{object.files.length-1} more" if object.files.length > 1 %>
+        <% else %>
+          <%= object.uuid %>
+        <% end %>
+      <% else %>
+        <%= object.uuid %>
+      <% end %>
+      <% links_for_object(object).each do |tag| %>
+        <% if tag.link_class == 'tag' %>
+          <span class="label label-info"><%= tag.name %></span>
+        <% end %>
+      <% end %>
+    </div>
+<% end %>
+
 <% @name_links.each do |name_link| %>
-  <div class="row selectable <%= 'multiple' if multiple %>" data-object-uuid="<%= name_link.uuid %>">
-    <div class="col-lg-12" style="overflow-x:hidden">
+  <% if (object = get_object(name_link.head_uuid)) %>
+    <div class="row filterable selectable" data-object-uuid="<%= name_link.uuid %>"
+         data-preview-href="<%= chooser_preview_url_for object %>"
+         style="margin-left: 1em; border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: #DDDDDD">
       <i class="fa fa-fw fa-archive"></i>
       <%= name_link.name %>
+      <% links_for_object(object).each do |tag| %>
+        <% if tag.link_class == 'tag' %>
+          <span class="label label-info"><%= tag.name %></span>
+        <% end %>
+      <% end %>
     </div>
-    <div class="col-lg-12 arv-description-in-table">
-      <%= render_controller_partial(
-          'show_object_description_cell.html',
-          controller_name: 'collections',
-          locals: {object: get_object(name_link.head_uuid)})
-          %>
-    </div>
-  </div>
+  <% end %>
 <% end %>