2872: Show collection details in chooser.
authorTom Clegg <tom@curoverse.com>
Mon, 2 Jun 2014 05:24:55 +0000 (01:24 -0400)
committerTom Clegg <tom@curoverse.com>
Mon, 2 Jun 2014 05:24:55 +0000 (01:24 -0400)
apps/workbench/app/controllers/application_controller.rb
apps/workbench/app/views/collections/_choose_rows.html.erb
apps/workbench/app/views/collections/_show_object_description_cell.html.erb

index 09419216b503be3c8c0ca6b64618ae515c903c00..c1e82eb621617f807187833827b2d7c0036a6c21 100644 (file)
@@ -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
index 86228306f56bf69e57a3bfcf94633b67b7e145e2..55e64515a4451cb4c6946e0f975eebbb1bb74f9c 100644 (file)
@@ -1,11 +1,15 @@
 <% @name_links.each do |name_link| %>
   <div class="row selectable <%= 'multiple' if multiple %>" data-object-uuid="<%= name_link.uuid %>">
-    <div class="col-sm-8" style="overflow-x:hidden">
+    <div class="col-lg-12" style="overflow-x:hidden">
       <i class="fa fa-fw fa-archive"></i>
       <%= name_link.name %>
     </div>
-    <div class="col-sm-4" style="overflow-x:hidden">
-      <%= link_to_if_arvados_object name_link.tail_uuid, friendly_name: true %>
+    <div class="col-lg-12 arv-description-in-table">
+      <%= render_controller_partial(
+          'show_object_description_cell.html',
+          controller_name: 'collections',
+          locals: {object: get_object(name_link.head_uuid)})
+          %>
     </div>
   </div>
 <% end %>
index 0b3352b7f37382a2d03ee0c29d24c6486cbf4f1b..1f1325dbbec22ec898c96e8e00bb646665b86d15 100644 (file)
@@ -1,9 +1,4 @@
 <div class="nowrap">
-  <div>
-    <% Link.filter([['link_class','=','tag'],['head_uuid','=',object.uuid]]).collect(&:name).each do |tagname| %>
-      <span class="label label-info"><%= tagname %></span>
-    <% end %>
-  </div>
   <span class="deemphasize">
     Files (<%= human_readable_bytes_html(object.total_bytes) %>):
   </span><span class="arvados-filename">
@@ -11,4 +6,9 @@
       <%= file %>
     <% end %>
   </span>
+  <div>
+    <% Link.filter([['link_class','=','tag'],['head_uuid','=',object.uuid]]).collect(&:name).each do |tagname| %>
+      <span class="label label-info"><%= tagname %></span>
+    <% end %>
+  </div>
 </div>