3627: "My Projects" is now called "Home" and is always selectable in choosers.
[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         <img src="/favicon.ico" class="pull-right" alt="" style="opacity: 0.3"/>
37         <% if defined? @same_pdh %>
38           <p>Found in collections:<p>
39           <p>
40             <% @same_pdh.each do |c| %>
41               <%= link_to_if_arvados_object get_object(c.owner_uuid), {:friendly_name => true} %> / <%= link_to_if_arvados_object c, {:friendly_name => true} %><br>
42             <% end %>
43           </p>
44         <% else %>
45           <p><i>Content hash:</i><br />
46             <span class="arvados-uuid"><%= link_to @object.portable_data_hash, collection_path(@object.portable_data_hash) %></span></p>
47         <% end %>
48         <%= render partial: "show_source_summary" %>
49       </div>
50     </div>
51   </div>
52   <div class="col-md-3">
53     <div class="panel panel-default">
54       <div class="panel-heading">
55         <h3 class="panel-title">
56           Activity
57         </h3>
58       </div>
59       <div class="panel-body smaller-text">
60         <!--
61         <input type="text" class="form-control" placeholder="Search"/>
62         -->
63         <div style="height:0.5em;"></div>
64         <% name_or_object = @name_link.andand.uuid ? @name_link : @object %>
65         <% if name_or_object.created_at and not @logs.andand.any? %>
66           <p>
67             Created: <%= name_or_object.created_at.to_s(:long) if name_or_object.created_at %>
68           </p>
69           <p>
70             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 %>
71           </p>
72         <% else %>
73           <%= render_arvados_object_list_start(@logs, 'Show all activity',
74                 logs_path(filters: [['object_uuid','=',name_or_object.uuid]].to_json)) do |log| %>
75           <p>
76           <%= time_ago_in_words(log.event_at) rescue 'unknown time' %> ago: <%= log.summary %>
77             <% if log.object_uuid %>
78             <%= link_to_if_arvados_object log.object_uuid, link_text: raw('<i class="fa fa-hand-o-right"></i>') %>
79             <% end %>
80           </p>
81           <% end %>
82         <% end %>
83       </div>
84     </div>
85   </div>
86   <div class="col-md-3">
87     <div class="panel panel-default">
88       <div class="panel-heading">
89         <h3 class="panel-title">
90           Sharing and permissions
91         </h3>
92       </div>
93       <div class="panel-body">
94         <!--
95         <input type="text" class="form-control" placeholder="Search"/>
96         -->
97
98         <div id="sharing-button">
99           <%= render partial: 'sharing_button' %>
100         </div>
101
102         <div style="height:0.5em;"></div>
103         <% if @projects.andand.any? %>
104           <p>Included in projects:<br />
105           <%= render_arvados_object_list_start(@projects, 'Show all projects',
106                 links_path(filters: [['head_uuid', '=', @object.uuid],
107                                      ['link_class', '=', 'name']].to_json)) do |project| %>
108             <%= link_to_if_arvados_object(project, friendly_name: true) %><br />
109           <% end %>
110           </p>
111         <% end %>
112         <% if @permissions.andand.any? %>
113           <p>Readable by:<br />
114           <%= render_arvados_object_list_start(@permissions, 'Show all permissions',
115                 links_path(filters: [['head_uuid', '=', @object.uuid],
116                                     ['link_class', '=', 'permission']].to_json)) do |link| %>
117           <%= link_to_if_arvados_object(link.tail_uuid, friendly_name: true) %><br />
118           <% end %>
119           </p>
120         <% end %>
121
122       </div>
123     </div>
124   </div>
125 </div>
126
127 <%= render file: 'application/show.html.erb', locals: local_assigns %>