2007-04-08 00:27:19 +04:00
|
|
|
<h2><%=l(:label_permissions_report)%></h2>
|
|
|
|
|
2007-08-29 21:25:22 +04:00
|
|
|
<% form_tag({:action => 'report'}, :id => 'permissions_form') do %>
|
2007-08-29 20:52:35 +04:00
|
|
|
<%= hidden_field_tag 'permissions[0]', '' %>
|
2007-04-08 00:27:19 +04:00
|
|
|
<table class="list">
|
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| %>
|
2007-08-29 20:52:35 +04:00
|
|
|
<th><%= content_tag(role.builtin? ? 'em' : 'span', h(role.name)) %></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? %>
|
|
|
|
<tr><%= content_tag('th', mod.humanize, :colspan => (@roles.size + 1)) %></th></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| %>
|
|
|
|
<tr class="<%= cycle('odd', 'even') %>">
|
|
|
|
<td><%= permission.name.to_s.humanize %></td>
|
|
|
|
<% @roles.each do |role| %>
|
|
|
|
<td align="center">
|
|
|
|
<% if role.setable_permissions.include? permission %>
|
|
|
|
<%= check_box_tag "permissions[#{role.id}][]", permission.name, (role.permissions.include? permission.name) %>
|
|
|
|
<% end %>
|
|
|
|
</td>
|
|
|
|
<% end %>
|
|
|
|
</tr>
|
2007-08-29 20:52:35 +04:00
|
|
|
<% end %>
|
|
|
|
<% end %>
|
2007-04-08 00:27:19 +04:00
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<p><%= check_all_links 'permissions_form' %></p>
|
|
|
|
<p><%= submit_tag l(:button_save) %></p>
|
2007-08-29 21:25:22 +04:00
|
|
|
<% end %>
|