Merge branch 'master' into 5374-hide-collection-checkboxes-anonymous
[arvados.git] / apps / workbench / app / views / projects / show.html.erb
1 <% content_for :content_top do %>
2   <h2>
3     <% if @object.uuid == current_user.andand.uuid %>
4       Home
5     <% else %>
6       <%= render_editable_attribute @object, 'name', nil, { 'data-emptytext' => "New project" } %>
7     <% end %>
8   </h2>
9 <% end %>
10
11 <% content_for :tab_line_buttons do %>
12   <% if @object.editable? %>
13     <div class="btn-group btn-group-sm">
14       <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>
15       <ul class="dropdown-menu pull-right" role="menu">
16         <li>
17           <%= link_to(
18                 choose_collections_path(
19                   title: 'Choose a collection to copy into this project:',
20                   multiple: true,
21                   action_name: 'Copy',
22                   action_href: actions_path(id: @object.uuid),
23                   action_method: 'post',
24                   action_data: {selection_param: 'selection[]', copy_selections_into_project: @object.uuid, success: 'page-refresh'}.to_json),
25                 { remote: true, data: {'event-after-select' => 'page-refresh', 'toggle' => 'dropdown'} }) do %>
26             <i class="fa fa-fw fa-clipboard"></i> Copy data from another project
27           <% end %>
28         </li>
29         <li>
30           <%= link_to(collections_path(options: {ensure_unique_name: true}, collection: {manifest_text: "", name: "New collection", owner_uuid: @object.uuid}, redirect_to_anchor: 'Upload'), {
31               method: 'post',
32               data: {toggle: 'dropdown'}}) do %>
33             <i class="fa fa-fw fa-upload"></i> Upload files from my computer
34           <% end %>
35         </li>
36       </ul>
37     </div>
38     <%= link_to(
39           choose_pipeline_templates_path(
40             title: 'Choose a pipeline to run:',
41             action_name: 'Next: choose inputs <i class="fa fa-fw fa-arrow-circle-right"></i>',
42             action_href: pipeline_instances_path,
43             action_method: 'post',
44             action_data: {'selection_param' => 'pipeline_instance[pipeline_template_uuid]', 'pipeline_instance[owner_uuid]' => @object.uuid, 'success' => 'redirect-to-created-object'}.to_json),
45           { class: "btn btn-primary btn-sm", remote: true, title: "Run a pipeline in this project" }) do %>
46       <i class="fa fa-fw fa-gear"></i> Run a pipeline...
47     <% end %>
48     <%= 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 %>
49       <i class="fa fa-fw fa-plus"></i>
50       Add a subproject
51     <% end %>
52   <% end %>
53 <% end %>
54
55 <%= render file: 'application/show.html.erb', locals: local_assigns %>