From ea2df369dca1d96dca16b8a684ef8928586ebd26 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sun, 2 Nov 2014 20:16:59 +0000 Subject: [PATCH] Adds (un)check all buttons to select all projects (#11702). git-svn-id: http://svn.redmine.org/redmine/trunk@13537 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/helpers/application_helper.rb | 6 ++++++ app/views/principal_memberships/_new_form.html.erb | 10 ++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 3a40fd2e2..6476fba51 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1119,6 +1119,12 @@ module ApplicationHelper link_to_function(l(:button_uncheck_all), "checkAll('#{form_name}', false)") end + def toggle_checkboxes_link(selector) + link_to_function image_tag('toggle_check.png'), + "toggleCheckboxesBySelector('#{selector}')", + :title => "#{l(:button_check_all)} / #{l(:button_uncheck_all)}" + end + def progress_bar(pcts, options={}) pcts = [pcts, pcts] unless pcts.is_a?(Array) pcts = pcts.collect(&:round) diff --git a/app/views/principal_memberships/_new_form.html.erb b/app/views/principal_memberships/_new_form.html.erb index bdd7df64c..2a0d50dbc 100644 --- a/app/views/principal_memberships/_new_form.html.erb +++ b/app/views/principal_memberships/_new_form.html.erb @@ -1,5 +1,5 @@
- <%= l(:label_project_plural) %> + <%= l(:label_project_plural) %> <%= toggle_checkboxes_link('.projects-selection input:enabled') %>
<%= render_project_nested_lists(@projects) do |p| %> @@ -12,11 +12,13 @@
- <%= l(:label_role_plural) %> + <%= l(:label_role_plural) %> <%= toggle_checkboxes_link('.roles-selection input') %> +
<% @roles.each do |role| %> -
-- 2.39.5