Merge branch '8784-dir-listings'
[arvados.git] / apps / workbench / app / views / collections / _show_source_summary.html.erb
1 <%# Copyright (C) The Arvados Authors. All rights reserved.
2
3 SPDX-License-Identifier: AGPL-3.0 %>
4
5 <p><i>Content size:</i><br />
6   <%= pluralize(@object.manifest.files_count, "file") %> totalling
7   <%= raw(human_readable_bytes_html(@object.manifest.files_size)) %></p>
8
9 <% if not (@output_of.andand.any? or @log_of.andand.any?) %>
10   <p><i>No source information available.</i></p>
11 <% end %>
12
13 <% if @output_of.andand.any? %>
14   <% pipelines = PipelineInstance.limit(5).filter([["components", "like", "%#{@object.uuid}%"]]) %>
15   <%
16     message = "This collection was the output of the following:"
17     if pipelines.items_available > pipelines.results.size
18       message += ' (' + (pipelines.items_available - pipelines.results.size).to_s + ' more results are not shown)'
19     end
20   %>
21   <p><i><%= message %></i><br />
22     <% pipelines.each do |pipeline| %>
23       <% pipeline.components.each do |cname, c| %>
24         <% if c[:output_uuid] == @object.uuid %>
25           <b><%= cname %></b> component of <b><%= link_to_if_arvados_object(pipeline, friendly_name: true) %></b>
26           <% if c.andand[:job].andand[:finished_at] %>
27             finished at <%= render_localized_date(c[:job][:finished_at]) %>
28           <% end %>
29           <br>
30         <% end %>
31       <% end %>
32     <% end %>
33   </p>
34 <% end %>
35
36 <% if @log_of.andand.any? %>
37   <p><i>This collection contains log messages from:</i><br />
38     <%= render_arvados_object_list_start(@log_of, 'Show all jobs',
39                                          jobs_path(filters: [['log', '=', @object.portable_data_hash]].to_json)) do |job| %>
40       <%= link_to_if_arvados_object(job, friendly_name: true) %><br />
41     <% end %>
42   </p>
43 <% end %>