@@ -1119,6 +1119,12 module ApplicationHelper | |||||
1119 | link_to_function(l(:button_uncheck_all), "checkAll('#{form_name}', false)") |
|
1119 | link_to_function(l(:button_uncheck_all), "checkAll('#{form_name}', false)") | |
1120 | end |
|
1120 | end | |
1121 |
|
1121 | |||
|
1122 | def toggle_checkboxes_link(selector) | |||
|
1123 | link_to_function image_tag('toggle_check.png'), | |||
|
1124 | "toggleCheckboxesBySelector('#{selector}')", | |||
|
1125 | :title => "#{l(:button_check_all)} / #{l(:button_uncheck_all)}" | |||
|
1126 | end | |||
|
1127 | ||||
1122 | def progress_bar(pcts, options={}) |
|
1128 | def progress_bar(pcts, options={}) | |
1123 | pcts = [pcts, pcts] unless pcts.is_a?(Array) |
|
1129 | pcts = [pcts, pcts] unless pcts.is_a?(Array) | |
1124 | pcts = pcts.collect(&:round) |
|
1130 | pcts = pcts.collect(&:round) |
@@ -1,5 +1,5 | |||||
1 | <fieldset class="box"> |
|
1 | <fieldset class="box"> | |
2 | <legend><%= l(:label_project_plural) %></legend> |
|
2 | <legend><%= l(:label_project_plural) %> <%= toggle_checkboxes_link('.projects-selection input:enabled') %></legend> | |
3 | <div style="max-height:300px; overflow:auto;"> |
|
3 | <div style="max-height:300px; overflow:auto;"> | |
4 | <div class="projects-selection"> |
|
4 | <div class="projects-selection"> | |
5 | <%= render_project_nested_lists(@projects) do |p| %> |
|
5 | <%= render_project_nested_lists(@projects) do |p| %> | |
@@ -12,11 +12,13 | |||||
12 | </fieldset> |
|
12 | </fieldset> | |
13 |
|
13 | |||
14 | <fieldset class="box"> |
|
14 | <fieldset class="box"> | |
15 | <legend><%= l(:label_role_plural) %></legend> |
|
15 | <legend><%= l(:label_role_plural) %> <%= toggle_checkboxes_link('.roles-selection input') %></legend> | |
|
16 | <div class="roles-selection"> | |||
16 | <% @roles.each do |role| %> |
|
17 | <% @roles.each do |role| %> | |
17 | <label class="inline"> |
|
18 | <label> | |
18 | <%= check_box_tag 'membership[role_ids][]', role.id, false, :id => nil %> |
|
19 | <%= check_box_tag 'membership[role_ids][]', role.id, false, :id => nil %> | |
19 |
<%= |
|
20 | <%= role %> | |
20 | </label> |
|
21 | </label> | |
21 | <% end %> |
|
22 | <% end %> | |
|
23 | </div> | |||
22 | </fieldset> |
|
24 | </fieldset> |
General Comments 0
You need to be logged in to leave comments.
Login now