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