OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openproject/app/views/roles/_form.erb

29 lines
1.1 KiB

<%= roles ||= nil %>
<%= error_messages_for 'role' %>
<div class="box">
<p><%= f.text_field :name, :required => true %></p>
<p><label for='global_role'><%= l(:label_global_role)%></label><%= check_box_tag "global_role", "1", role.is_a?(GlobalRole), :disabled => !role.new_record?%></p>
<% if role.is_a?(GlobalRole)%>
<div id="global_attributes" style="display:none">
<%= render :partial => "global_attributes", :locals => { :f => f, :role => role, :roles => (roles.present? ? roles.select {|r| r.is_a?(GlobalRole)} : nil) }%>
</div>
<% else %>
<div id="member_attributes">
<%= render :partial => "member_attributes", :locals => { :f => f, :role => role, :roles => (roles.present? ? roles.select {|r| !r.is_a?(GlobalRole)} : nil)}%>
</div>
<% end %>
</div>
<h3><%= l(:label_permissions) %></h3>
<% if role.is_a?(GlobalRole) %>
<div id="global_permissions" style="display:none">
<%= render :partial => "permissions", :locals => {:permissions => global_permissions, :role => role }%>
</div>
<% else %>
<div id="member_permissions">
<%= render :partial => "permissions", :locals => {:permissions => member_permissions, :role => role }%>
</div>
<% end%>