[ARVADOS] updated: c6210b84588721c1e337c7dd9a0e25edb14301bb

git at public.curoverse.com git at public.curoverse.com
Fri Aug 8 16:03:15 EDT 2014


Summary of changes:
 apps/workbench/app/controllers/collections_controller.rb   |  1 +
 apps/workbench/app/views/collections/_choose_rows.html.erb | 12 +++++++-----
 2 files changed, 8 insertions(+), 5 deletions(-)

       via  c6210b84588721c1e337c7dd9a0e25edb14301bb (commit)
      from  af2a757d9be739543a912547eaefcadc851109e1 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit c6210b84588721c1e337c7dd9a0e25edb14301bb
Author: Tom Clegg <tom at curoverse.com>
Date:   Fri Aug 8 15:58:53 2014 -0400

    Fix excessive API calls in collection chooser. refs #3489

diff --git a/apps/workbench/app/controllers/collections_controller.rb b/apps/workbench/app/controllers/collections_controller.rb
index fd78ddf..bea72a4 100644
--- a/apps/workbench/app/controllers/collections_controller.rb
+++ b/apps/workbench/app/controllers/collections_controller.rb
@@ -55,6 +55,7 @@ class CollectionsController < ApplicationController
 
     @objects = Collection.
       filter([['uuid','in', at name_links.collect(&:head_uuid)]])
+    preload_links_for_objects @objects.to_a
     super
   end
 
diff --git a/apps/workbench/app/views/collections/_choose_rows.html.erb b/apps/workbench/app/views/collections/_choose_rows.html.erb
index 5a019f8..8079eb4 100644
--- a/apps/workbench/app/views/collections/_choose_rows.html.erb
+++ b/apps/workbench/app/views/collections/_choose_rows.html.erb
@@ -3,11 +3,13 @@
     <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 %>
-    <% Link.filter([['link_class','=','tag'],['head_uuid','=',object.uuid]]).collect(&:name).each do |tagname| %>
-      <span class="label label-info"><%= tagname %></span>
-    <% end %>
+      <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>
   <% end %>
 <% end %>

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list