3499: Merge branch 'master' into 3499-home-project
[arvados.git] / apps / workbench / app / views / projects / _show_data_collections.html.erb
1 <% if @object.uuid != current_user.uuid # Not the "Home" project %>
2 <% content_for :content_top do %>
3
4 <h2>
5   <%= render_editable_attribute @object, 'name', nil, { 'data-emptytext' => "New project" } %>
6 </h2>
7
8 <div class="arv-description-as-subtitle">
9   <%= render_editable_attribute @object, 'description', nil, { 'data-emptytext' => "(No description provided)", 'data-toggle' => 'manual' } %>
10 </div>
11
12 <% end %>
13 <% end %>
14
15 <% content_for :tab_line_buttons do %>
16   <% if @object.editable? %>
17     <%= link_to(
18           choose_collections_path(
19             title: 'Add data to project:',
20             multiple: true,
21             action_name: 'Add',
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           { class: "btn btn-primary btn-sm", remote: true, method: 'get', data: {'event-after-select' => 'page-refresh'} }) do %>
26       <i class="fa fa-fw fa-plus"></i> Add data...
27     <% end %>
28     <%= link_to(
29           choose_pipeline_templates_path(
30             title: 'Choose a pipeline to run:',
31             action_name: 'Next: choose inputs <i class="fa fa-fw fa-arrow-circle-right"></i>',
32             action_href: pipeline_instances_path,
33             action_method: 'post',
34             action_data: {'selection_param' => 'pipeline_instance[pipeline_template_uuid]', 'pipeline_instance[owner_uuid]' => @object.uuid, 'success' => 'redirect-to-created-object'}.to_json),
35           { class: "btn btn-primary btn-sm", remote: true, method: 'get' }) do %>
36       <i class="fa fa-fw fa-gear"></i> Run a pipeline...
37     <% end %>
38     <%= link_to projects_path('project[owner_uuid]' => @object.uuid), method: 'post', class: 'btn btn-sm btn-primary' do %>
39       <i class="fa fa-fw fa-plus"></i>
40       Add a subproject
41     <% end %>
42     <%= link_to(
43         choose_projects_path(
44          title: 'Move this project to...',
45          editable: true,
46          my_root_selectable: true,
47          action_name: 'Move',
48          action_href: project_path(@object.uuid),
49          action_method: 'put',
50          action_data: {selection_param: 'project[owner_uuid]', success: 'page-refresh'}.to_json),
51         { class: "btn btn-sm btn-primary arv-move-to-project", remote: true, method: 'get' }) do %>
52       <i class="fa fa-fw fa-truck"></i> Move project...
53     <% end %>
54     <%= link_to(project_path(id: @object.uuid), method: 'delete', class: 'btn btn-sm btn-primary', data: {confirm: "Really delete project '#{@object.name}'?"}) do %>
55       <i class="fa fa-fw fa-trash-o"></i> Delete project
56     <% end %>
57   <% end %>
58 <% end %>
59
60 <% 
61   filters = [['uuid', 'is_a', "arvados#collection"]]
62   @objects = @object.contents({limit: 50, include_linked: true, :filters => filters})
63   objects_and_names = get_objects_and_names @objects
64   page_offset = next_page_offset @objects
65 %>
66
67 <%= render partial: 'show_tab_contents', locals: {project: @object, objects_and_names: objects_and_names, filters: filters, page_offset: page_offset, tab_name: 'Data_collections'} %>