Feature #32672

Add Check all / Uncheck all button to filters in permissions report

Added by Go MAEDA 7 months ago. Updated 5 months ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Go MAEDA% Done:

0%

Category:Administration
Target version:4.2.0
Resolution:Fixed

Description

#32343 added a feature to filter roles in permissions report.

The feature is useful but it is tiresome to uncheck unnecessary roles if there are many roles. Adding Check all / Uncheck all button that we already have in other pages will help to resolve it.

32672@2x.png (21.4 KB) Go MAEDA, 2020-02-04 09:13

Associated revisions

Revision 19497
Added by Go MAEDA 5 months ago

Add Check all / Uncheck all button to filters in permissions report (#32672).

Patch by Mizuki ISHIKAWA.

History

#1 Updated by Mizuki ISHIKAWA 5 months ago

The Check all / Uncheck all button is added by making the changes below.

diff --git a/app/views/roles/permissions.html.erb b/app/views/roles/permissions.html.erb
index 0d57d6e38..9cd71b499 100644
--- a/app/views/roles/permissions.html.erb
+++ b/app/views/roles/permissions.html.erb
@@ -5,12 +5,15 @@
     <legend onclick="toggleFieldset(this);" class="icon icon-collapsed"><%= l(:label_filter_plural) %></legend>
     <div style="display: none;">
       <%= form_tag({}, :method => :get) do %>
-        <% Role.sorted.to_a.each do |role| %>
-          <label>
-            <%= check_box_tag "ids[]", role.id, @roles.include?(role) %>
-            <%= role.name %>
-          </label>
-        <% end %>
+        <fieldset>
+          <legend><%= toggle_checkboxes_link('#filters input[type=checkbox]:enabled') %></legend>
+          <% Role.sorted.to_a.each do |role| %>
+            <label>
+              <%= check_box_tag "ids[]", role.id, @roles.include?(role) %>
+              <%= role.name %>
+            </label>
+          <% end %>
+        </fieldset>
         <p>
           <%= submit_tag l(:button_apply), :name => nil %>
           <%= link_to l(:button_clear), permissions_roles_path, :class => 'icon icon-reload' %>

#2 Updated by Go MAEDA 5 months ago

LGTM. Setting the target version to 4.2.0.

#3 Updated by Go MAEDA 5 months ago

  • Status changed from New to Closed
  • Assignee set to Go MAEDA
  • Resolution set to Fixed

Committed the patch. Thank you.

Also available in: Atom PDF