2961: Fixed name of collection on collection show page to fix test.
authorPeter Amstutz <peter.amstutz@curoverse.com>
Tue, 10 Jun 2014 17:22:48 +0000 (13:22 -0400)
committerPeter Amstutz <peter.amstutz@curoverse.com>
Tue, 10 Jun 2014 17:22:48 +0000 (13:22 -0400)
apps/workbench/app/controllers/collections_controller.rb
apps/workbench/app/views/collections/show.html.erb

index 064acc689babe5a39db7b3d2ce23cf8e36a05c9d..6a5df8754ff9b69147e8f4669dba7f70df8a4d73 100644 (file)
@@ -143,10 +143,10 @@ class CollectionsController < ApplicationController
       end
       @output_of = jobs_with.call(output: @object.uuid)
       @log_of = jobs_with.call(log: @object.uuid)
-      folder_links = Link.limit(RELATION_LIMIT).order("modified_at DESC")
+      @folder_links = Link.limit(RELATION_LIMIT).order("modified_at DESC")
         .where(head_uuid: @object.uuid, link_class: 'name').results
-      folder_hash = Group.where(uuid: folder_links.map(&:tail_uuid)).to_hash
-      @folders = folder_links.map { |link| folder_hash[link.tail_uuid] }
+      folder_hash = Group.where(uuid: @folder_links.map(&:tail_uuid)).to_hash
+      @folders = @folder_links.map { |link| folder_hash[link.tail_uuid] }
       @permissions = Link.limit(RELATION_LIMIT).order("modified_at DESC")
         .where(head_uuid: @object.uuid, link_class: 'permission',
                name: 'can_read').results
index 440d2ff40e4a1fcae8cf244101fa92b5cb52f0a6..710388d643d17099e99d2697caace53f57ead368 100644 (file)
@@ -3,7 +3,12 @@
     <div class="panel panel-info">
       <div class="panel-heading">
        <h3 class="panel-title">
-          <% "Collection #{@object.uuid}" %>
+          <% i = 0 %>
+            <% @folder_links.each do |l| %>
+              <%= if i > 0 then ', ' end %>
+              <% i += 1 %>
+              <%= l.name %>
+            <% end %>
        </h3>
       </div>
       <div class="panel-body">