3201: Simplify logic to decide "My Projects" is selectable.
[arvados.git] / apps / workbench / app / views / projects / _show_contents.html.erb
1 <% content_for :content_top do %>
2
3 <h2>
4   <%= render_editable_attribute @object, 'name', nil, { 'data-emptytext' => "New project" } %>
5 </h2>
6
7 <div class="arv-description-as-subtitle">
8   <%= render_editable_attribute @object, 'description', nil, { 'data-emptytext' => "(No description provided)", 'data-toggle' => 'manual' } %>
9 </div>
10
11 <% end %>
12
13 <% content_for :tab_line_buttons do %>
14   <% if @object.editable? %>
15     <%= link_to(
16           choose_collections_path(
17             title: 'Add data to project:',
18             multiple: true,
19             action_name: 'Add',
20             action_href: actions_path(id: @object.uuid),
21             action_method: 'post',
22             action_data: {selection_param: 'selection[]', copy_selections_into_project: @object.uuid, success: 'page-refresh'}.to_json),
23           { class: "btn btn-primary btn-sm", remote: true, method: 'get', data: {'event-after-select' => 'page-refresh'} }) do %>
24       <i class="fa fa-fw fa-plus"></i> Add data...
25     <% end %>
26     <%= link_to(
27           choose_pipeline_templates_path(
28             title: 'Choose a pipeline to run:',
29             action_name: 'Next: choose inputs <i class="fa fa-fw fa-arrow-circle-right"></i>',
30             action_href: pipeline_instances_path,
31             action_method: 'post',
32             action_data: {'selection_param' => 'pipeline_instance[pipeline_template_uuid]', 'pipeline_instance[owner_uuid]' => @object.uuid, 'success' => 'redirect-to-created-object'}.to_json),
33           { class: "btn btn-primary btn-sm", remote: true, method: 'get' }) do %>
34       <i class="fa fa-fw fa-gear"></i> Run a pipeline...
35     <% end %>
36     <%= link_to projects_path('project[owner_uuid]' => @object.uuid), method: 'post', class: 'btn btn-sm btn-primary' do %>
37       <i class="fa fa-fw fa-plus"></i>
38       Add a subproject
39     <% end %>
40     <%= link_to(
41         choose_projects_path(
42          title: 'Move this project to...',
43          editable: true,
44          my_root_selectable: true,
45          action_name: 'Move',
46          action_href: project_path(@object.uuid),
47          action_method: 'put',
48          action_data: {selection_param: 'project[owner_uuid]', success: 'page-refresh'}.to_json),
49         { class: "btn btn-sm btn-primary arv-move-to-project", remote: true, method: 'get' }) do %>
50       <i class="fa fa-fw fa-truck"></i> Move project...
51     <% end %>
52     <%= link_to(project_path(id: @object.uuid), method: 'delete', class: 'btn btn-sm btn-primary', data: {confirm: "Really delete project '#{@object.name}'?"}) do %>
53       <i class="fa fa-fw fa-trash-o"></i> Delete project
54     <% end %>
55   <% end %>
56 <% end %>
57
58 <div class="selection-action-container">
59   <div class="row">
60     <div class="col-sm-5">
61       <div class="btn-group btn-group-sm">
62         <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">Selection...</button>
63         <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
64           <span class="caret"></span>
65           <span class="sr-only">Toggle Dropdown</span>
66         </button>
67         <ul class="dropdown-menu" role="menu">
68           <li><%= link_to "Compare selected", '#',
69                   'data-href' => compare_pipeline_instances_path,
70                   'data-selection-param-name' => 'uuids[]',
71                   'data-selection-action' => 'compare'
72             %></li>
73           <li><%= link_to "Remove selected", '#',
74                   'data-href' => url_for(action: :remove_items),
75                   'data-selection-param-name' => 'item_uuids[]',
76                   'data-selection-action' => 'remove',
77                   'data-remote' => true,
78                   'method' => 'delete'
79             %></li>
80         </ul>
81       </div>
82     </div>
83     <div class="col-sm-3">
84       <form class="form-inline" role="form">
85         Show:
86         <select class="form-control form-control-sm filterable-control" data-filterable-attribute="data-kind" data-filterable-target="table.arv-index.arv-project-contents tbody">
87           <option value="">Everything</option>
88           <option value="arvados#collection">Data</option>
89           <option value="arvados#pipelineInstance arvados#job">Compute jobs</option>
90           <option value="arvados#pipelineTemplate">Pipelines</option>
91           <!--
92           <option value="arvados#specimen">Specimens</option>
93           <option value="arvados#human">Humans</option>
94           <option value="arvados#trait">Traits</option>
95           -->
96         </select>
97       </form>
98     </div>
99     <div class="col-sm-4">
100       <input type="text" class="form-control filterable-control" placeholder="Search project contents" data-filterable-target="table.arv-index.arv-project-contents tbody"/>
101     </div>
102   </div>
103
104   <table class="table table-condensed table-fixedlayout arv-index arv-project-contents" style="overflow-x: hidden">
105     <colgroup>
106       <col width="40%" />
107       <col width="60%" />
108     </colgroup>
109     <tbody data-infinite-scroller="#Contents-scroll" data-infinite-content-href="<%= url_for(format: :json, partial: :contents_rows, offset: next_page_offset) if next_page_offset %>">
110       <%= render partial: 'show_contents_rows', locals: {project: @object, objects_and_names: @objects_and_names} %>
111     </tbody>
112     <thead>
113       <tr>
114         <th>
115         </th>
116         <th>
117           description
118         </th>
119       </tr>
120     </thead>
121   </table>
122
123 </div>