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