Merge branch 'origin-3609-arv-run' into master closes #3609
[arvados.git] / apps / workbench / app / views / collections / _choose_rows.html.erb
index 036e619ce116edf2c17cb9cadd669fe1aad58c46..da0f9759c1beae0c6f3c71786bdc438a17315fdb 100644 (file)
@@ -3,7 +3,18 @@
          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>
-      <%= object.name %>
+      <% 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>