From 73bbd418892be34d89a1274d9bfe4218f96bf886 Mon Sep 17 00:00:00 2001 From: Peter Amstutz Date: Thu, 21 Aug 2014 15:08:38 -0400 Subject: [PATCH] 3504: Remove link to links index page on tags. Add comment to CollectionsController#choose. Adjust column width in collections file table. --- apps/workbench/app/controllers/collections_controller.rb | 8 ++++++++ .../workbench/app/views/collections/_show_recent.html.erb | 8 ++++---- .../app/views/projects/_show_contents_rows.html.erb | 3 ++- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/apps/workbench/app/controllers/collections_controller.rb b/apps/workbench/app/controllers/collections_controller.rb index 1cc4966ac8..010cd220e7 100644 --- a/apps/workbench/app/controllers/collections_controller.rb +++ b/apps/workbench/app/controllers/collections_controller.rb @@ -44,6 +44,13 @@ class CollectionsController < ApplicationController end def choose + # Find collections using default find_objects logic, then search for name + # links, and preload any other links connected to the collections that are + # found. + # Name links will be obsolete when issue #3036 is merged, + # at which point this entire custom #choose function can probably be + # eliminated. + params[:limit] ||= 40 find_objects_for_index @@ -59,6 +66,7 @@ class CollectionsController < ApplicationController @objects = Collection. filter([['uuid','in',@name_links.collect(&:head_uuid)]]) + preload_links_for_objects (@collections.to_a + @objects.to_a) super end diff --git a/apps/workbench/app/views/collections/_show_recent.html.erb b/apps/workbench/app/views/collections/_show_recent.html.erb index d963114e84..54fc9f3da5 100644 --- a/apps/workbench/app/views/collections/_show_recent.html.erb +++ b/apps/workbench/app/views/collections/_show_recent.html.erb @@ -6,11 +6,11 @@ - - - - + + + + diff --git a/apps/workbench/app/views/projects/_show_contents_rows.html.erb b/apps/workbench/app/views/projects/_show_contents_rows.html.erb index 638fe14859..2afbf3ffae 100644 --- a/apps/workbench/app/views/projects/_show_contents_rows.html.erb +++ b/apps/workbench/app/views/projects/_show_contents_rows.html.erb @@ -32,7 +32,8 @@ <% links_for_object(object).select{|link|link.link_class=='tag'}.each do |tag_link| %> - <%= link_to tag_link.name, controller: "links", filters: [["link_class", "=", "tag"], ["name", "=", tag_link.name]].to_json %> + <%# FIXME: link tag to search dialog or something # link_to tag_link.name, controller: "links", filters: [["link_class", "=", "tag"], ["name", "=", tag_link.name]].to_json %> + <%= tag_link.name %> <% if tag_link.owner_uuid == current_user.uuid or current_user.is_admin %>   -- 2.30.2