From: Peter Amstutz Date: Fri, 22 Aug 2014 17:56:59 +0000 (-0400) Subject: Display first file in collection if name field is nil or empty. refs #3504 X-Git-Tag: 1.1.0~2302 X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/d85ec3b1d45863839186537c6c832732784d5689 Display first file in collection if name field is nil or empty. refs #3504 --- diff --git a/apps/workbench/app/views/collections/_choose_rows.html.erb b/apps/workbench/app/views/collections/_choose_rows.html.erb index 27b66e4482..da0f9759c1 100644 --- a/apps/workbench/app/views/collections/_choose_rows.html.erb +++ b/apps/workbench/app/views/collections/_choose_rows.html.erb @@ -4,7 +4,14 @@ style="margin-left: 1em; border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: #DDDDDD"> <% if object.respond_to? :name %> - <%= object.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 %>