From 06f5f794cd1fc8cb4dbf72e3a2fbc440b44101b9 Mon Sep 17 00:00:00 2001 From: Tom Clegg Date: Mon, 2 Jun 2014 01:24:55 -0400 Subject: [PATCH] 2872: Show collection details in chooser. --- .../app/controllers/application_controller.rb | 11 +++++++++++ .../app/views/collections/_choose_rows.html.erb | 10 +++++++--- .../_show_object_description_cell.html.erb | 10 +++++----- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/apps/workbench/app/controllers/application_controller.rb b/apps/workbench/app/controllers/application_controller.rb index 09419216b5..c1e82eb621 100644 --- a/apps/workbench/app/controllers/application_controller.rb +++ b/apps/workbench/app/controllers/application_controller.rb @@ -495,4 +495,15 @@ class ApplicationController < ActionController::Base root_of[g.uuid] == current_user.uuid end end + + helper_method :get_object + def get_object uuid + if @get_object.nil? and @objects + @get_object = @objects.each_with_object({}) do |object, h| + h[object.uuid] = object + end + end + @get_object ||= {} + @get_object[uuid] + end end diff --git a/apps/workbench/app/views/collections/_choose_rows.html.erb b/apps/workbench/app/views/collections/_choose_rows.html.erb index 86228306f5..55e64515a4 100644 --- a/apps/workbench/app/views/collections/_choose_rows.html.erb +++ b/apps/workbench/app/views/collections/_choose_rows.html.erb @@ -1,11 +1,15 @@ <% @name_links.each do |name_link| %>
-
+
<%= name_link.name %>
-
- <%= link_to_if_arvados_object name_link.tail_uuid, friendly_name: true %> +
+ <%= render_controller_partial( + 'show_object_description_cell.html', + controller_name: 'collections', + locals: {object: get_object(name_link.head_uuid)}) + %>
<% end %> diff --git a/apps/workbench/app/views/collections/_show_object_description_cell.html.erb b/apps/workbench/app/views/collections/_show_object_description_cell.html.erb index 0b3352b7f3..1f1325dbbe 100644 --- a/apps/workbench/app/views/collections/_show_object_description_cell.html.erb +++ b/apps/workbench/app/views/collections/_show_object_description_cell.html.erb @@ -1,9 +1,4 @@
-
- <% Link.filter([['link_class','=','tag'],['head_uuid','=',object.uuid]]).collect(&:name).each do |tagname| %> - <%= tagname %> - <% end %> -
Files (<%= human_readable_bytes_html(object.total_bytes) %>): @@ -11,4 +6,9 @@ <%= file %> <% end %> +
+ <% Link.filter([['link_class','=','tag'],['head_uuid','=',object.uuid]]).collect(&:name).each do |tagname| %> + <%= tagname %> + <% end %> +
-- 2.30.2