Project

General

Profile

Feature #23980 » replace-toggle-checkboxes-icon.patch

Mizuki ISHIKAWA, 2024-09-09 10:23

View differences:

app/helpers/application_helper.rb
link_to_function(l(:button_uncheck_all), "checkAll('#{form_name}', false)")
end
def toggle_checkboxes_link(selector)
link_to_function '',
def toggle_checkboxes_link(selector, options={})
css_classes = 'icon icon-checked'
css_classes += ' ' + options[:class] if options[:class]
link_to_function icon_with_label('checked', ''),
"toggleCheckboxesBySelector('#{selector}')",
:title => "#{l(:button_check_all)} / #{l(:button_uncheck_all)}",
:class => 'icon icon-checked'
:class => css_classes
end
def progress_bar(pcts, options={})
app/views/roles/permissions.html.erb
<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 %>
......
<% 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| %>
app/views/trackers/fields.html.erb
<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 %>
......
<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| %>
......
<% @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| %>
app/views/workflows/_form.html.erb
<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>
......
<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 %>
......
<% 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 %>
(39-39/54)