Merge branch 'master' into 3618-column-ordering
[arvados.git] / apps / workbench / app / views / projects / _show_tab_contents.html.erb
1 <% order = nil if local_assigns[:order].nil? %>
2 <% sortable_columns = {} if local_assigns[:sortable_columns].nil? %>
3 <div class="selection-action-container">
4   <div class="row">
5     <div class="col-sm-5">
6       <div class="btn-group btn-group-sm">
7         <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">Selection... <span class="caret"></span></button>
8         <ul class="dropdown-menu" role="menu">
9           <li><%= link_to "Create new collection with selected collections", '#',
10                   'data-href' => combine_selected_path(
11                     action_data: {current_project_uuid: @object.uuid}.to_json
12                   ),
13                   'id' => 'combine_selections_button',
14                   'data-selection-param-name' => 'selection[]',
15                   'data-selection-action' => 'combine-project-contents',
16                   'method' => 'post',
17                   'data-toggle' => 'dropdown'
18             %></li>
19           <li><%= link_to "Compare selected", 'action',
20                   'data-href' => compare_pipeline_instances_path,
21                   'data-selection-param-name' => 'uuids[]',
22                   'data-selection-action' => 'compare'
23             %></li>
24           <li><%= link_to "Copy selected", '#',
25                   'data-href' => choose_projects_path(
26                     title: 'Copy selected items to...',
27                     editable: true,
28                     action_name: 'Copy',
29                     action_href: actions_path,
30                     action_method: 'post',
31                     action_data_from_params: ['selection'],
32                     action_data: {
33                       copy_selections_into_project: true,
34                       selection_param: 'uuid',
35                       success: 'page-refresh'}.to_json),
36                   'data-remote' => true,
37                   'data-selection-param-name' => 'selection[]',
38                   'data-selection-action' => 'copy'
39             %></li>
40           <li><%= link_to "Move selected", '#',
41                   'data-href' => choose_projects_path(
42                     title: 'Move selected items to...',
43                     editable: true,
44                     action_name: 'Move',
45                     action_href: actions_path,
46                     action_method: 'post',
47                     action_data_from_params: ['selection'],
48                     action_data: {
49                       move_selections_into_project: true,
50                       selection_param: 'uuid',
51                       success: 'page-refresh'}.to_json),
52                   'data-remote' => true,
53                   'data-selection-param-name' => 'selection[]',
54                   'data-selection-action' => 'move'
55             %></li>
56           <li><%= link_to "Remove selected", '#',
57                   'data-href' => url_for(action: :remove_items),
58                   'data-selection-param-name' => 'item_uuids[]',
59                   'data-selection-action' => 'remove',
60                   'data-remote' => true,
61                   'method' => 'delete',
62                   'data-toggle' => 'dropdown'
63             %></li>
64         </ul>
65       </div>
66     </div>
67     <div class="col-sm-4 pull-right">
68       <input type="text" class="form-control filterable-control" placeholder="Search project contents" data-filterable-target="table.arv-index.arv-project-<%= tab_pane %> tbody"/>
69     </div>
70   </div>
71
72   <table class="table table-condensed arv-index arv-project-<%= tab_pane %>">
73     <colgroup>
74       <col width="0*" style="max-width: fit-content;" />
75       <col width="0*" style="max-width: fit-content;" />
76       <col width="0*" style="max-width: fit-content;" />
77       <col width="60%" style="width: 60%;" />
78       <col width="40%" style="width: 40%;" />
79     </colgroup>
80     <tbody data-infinite-scroller="#<%= tab_pane %>-scroll" data-infinite-content-href="<%= url_for partial: :contents_rows %>" data-infinite-content-params-projecttab="<%= {filters: filters, order: order}.to_json %>" data-infinite-content-params-attr="projecttab">
81     </tbody>
82     <thead>
83       <tr>
84         <th></th>
85         <th></th>
86         <th></th>
87         <% sort_order = sortable_columns['name'].gsub(/\s/,'') %>
88         <th <% if !sort_order.nil? %>
89               data-sort-order='<%= sort_order %>'
90             <% end %> >
91           name
92         </th>
93         <% sort_order = sortable_columns['description'].gsub(/\s/,'') %>
94         <th <% if !sort_order.nil? %>
95               data-sort-order='<%= sort_order %>'
96             <% end %> >
97           description
98         </th>
99       </tr>
100     </thead>
101   </table>
102 </div>