Merge branch 'master' into 3338-tab-counts
[arvados.git] / apps / workbench / app / views / collections / show.html.erb
1 <% content_for :tab_line_buttons do %>
2   <%= link_to(
3       choose_projects_path(
4        title: 'Copy to project...',
5        action_name: 'Copy',
6        action_href: actions_path,
7        action_method: 'post',
8        action_data: {
9          copy_selections_into_project: true,
10          selection: @name_link.andand.uuid || @object.uuid,
11          selection_param: 'uuid',
12          success: 'redirect-to-created-object'
13        }.to_json),
14       { class: "btn btn-sm btn-primary arv-move-to-project", remote: true, method: 'get' }) do %>
15     <i class="fa fa-fw fa-copy"></i> Copy to project...
16   <% end %>
17 <% end %>
18
19 <div class="row row-fill-height">
20   <div class="col-md-6">
21     <div class="panel panel-info">
22       <div class="panel-heading">
23         <h3 class="panel-title">
24           <% if @name_link.nil? and @object.uuid.match /[0-9a-f]{32}/ %>
25             Content hash <%= @object.portable_data_hash %>
26           <% else %>
27             <%= if @object.respond_to? :name
28                   render_editable_attribute @object, :name
29                 else
30                   @name_link.andand.name || @object.uuid
31                 end %>
32             <% end %>
33         </h3>
34       </div>
35       <div class="panel-body">
36         <div class="arv-description-as-subtitle">
37           <%= render_editable_attribute @object, 'description', nil, { 'data-emptytext' => "(No description provided)", 'data-toggle' => 'manual' } %>
38         </div>
39         <img src="/favicon.ico" class="pull-right" alt="" style="opacity: 0.3"/>
40         <% if defined? @same_pdh %>
41           <p>Found in collections:<p>
42           <p>
43             <% @same_pdh.each do |c| %>
44               <%= link_to_if_arvados_object get_object(c.owner_uuid), {:friendly_name => true} %> / <%= link_to_if_arvados_object c, {:friendly_name => true} %><br>
45             <% end %>
46           </p>
47         <% else %>
48           <p><i>Content hash:</i><br />
49             <span class="arvados-uuid"><%= link_to @object.portable_data_hash, collection_path(@object.portable_data_hash) %></span></p>
50         <% end %>
51         <%= render partial: "show_source_summary" %>
52       </div>
53     </div>
54   </div>
55   <div class="col-md-3">
56     <div class="panel panel-default">
57       <div class="panel-heading">
58         <h3 class="panel-title">
59           Activity
60         </h3>
61       </div>
62       <div class="panel-body smaller-text">
63         <!--
64         <input type="text" class="form-control" placeholder="Search"/>
65         -->
66         <div style="height:0.5em;"></div>
67         <% name_or_object = @name_link.andand.uuid ? @name_link : @object %>
68         <% if name_or_object.created_at and not @logs.andand.any? %>
69           <p>
70             Created: <%= name_or_object.created_at.to_s(:long) if name_or_object.created_at %>
71           </p>
72           <p>
73             Last modified: <%= name_or_object.modified_at.to_s(:long) if name_or_object.modified_at %> by <%= link_to_if_arvados_object name_or_object.modified_by_user_uuid, friendly_name: true %>
74           </p>
75         <% else %>
76           <%= render_arvados_object_list_start(@logs, 'Show all activity',
77                 logs_path(filters: [['object_uuid','=',name_or_object.uuid]].to_json)) do |log| %>
78           <p>
79           <%= time_ago_in_words(log.event_at) rescue 'unknown time' %> ago: <%= log.summary %>
80             <% if log.object_uuid %>
81             <%= link_to_if_arvados_object log.object_uuid, link_text: raw('<i class="fa fa-hand-o-right"></i>') %>
82             <% end %>
83           </p>
84           <% end %>
85         <% end %>
86       </div>
87     </div>
88   </div>
89   <div class="col-md-3">
90     <div class="panel panel-default">
91       <div class="panel-heading">
92         <h3 class="panel-title">
93           Sharing and permissions
94         </h3>
95       </div>
96       <div class="panel-body">
97         <!--
98         <input type="text" class="form-control" placeholder="Search"/>
99         -->
100
101         <div id="sharing-button">
102           <%= render partial: 'sharing_button' %>
103         </div>
104
105         <div style="height:0.5em;"></div>
106         <% if @projects.andand.any? %>
107           <p>Included in projects:<br />
108           <%= render_arvados_object_list_start(@projects, 'Show all projects',
109                 links_path(filters: [['head_uuid', '=', @object.uuid],
110                                      ['link_class', '=', 'name']].to_json)) do |project| %>
111             <%= link_to_if_arvados_object(project, friendly_name: true) %><br />
112           <% end %>
113           </p>
114         <% end %>
115         <% if @permissions.andand.any? %>
116           <p>Readable by:<br />
117           <%= render_arvados_object_list_start(@permissions, 'Show all permissions',
118                 links_path(filters: [['head_uuid', '=', @object.uuid],
119                                     ['link_class', '=', 'permission']].to_json)) do |link| %>
120           <%= link_to_if_arvados_object(link.tail_uuid, friendly_name: true) %><br />
121           <% end %>
122           </p>
123         <% end %>
124
125       </div>
126     </div>
127   </div>
128 </div>
129
130 <%= render file: 'application/show.html.erb', locals: local_assigns %>