2011-09-17 10:01:33 +04:00
|
|
|
<%= error_messages_for 'role' %>
|
2007-08-29 20:52:35 +04:00
|
|
|
|
2012-09-20 23:26:58 +04:00
|
|
|
<% unless @role.anonymous? %>
|
2011-12-09 22:15:55 +04:00
|
|
|
<div class="box tabular">
|
2011-04-11 21:53:15 +04:00
|
|
|
<% unless @role.builtin? %>
|
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>
|
2011-04-11 21:53:15 +04:00
|
|
|
<% end %>
|
|
|
|
<p><%= f.select :issues_visibility, Role::ISSUES_VISIBILITY_OPTIONS.collect {|v| [l(v.last), v.first]} %></p>
|
2008-03-15 11:27:38 +03:00
|
|
|
<% if @role.new_record? && @roles.any? %>
|
2011-10-29 05:19:18 +04:00
|
|
|
<p><label for="copy_workflow_from"><%= l(:label_copy_workflow_from) %></label>
|
2012-09-03 21:04:28 +04:00
|
|
|
<%= select_tag(:copy_workflow_from, content_tag("option") + options_from_collection_for_select(@roles, :id, :name, params[:copy_workflow_from] || @copy_from.try(:id))) %></p>
|
2008-03-15 11:27:38 +03:00
|
|
|
<% end %>
|
2007-09-14 15:34:08 +04:00
|
|
|
</div>
|
2012-09-20 23:26:58 +04:00
|
|
|
<% end %>
|
2007-09-14 15:34:08 +04:00
|
|
|
|
2007-09-22 17:17:49 +04:00
|
|
|
<h3><%= l(:label_permissions) %></h3>
|
2011-12-09 22:15:55 +04:00
|
|
|
<div class="box tabular" id="permissions">
|
2011-12-10 03:29:58 +04:00
|
|
|
<% perms_by_module = @role.setable_permissions.group_by {|p| p.project_module.to_s} %>
|
2007-09-14 15:34:08 +04:00
|
|
|
<% 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>
|