summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2014-11-02 20:16:59 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2014-11-02 20:16:59 +0000
commitea2df369dca1d96dca16b8a684ef8928586ebd26 (patch)
treef7065b7258dd6dc082458e1ab6140a25af7ab78b /app
parent72115ec093e301f496c6759b17e71afdc9ad328d (diff)
downloadredmine-ea2df369dca1d96dca16b8a684ef8928586ebd26.tar.gz
redmine-ea2df369dca1d96dca16b8a684ef8928586ebd26.zip
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
Diffstat (limited to 'app')
-rw-r--r--app/helpers/application_helper.rb6
-rw-r--r--app/views/principal_memberships/_new_form.html.erb10
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 @@
<fieldset class="box">
- <legend><%= l(:label_project_plural) %></legend>
+ <legend><%= l(:label_project_plural) %> <%= toggle_checkboxes_link('.projects-selection input:enabled') %></legend>
<div style="max-height:300px; overflow:auto;">
<div class="projects-selection">
<%= render_project_nested_lists(@projects) do |p| %>
@@ -12,11 +12,13 @@
</fieldset>
<fieldset class="box">
- <legend><%= l(:label_role_plural) %></legend>
+ <legend><%= l(:label_role_plural) %> <%= toggle_checkboxes_link('.roles-selection input') %></legend>
+ <div class="roles-selection">
<% @roles.each do |role| %>
- <label class="inline">
+ <label>
<%= check_box_tag 'membership[role_ids][]', role.id, false, :id => nil %>
- <%=h role %>
+ <%= role %>
</label>
<% end %>
+ </div>
</fieldset>