2011-05-30 22:52:25 +04:00
|
|
|
<%= error_messages_for 'role' %>
|
2007-08-29 20:52:35 +04:00
|
|
|
|
2007-10-01 18:00:38 +04:00
|
|
|
<% unless @role.builtin? %>
|
2006-07-29 13:32:58 +04:00
|
|
|
<div class="box">
|
2007-10-01 18:00:38 +04:00
|
|
|
<p><%= f.text_field :name, :required => true %></p>
|
2007-08-16 21:47:41 +04:00
|
|
|
<p><%= f.check_box :assignable %></p>
|
2008-03-15 11:27:38 +03:00
|
|
|
<% if @role.new_record? && @roles.any? %>
|
2011-10-20 19:51:24 +04:00
|
|
|
<p><label for="copy_workflow_from"><%= l(:label_copy_workflow_from) %></label>
|
2008-03-15 11:27:38 +03:00
|
|
|
<%= select_tag(:copy_workflow_from, content_tag("option") + options_from_collection_for_select(@roles, :id, :name)) %></p>
|
|
|
|
<% end %>
|
2007-09-14 15:34:08 +04:00
|
|
|
</div>
|
2007-10-01 18:00:38 +04:00
|
|
|
<% end %>
|
2007-09-14 15:34:08 +04:00
|
|
|
|
2007-09-22 17:17:49 +04:00
|
|
|
<h3><%= l(:label_permissions) %></h3>
|
2008-05-14 21:26:13 +04:00
|
|
|
<div class="box" id="permissions">
|
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| %>
|
2008-10-24 19:24:35 +04:00
|
|
|
<fieldset><legend><%= mod.blank? ? l(:label_project) : l_or_humanize(mod, :prefix => 'project_module_') %></legend>
|
2007-09-14 15:34:08 +04:00
|
|
|
<% perms_by_module[mod].each do |permission| %>
|
2007-10-06 00:06:53 +04:00
|
|
|
<label class="floating">
|
2007-09-14 15:34:08 +04:00
|
|
|
<%= check_box_tag 'role[permissions][]', permission.name, (@role.permissions.include? permission.name) %>
|
2008-10-24 19:24:35 +04:00
|
|
|
<%= l_or_humanize(permission.name, :prefix => 'permission_') %>
|
2007-10-06 00:06:53 +04:00
|
|
|
</label>
|
2007-09-14 15:34:08 +04:00
|
|
|
<% end %>
|
|
|
|
</fieldset>
|
2007-03-12 20:59:02 +03:00
|
|
|
<% end %>
|
2008-05-14 21:26:13 +04:00
|
|
|
<br /><%= check_all_links 'permissions' %>
|
2007-08-29 20:52:35 +04:00
|
|
|
<%= hidden_field_tag 'role[permissions][]', '' %>
|
2007-09-14 15:34:08 +04:00
|
|
|
</div>
|