Merge branch '8784-dir-listings'
[arvados.git] / apps / workbench / app / views / projects / show.html.erb
1 <%# Copyright (C) The Arvados Authors. All rights reserved.
2
3 SPDX-License-Identifier: AGPL-3.0 %>
4
5 <% content_for :content_top do %>
6   <h2>
7     <% if @object.uuid == current_user.andand.uuid %>
8       Home
9     <% else %>
10       <%= render partial: "show_star" %>
11       <%= render_editable_attribute @object, 'name', nil, { 'data-emptytext' => "New project" } %>
12     <% end %>
13   </h2>
14 <% end %>
15
16 <%
17   if !PipelineInstance.api_exists?(:index)
18     run_proc_title = 'Choose a workflow to run:'
19     run_proc_hover = 'Run a workflow in this project'
20   else
21     run_proc_title = 'Choose a pipeline or workflow to run:'
22     run_proc_hover = 'Run a pipeline or workflow in this project'
23   end
24 %>
25
26 <% content_for :tab_line_buttons do %>
27   <% if @object.editable? %>
28     <div class="btn-group btn-group-sm">
29       <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown"><i class="fa fa-fw fa-plus"></i> Add data <span class="caret"></span></button>
30       <ul class="dropdown-menu pull-right" role="menu">
31         <li>
32           <%= link_to(
33                 choose_collections_path(
34                   title: 'Choose a collection to copy into this project:',
35                   multiple: true,
36                   action_name: 'Copy',
37                   action_href: actions_path(id: @object.uuid),
38                   action_method: 'post',
39                   action_data: {selection_param: 'selection[]', copy_selections_into_project: @object.uuid, success: 'page-refresh'}.to_json),
40                 { remote: true, data: {'event-after-select' => 'page-refresh', 'toggle' => 'dropdown'} }) do %>
41             <i class="fa fa-fw fa-clipboard"></i> Copy data from another project
42           <% end %>
43         </li>
44         <li>
45           <%= link_to(collections_path(options: {ensure_unique_name: true}, collection: {manifest_text: "", name: "New collection", owner_uuid: @object.uuid}, redirect_to_anchor: 'Upload'), {
46               method: 'post',
47               data: {toggle: 'dropdown'}}) do %>
48             <i class="fa fa-fw fa-upload"></i> Upload files from my computer
49           <% end %>
50         </li>
51       </ul>
52     </div>
53     <%= link_to(
54           choose_work_unit_templates_path(
55             title: run_proc_title,
56             action_name: 'Next: choose inputs <i class="fa fa-fw fa-arrow-circle-right"></i>',
57             action_href: work_units_path,
58             action_method: 'post',
59             action_data: {'selection_param' => 'work_unit[template_uuid]', 'work_unit[owner_uuid]' => @object.uuid, 'success' => 'redirect-to-created-object'}.to_json),
60           { class: "btn btn-primary btn-sm", remote: true, title: run_proc_hover }) do %>
61       <i class="fa fa-fw fa-gear"></i> Run a process...
62     <% end %>
63     <%= link_to projects_path({'project[owner_uuid]' => @object.uuid, 'options' => {'ensure_unique_name' => true}}), method: :post, title: "Add a subproject to this project", class: 'btn btn-sm btn-primary' do %>
64       <i class="fa fa-fw fa-plus"></i>
65       Add a subproject
66     <% end %>
67   <% end %>
68 <% end %>
69
70 <%= render file: 'application/show.html.erb', locals: local_assigns %>