summaryrefslogtreecommitdiffstats
path: root/app/views
diff options
context:
space:
mode:
authorMarius Balteanu <marius.balteanu@zitec.com>2024-09-09 15:50:37 +0000
committerMarius Balteanu <marius.balteanu@zitec.com>2024-09-09 15:50:37 +0000
commite8879d891f39539fe1d0d6cb14c26a02944234a5 (patch)
treefe709e3de231388c64e84f0f5034bf18a66b7e5d /app/views
parent053326b660184a7273c43799f4b01237fe6293b2 (diff)
downloadredmine-e8879d891f39539fe1d0d6cb14c26a02944234a5.tar.gz
redmine-e8879d891f39539fe1d0d6cb14c26a02944234a5.zip
Refactors toggle checkboxes link and switch to SVG icon (#23980).
Patch by Mizuki ISHIKAWA (user:ishikawa999) git-svn-id: https://svn.redmine.org/redmine/trunk@23047 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views')
-rw-r--r--app/views/roles/permissions.html.erb10
-rw-r--r--app/views/trackers/fields.html.erb12
-rw-r--r--app/views/workflows/_form.html.erb12
3 files changed, 8 insertions, 26 deletions
diff --git a/app/views/roles/permissions.html.erb b/app/views/roles/permissions.html.erb
index 07fb6f615..63a1267fc 100644
--- a/app/views/roles/permissions.html.erb
+++ b/app/views/roles/permissions.html.erb
@@ -37,10 +37,7 @@
<th><%=l(:label_permissions)%></th>
<% @roles.each do |role| %>
<th>
- <%= link_to_function('',
- "toggleCheckboxesBySelector('input.role-#{role.id}')",
- :title => "#{l(:button_check_all)} / #{l(:button_uncheck_all)}",
- :class => 'icon-only icon-checked') %>
+ <%= toggle_checkboxes_link("input.role-#{role.id}") %>
<%= content_tag(role.builtin? ? 'em' : 'span', role.name) %>
</th>
<% end %>
@@ -64,10 +61,7 @@
<% humanized_perm_name = l_or_humanize(permission.name, :prefix => 'permission_') %>
<tr class="permission-<%= permission.name %>">
<td class="name">
- <%= link_to_function('',
- "toggleCheckboxesBySelector('.permission-#{permission.name} input')",
- :title => "#{l(:button_check_all)} / #{l(:button_uncheck_all)}",
- :class => 'icon-only icon-checked') %>
+ <%= toggle_checkboxes_link(".permission-#{permission.name} input") %>
<%= humanized_perm_name %>
</td>
<% @roles.each do |role| %>
diff --git a/app/views/trackers/fields.html.erb b/app/views/trackers/fields.html.erb
index 0b0fee373..5f44bf43b 100644
--- a/app/views/trackers/fields.html.erb
+++ b/app/views/trackers/fields.html.erb
@@ -9,9 +9,7 @@
<th></th>
<% @trackers.each do |tracker| %>
<th>
- <%= link_to_function('', "toggleCheckboxesBySelector('input.tracker-#{tracker.id}')",
- :title => "#{l(:button_check_all)} / #{l(:button_uncheck_all)}",
- :class => 'icon-only icon-checked') %>
+ <%= toggle_checkboxes_link("input.tracker-#{tracker.id}") %>
<%= tracker.name %>
</th>
<% end %>
@@ -28,9 +26,7 @@
<tr>
<% field_name = l("field_#{field}".delete_suffix('_id')) %>
<td class="name">
- <%= link_to_function('', "toggleCheckboxesBySelector('input.core-field-#{field}')",
- :title => "#{l(:button_check_all)} / #{l(:button_uncheck_all)}",
- :class => 'icon-only icon-checked') %>
+ <%= toggle_checkboxes_link("input.core-field-#{field}") %>
<%= field_name %>
</td>
<% @trackers.each do |tracker| %>
@@ -51,9 +47,7 @@
<% @custom_fields.each do |field| %>
<tr>
<td class="name">
- <%= link_to_function('', "toggleCheckboxesBySelector('input.custom-field-#{field.id}')",
- :title => "#{l(:button_check_all)} / #{l(:button_uncheck_all)}",
- :class => 'icon-only icon-checked') %>
+ <%= toggle_checkboxes_link("input.custom-field-#{field.id}") %>
<%= field.name %>
</td>
<% @trackers.each do |tracker| %>
diff --git a/app/views/workflows/_form.html.erb b/app/views/workflows/_form.html.erb
index f0863850f..5b7c16bc9 100644
--- a/app/views/workflows/_form.html.erb
+++ b/app/views/workflows/_form.html.erb
@@ -2,9 +2,7 @@
<thead>
<tr>
<th>
- <%= link_to_function('', "toggleCheckboxesBySelector('table.transitions-#{name} input[type=checkbox]:not(:disabled)')",
- :title => "#{l(:button_check_all)} / #{l(:button_uncheck_all)}",
- :class => 'no-tooltip icon-only icon-checked') %>
+ <%= toggle_checkboxes_link("table.transitions-#{name} input[type=checkbox]:not(:disabled)", { class: 'no-tooltip' }) %>
<%=l(:label_current_status)%>
</th>
<th colspan="<%= @statuses.length %>"><%=l(:label_new_statuses_allowed)%></th>
@@ -13,9 +11,7 @@
<td></td>
<% for new_status in @statuses %>
<td style="width:<%= 75 / @statuses.size %>%;">
- <%= link_to_function('', "toggleCheckboxesBySelector('table.transitions-#{name} input[type=checkbox]:not(:disabled).new-status-#{new_status.id}')",
- :title => "#{l(:button_check_all)} / #{l(:button_uncheck_all)}",
- :class => 'no-tooltip icon-only icon-checked') %>
+ <%= toggle_checkboxes_link("table.transitions-#{name} input[type=checkbox]:not(:disabled).new-status-#{new_status.id}", { class: 'no-tooltip' }) %>
<%= new_status.name %>
</td>
<% end %>
@@ -27,9 +23,7 @@
<% next if old_status.nil? && name != 'always' %>
<tr>
<td class="name">
- <%= link_to_function('', "toggleCheckboxesBySelector('table.transitions-#{name} input[type=checkbox]:not(:disabled).old-status-#{old_status.try(:id) || 0}')",
- :title => "#{l(:button_check_all)} / #{l(:button_uncheck_all)}",
- :class => 'no-tooltip icon-only icon-checked') %>
+ <%= toggle_checkboxes_link("table.transitions-#{name} input[type=checkbox]:not(:disabled).old-status-#{old_status.try(:id) || 0}", { class: 'no-tooltip' }) %>
<% if old_status %>
<% old_status_name = old_status.name %>
<%= old_status_name %>