1
0
mirror of https://github.com/meineerde/redmine.git synced 2025-12-27 02:41:15 +00:00

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
This commit is contained in:
Jean-Philippe Lang 2014-11-02 20:16:59 +00:00
parent 72115ec093
commit ea2df369dc
2 changed files with 12 additions and 4 deletions

View File

@ -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)

View File

@ -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>