Fix 2.4.2 upgrade notes formatting refs #19330
[arvados.git] / apps / workbench / app / views / projects / _show_tab_contents.html.erb
index 66c469ef4ca1e6e93a2bf10c1eb54525444b5079..2e5c8a3b7fddb3042e23f63209c79b16109cd2d4 100644 (file)
@@ -1,3 +1,7 @@
+<%# Copyright (C) The Arvados Authors. All rights reserved.
+
+SPDX-License-Identifier: AGPL-3.0 %>
+
 <% sortable_columns = {} if local_assigns[:sortable_columns].nil? %>
 <div class="selection-action-container">
   <div class="row">
@@ -5,72 +9,83 @@
       <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 "Create new collection with selected collections", '#',
-                  'data-href' => combine_selected_path(
-                    action_data: {current_project_uuid: @object.uuid}.to_json
-                  ),
-                  'id' => 'combine_selections_button',
-                  method: :post,
-                  'data-selection-param-name' => 'selection[]',
-                  'data-selection-action' => 'combine-project-contents',
-                  'data-toggle' => 'dropdown'
-            %></li>
-          <li><%= link_to "Compare selected", 'action',
+          <% if Collection.creatable? %>
+            <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',
+                    method: :post,
+                    'data-selection-param-name' => 'selection[]',
+                    'data-selection-action' => 'combine-project-contents',
+                    'data-toggle' => 'dropdown'
+              %></li>
+          <% end %>
+          <li><%= link_to "Compare selected", '#',
                   'data-href' => compare_pipeline_instances_path,
                   'data-selection-param-name' => 'uuids[]',
-                  'data-selection-action' => 'compare'
-            %></li>
-          <li><%= link_to "Copy selected...", '#',
-                  'data-href' => choose_projects_path(
-                    title: 'Copy selected items to...',
-                    editable: true,
-                    action_name: 'Copy',
-                    action_href: actions_path,
-                    action_method: 'post',
-                    action_data_from_params: ['selection'],
-                    action_data: {
-                      copy_selections_into_project: true,
-                      selection_param: 'uuid',
-                      success: 'page-refresh'}.to_json),
-                  'data-remote' => true,
-                  'data-selection-param-name' => 'selection[]',
-                  'data-selection-action' => 'copy'
-            %></li>
-          <li><%= link_to "Move selected...", '#',
-                  'data-href' => choose_projects_path(
-                    title: 'Move selected items to...',
-                    editable: true,
-                    action_name: 'Move',
-                    action_href: actions_path,
-                    action_method: 'post',
-                    action_data_from_params: ['selection'],
-                    action_data: {
-                      move_selections_into_project: true,
-                      selection_param: 'uuid',
-                      success: 'page-refresh'}.to_json),
-                  'data-remote' => true,
-                  'data-selection-param-name' => 'selection[]',
-                  'data-selection-action' => 'move'
-            %></li>
-          <% if @object.editable? %>
-          <li><%= link_to "Remove selected", '#',
-                  method: :delete,
-                  'data-href' => url_for(action: :remove_items),
-                  'data-selection-param-name' => 'item_uuids[]',
-                  'data-selection-action' => 'remove',
-                  'data-remote' => true,
+                  'data-selection-action' => 'compare',
                   'data-toggle' => 'dropdown'
             %></li>
+          <% if Collection.creatable? %>
+            <li><%= link_to "Copy selected...", '#',
+                    'data-href' => choose_projects_path(
+                      title: 'Copy selected items to...',
+                      editable: true,
+                      action_name: 'Copy',
+                      action_href: actions_path,
+                      action_method: 'post',
+                      action_data_from_params: ['selection'],
+                      action_data: {
+                        copy_selections_into_project: true,
+                        selection_param: 'uuid',
+                        success: 'page-refresh'}.to_json),
+                    'data-remote' => true,
+                    'data-selection-param-name' => 'selection[]',
+                    'data-selection-action' => 'copy',
+                    'data-toggle' => 'dropdown'
+              %></li>
+          <% end %>
+          <% if @object.editable? %>
+            <li><%= link_to "Move selected...", '#',
+                    'data-href' => choose_projects_path(
+                      title: 'Move selected items to...',
+                      editable: true,
+                      action_name: 'Move',
+                      action_href: actions_path,
+                      action_method: 'post',
+                      action_data_from_params: ['selection'],
+                      action_data: {
+                        move_selections_into_project: true,
+                        selection_param: 'uuid',
+                        success: 'page-refresh'}.to_json),
+                    'data-remote' => true,
+                    'data-selection-param-name' => 'selection[]',
+                    'data-selection-action' => 'move',
+                    'data-toggle' => 'dropdown'
+              %></li>
+            <li><%= link_to "Remove selected", '#',
+                    method: :delete,
+                    'data-href' => url_for(action: :remove_items),
+                    'data-selection-param-name' => 'item_uuids[]',
+                    'data-selection-action' => 'remove',
+                    'data-remote' => true,
+                    'data-toggle' => 'dropdown'
+              %></li>
           <% end %>
         </ul>
       </div>
+      <div class="btn-group btn-group-sm">
+        <button id="select-all" type="button" class="btn btn-default" onClick="select_all_items()">Select all</button>
+        <button id="unselect-all" type="button" class="btn btn-default" onClick="unselect_all_items()">Unselect all</button>
+      </div>
     </div>
     <div class="col-sm-4 pull-right">
       <input type="text" class="form-control filterable-control" placeholder="Search project contents" data-filterable-target="table.arv-index.arv-project-<%= tab_pane %> tbody"/>
     </div>
   </div>
 
-  <table class="table table-condensed arv-index arv-project-<%= tab_pane %>">
+  <table class="table table-condensed arv-index arv-selectable-items arv-project-<%= tab_pane %>">
     <colgroup>
       <col width="0*" style="max-width: fit-content;" />
       <col width="0*" style="max-width: fit-content;" />