To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.
root / app / views / roles / .svn / text-base / report.rhtml.svn-base @ 442:753f1380d6bc
History | View | Annotate | Download (2.13 KB)
| 1 | 0:513646585e45 | Chris | <h2><%= link_to l(:label_role_plural), :controller => 'roles', :action => 'index' %> » <%=l(:label_permissions_report)%></h2> |
|---|---|---|---|
| 2 | |||
| 3 | <% form_tag({:action => 'report'}, :id => 'permissions_form') do %>
|
||
| 4 | <%= hidden_field_tag 'permissions[0]', '', :id => nil %> |
||
| 5 | 441:cbce1fd3b1b7 | Chris | <div class="autoscroll"> |
| 6 | 0:513646585e45 | Chris | <table class="list"> |
| 7 | <thead> |
||
| 8 | <tr> |
||
| 9 | <th><%=l(:label_permissions)%></th> |
||
| 10 | <% @roles.each do |role| %> |
||
| 11 | <th> |
||
| 12 | <%= content_tag(role.builtin? ? 'em' : 'span', h(role.name)) %> |
||
| 13 | <%= link_to_function(image_tag('toggle_check.png'), "toggleCheckboxesBySelector('input.role-#{role.id}')",
|
||
| 14 | :title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}") %>
|
||
| 15 | </th> |
||
| 16 | <% end %> |
||
| 17 | </tr> |
||
| 18 | </thead> |
||
| 19 | <tbody> |
||
| 20 | <% perms_by_module = @permissions.group_by {|p| p.project_module.to_s} %>
|
||
| 21 | <% perms_by_module.keys.sort.each do |mod| %> |
||
| 22 | <% unless mod.blank? %> |
||
| 23 | <tr class="group open"> |
||
| 24 | <td colspan="<%= @roles.size + 1 %>"> |
||
| 25 | 441:cbce1fd3b1b7 | Chris | <span class="expander" onclick="toggleRowGroup(this);"> </span> |
| 26 | 0:513646585e45 | Chris | <%= l_or_humanize(mod, :prefix => 'project_module_') %> |
| 27 | </td> |
||
| 28 | </tr> |
||
| 29 | <% end %> |
||
| 30 | <% perms_by_module[mod].each do |permission| %> |
||
| 31 | <tr class="<%= cycle('odd', 'even') %> permission-<%= permission.name %>">
|
||
| 32 | <td> |
||
| 33 | <%= link_to_function(image_tag('toggle_check.png'), "toggleCheckboxesBySelector('.permission-#{permission.name} input')",
|
||
| 34 | :title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}") %>
|
||
| 35 | <%= l_or_humanize(permission.name, :prefix => 'permission_') %> |
||
| 36 | </td> |
||
| 37 | <% @roles.each do |role| %> |
||
| 38 | <td align="center"> |
||
| 39 | <% if role.setable_permissions.include? permission %> |
||
| 40 | <%= check_box_tag "permissions[#{role.id}][]", permission.name, (role.permissions.include? permission.name), :id => nil, :class => "role-#{role.id}" %>
|
||
| 41 | <% end %> |
||
| 42 | </td> |
||
| 43 | <% end %> |
||
| 44 | </tr> |
||
| 45 | <% end %> |
||
| 46 | <% end %> |
||
| 47 | </tbody> |
||
| 48 | </table> |
||
| 49 | 441:cbce1fd3b1b7 | Chris | </div> |
| 50 | 0:513646585e45 | Chris | <p><%= check_all_links 'permissions_form' %></p> |
| 51 | <p><%= submit_tag l(:button_save) %></p> |
||
| 52 | <% end %> |