Merge branch 'master' into 5675-project-subprojects-in-anonymous-view
[arvados.git] / apps / workbench / app / views / pipeline_instances / _running_component.html.erb
index 90238bfd6c707e08f378b11b94642009b15b1250..1a9cb3562afac89b3f615156af5c193851dc9c71 100644 (file)
             <%# column offset 8 %>
             <div class="col-md-4 text-overflow-ellipsis">
               <% if pj[:output_uuid] %>
-                <% output = Collection.find?(pj[:output_uuid]) %>
-                <% if output %>
-                  <%= link_to_if_arvados_object pj[:output_uuid], friendly_name: true %>
-                <% else %>
-                  Output data not available
-                <% end %>
+                <%= link_to_arvados_object_if_readable(pj[:output_uuid], 'Output data not available', friendly_name: true) %>
               <% elsif current_job[:output] %>
-                <% output = Collection.find?(current_job[:output]) %>
-                <% if output %>
-                  <%= link_to_if_arvados_object current_job[:output], link_text: "Output of #{pj[:name]}" %>
-                <% else %>
-                  Output data not available
-                <% end %>
+                <%= link_to_arvados_object_if_readable(current_job[:output], 'Output data not available', link_text: "Output of #{pj[:name]}") %>
               <% else %>
                 No output.
               <% end %>
                     docker_image_locator:
                   </td>
                   <td>
-                    <%= link_to_if_arvados_object current_component[:docker_image_locator], friendly_name: true %>
+                    <%= link_to_arvados_object_if_readable(current_component[:docker_image_locator],
+                      current_component[:docker_image_locator], friendly_name: true) %>
                   </td>
                 </tr>
               <% else %>
                   </td>
                   <td>
                     <% if k == :uuid %>
-                      <% if !current_user and (resource_class_for_uuid(current_component[k]).andand.to_s == 'Job') %>
-                        <% if Job.find?(current_component[k]) %>
-                          <%= link_to_if_arvados_object current_component[k], link_text: current_component[k] %>
-                        <% else %>
-                          <%= current_component[k] %>
-                        <% end %>
-                      <% end %>
+                      <%= link_to_arvados_object_if_readable(current_component[k], current_component[k], link_text: current_component[k]) %>
                     <% elsif k.to_s.end_with? 'uuid' %>
-                      <%= link_to_if_arvados_object current_component[k], friendly_name: true %>
+                      <%= link_to_arvados_object_if_readable(current_component[k], current_component[k], friendly_name: true) %>
                     <% elsif k.to_s.end_with? '_at' %>
                       <%= render_localized_date(current_component[k]) %>
                     <% else %>