Merge branch 'master' into 3618-column-ordering
[arvados.git] / apps / workbench / app / views / projects / _show_tab_contents.html.erb
index 2789542de2070fed63cb8661bdb8d86a34d9ba55..af634bfa1240c6a2530c475305339b7a9f526987 100644 (file)
@@ -1,14 +1,19 @@
+<% order = nil if local_assigns[:order].nil? %>
+<% sortable_columns = {} if local_assigns[:sortable_columns].nil? %>
 <div class="selection-action-container">
   <div class="row">
     <div class="col-sm-5">
       <div class="btn-group btn-group-sm">
         <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">Selection... <span class="caret"></span></button>
         <ul class="dropdown-menu" role="menu">
-          <li><%= link_to "Combine selections into a new collection", '/combine_selected',
-                  'data-href' => url_for('/combine_selected?show_project=true'),
+          <li><%= link_to "Create new collection with selected collections", '#',
+                  'data-href' => combine_selected_path(
+                    action_data: {current_project_uuid: @object.uuid}.to_json
+                  ),
+                  'id' => 'combine_selections_button',
                   'data-selection-param-name' => 'selection[]',
-                  'data-selection-action' => 'combine',
-                  'data-remote' => true,
+                  'data-selection-action' => 'combine-project-contents',
+                  'method' => 'post',
                   'data-toggle' => 'dropdown'
             %></li>
           <li><%= link_to "Compare selected", 'action',
       <col width="60%" style="width: 60%;" />
       <col width="40%" style="width: 40%;" />
     </colgroup>
-    <tbody data-infinite-scroller="#<%= tab_pane %>-scroll" data-infinite-content-href="<%= url_for partial: :contents_rows %>" data-infinite-content-params-projecttab="<%= {filters: filters}.to_json %>">
+    <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">
     </tbody>
     <thead>
       <tr>
         <th></th>
         <th></th>
         <th></th>
-        <th>name</th>
-        <th>description</th>
+        <% sort_order = sortable_columns['name'] %>
+        <th <% if !sort_order.nil? %>
+              data-sort-order='<%= raw sort_order %>'
+            <% end %> >
+          name
+        </th>
+        <% sort_order = sortable_columns['description'] %>
+        <th <% if !sort_order.nil? %>
+              data-sort-order='<%= raw sort_order %>'
+            <% end %> >
+          description
+        </th>
       </tr>
     </thead>
   </table>