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)
<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| %>
</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>