2872: Rearrange folder index. Show collection tags and files in folder view.
[arvados.git] / apps / workbench / app / views / folders / _show_contents.html.erb
1 <% content_for :content_top do %>
2
3 <h2>
4   <%= render_editable_attribute @object, 'name', nil, { 'data-emptytext' => "New folder" } %>
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 @objects_and_names.empty? %>
15     <%= button_to(folder_path(id: @object.uuid, return_to: folders_path), method: 'delete', class: 'btn btn-sm btn-primary', data: {confirm: "Really delete folder '#{@object.name}'?"}) do %>
16       <i class="fa fa-fw fa-trash-o"></i> Delete folder
17     <% end %>
18   <% end %>
19 <% end %>
20
21 <div class="container-fluid">
22   <div class="row">
23     <div class="col-md-4">
24       <% if @object.editable? %>
25         <%= link_to(
26               choose_collections_path(
27                 title: 'Add data to folder:',
28                 multiple: true,
29                 action_name: 'Add',
30                 action_href: actions_path(id: @object.uuid),
31                 action_method: 'post',
32                 action_data: {selection_param: 'selection[]', copy_selections_into_folder: @object.uuid, success: 'page-refresh'}.to_json),
33               { class: "btn btn-primary btn-sm", remote: true, method: 'get', data: {'event-after-select' => 'page-refresh'} }) do %>
34           <i class="fa fa-fw fa-plus"></i> Add data
35         <% end %>
36         <%= link_to(
37               choose_pipeline_templates_path(
38                 title: 'Choose a pipeline to run:',
39                 action_name: 'Configure...',
40                 action_href: pipeline_instances_path,
41                 action_method: 'post',
42                 action_data: {'selection_param' => 'pipeline_instance[pipeline_template_uuid]', 'pipeline_instance[owner_uuid]' => @object.uuid, 'success' => 'redirect-to-created-object'}.to_json),
43               { class: "btn btn-primary btn-sm", remote: true, method: 'get' }) do %>
44           <i class="fa fa-fw fa-gear"></i> Run a pipeline
45         <% end %>
46       <% end %>
47     </div>
48     <div class="col-md-4">
49       <form class="form-inline" role="form">
50         Show:
51         <select class="form-control" data-filter-rows-by="data-kind" data-filter-target="table.arv-index.arv-folder-contents tbody">
52           <option value="">Everything</option>
53           <option value="arvados#collection">Data</option>
54           <option value="arvados#pipelineInstance arvados#job">Compute jobs</option>
55           <option value="arvados#pipelineTemplate">Pipelines</option>
56           <!--
57           <option value="arvados#specimen">Specimens</option>
58           <option value="arvados#human">Humans</option>
59           <option value="arvados#trait">Traits</option>
60           -->
61         </select>
62       </form>
63     </div>
64     <div class="col-md-4">
65       <input type="text" class="form-control search-folder-contents" placeholder="Search folder contents" data-search-target=".arv-index.arv-folder-contents"/>
66     </div>
67   </div>
68 </div>
69
70 <table class="table table-condensed table-fixedlayout arv-index arv-folder-contents" style="overflow-x: hidden">
71   <colgroup>
72     <col width="40%" />
73     <col width="60%" />
74   </colgroup>
75   <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 %>">
76     <%= render partial: 'show_contents_rows', locals: {folder: @object, objects_and_names: @objects_and_names} %>
77   </tbody>
78   <thead>
79     <tr>
80       <th>
81       </th>
82       <th>
83         description
84       </th>
85     </tr>
86   </thead>
87 </table>