2011-12-10 03:29:58 +04:00
|
|
|
<h2><%= link_to l(:label_role_plural), roles_path %> » <%=l(:label_permissions_report)%></h2>
|
2007-04-08 00:27:19 +04:00
|
|
|
|
2012-04-25 21:17:49 +04:00
|
|
|
<%= form_tag(permissions_roles_path, :id => 'permissions_form') do %>
|
2008-08-26 20:05:02 +04:00
|
|
|
<%= hidden_field_tag 'permissions[0]', '', :id => nil %>
|
2011-03-13 16:31:36 +03:00
|
|
|
<div class="autoscroll">
|
2012-02-03 02:31:00 +04:00
|
|
|
<table class="list permissions">
|
2007-08-29 20:52:35 +04:00
|
|
|
<thead>
|
2007-04-08 00:27:19 +04:00
|
|
|
<tr>
|
2007-08-29 20:52:35 +04:00
|
|
|
<th><%=l(:label_permissions)%></th>
|
2007-04-08 00:27:19 +04:00
|
|
|
<% @roles.each do |role| %>
|
2008-08-26 20:05:02 +04:00
|
|
|
<th>
|
|
|
|
<%= content_tag(role.builtin? ? 'em' : 'span', h(role.name)) %>
|
|
|
|
<%= link_to_function(image_tag('toggle_check.png'), "toggleCheckboxesBySelector('input.role-#{role.id}')",
|
|
|
|
:title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}") %>
|
|
|
|
</th>
|
2007-04-08 00:27:19 +04:00
|
|
|
<% end %>
|
|
|
|
</tr>
|
2007-08-29 20:52:35 +04:00
|
|
|
</thead>
|
|
|
|
<tbody>
|
2007-09-14 15:34:08 +04:00
|
|
|
<% perms_by_module = @permissions.group_by {|p| p.project_module.to_s} %>
|
|
|
|
<% perms_by_module.keys.sort.each do |mod| %>
|
|
|
|
<% unless mod.blank? %>
|
2009-05-10 14:43:19 +04:00
|
|
|
<tr class="group open">
|
2012-02-03 02:31:00 +04:00
|
|
|
<td>
|
2011-09-18 03:05:16 +04:00
|
|
|
<span class="expander" onclick="toggleRowGroup(this);"> </span>
|
|
|
|
<%= l_or_humanize(mod, :prefix => 'project_module_') %>
|
|
|
|
</td>
|
2012-02-03 02:31:00 +04:00
|
|
|
<% @roles.each do |role| %>
|
|
|
|
<td class="role"><%= h(role.name) %></td>
|
|
|
|
<% end %>
|
2009-05-10 14:43:19 +04:00
|
|
|
</tr>
|
2007-04-08 00:27:19 +04:00
|
|
|
<% end %>
|
2007-09-14 15:34:08 +04:00
|
|
|
<% perms_by_module[mod].each do |permission| %>
|
2008-08-26 20:05:02 +04:00
|
|
|
<tr class="<%= cycle('odd', 'even') %> permission-<%= permission.name %>">
|
|
|
|
<td>
|
|
|
|
<%= link_to_function(image_tag('toggle_check.png'), "toggleCheckboxesBySelector('.permission-#{permission.name} input')",
|
|
|
|
:title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}") %>
|
2008-10-24 19:24:35 +04:00
|
|
|
<%= l_or_humanize(permission.name, :prefix => 'permission_') %>
|
2008-08-26 20:05:02 +04:00
|
|
|
</td>
|
2007-09-14 15:34:08 +04:00
|
|
|
<% @roles.each do |role| %>
|
|
|
|
<td align="center">
|
|
|
|
<% if role.setable_permissions.include? permission %>
|
2008-08-26 20:05:02 +04:00
|
|
|
<%= check_box_tag "permissions[#{role.id}][]", permission.name, (role.permissions.include? permission.name), :id => nil, :class => "role-#{role.id}" %>
|
2007-09-14 15:34:08 +04:00
|
|
|
<% end %>
|
|
|
|
</td>
|
|
|
|
<% end %>
|
|
|
|
</tr>
|
2007-08-29 20:52:35 +04:00
|
|
|
<% end %>
|
|
|
|
<% end %>
|
2007-04-08 00:27:19 +04:00
|
|
|
</tbody>
|
|
|
|
</table>
|
2011-03-13 16:31:36 +03:00
|
|
|
</div>
|
2007-04-08 00:27:19 +04:00
|
|
|
<p><%= check_all_links 'permissions_form' %></p>
|
|
|
|
<p><%= submit_tag l(:button_save) %></p>
|
2007-08-29 21:25:22 +04:00
|
|
|
<% end %>
|