9318: remove :output method in favor of :outputs method and correct the logic for...
[arvados.git] / apps / workbench / app / views / work_unit / _component_detail.html.erb
index 38e1b5ba30d1ea5de837e910813c7a190d16bec9..9ef16d00a8c459f34ac30b8fc93696f2a12c413b 100644 (file)
@@ -5,7 +5,9 @@
               No <%= current_obj.title %> has been submitted yet.
             <% else %>
             <table>
-              <% [:uuid, :modified_by_user_uuid, :created_at, :started_at, :finished_at, :output, :priority].each do |k| %>
+              <% keys = [:uuid, :modified_by_user_uuid, :created_at, :started_at, :finished_at, :priority] %>
+              <% keys << :outputs if @object.uuid == current_obj.uuid %>
+              <% keys.each do |k| %>
                 <% val = current_obj.send(k) if current_obj.respond_to?(k) %>
                 <% if val %>
                 <tr>
                       <%= link_to_arvados_object_if_readable(val, val, friendly_name: true) %>
                     <% elsif k.to_s.end_with? '_at' %>
                       <%= render_localized_date(val) %>
-                    <% elsif k == :output %>
-                      <%= link_to_arvados_object_if_readable(val, 'Output data not available', friendly_name: true) %>
+                    <% elsif k == :outputs and val.any? %>
+                      <% if val.size == 1 %>
+                        <%= link_to_arvados_object_if_readable(val[0], 'Output data not available', friendly_name: true) %>
+                      <% else %>
+                        <%= render partial: 'work_unit/show_outputs', locals: {id: current_obj.uuid, outputs: val, align:""} %>
+                      <% end %>
                     <% else %>
                       <%= val %>
                     <% end %>