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.html.erb

40 lines
1.5 KiB

<%= render :partial => 'shared/global_roles_header' %>
<% roles ||= nil %>
<%= error_messages_for :role %>
<div class="box">
<p><%= f.text_field :name, :required => true %></p>
<p>
<% if role.new_record? %>
<label for='global_role'><%= l(:label_global_role)%></label><%= check_box_tag("global_role", "1", role.is_a?(GlobalRole))%>
<%else%>
<span class="label">
<%= l(:label_role_type) + " " + l(:label_not_changeable)%></span>
<%= (role.is_a?(GlobalRole) ? l(:label_global_role) : l(:label_member_role))%>
<%end%>
</p>
<% if role.new_record? || 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>
<%end%>
<%if role.new_record? || !role.is_a?(GlobalRole)%>
<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.new_record? || role.is_a?(GlobalRole)%>
<div id="global_permissions" style=<%= role.new_record? ? "display:none" : ""%> >
<%= render :partial => "permissions", :locals => {:permissions => global_permissions, :role => role }%>
</div>
<%end%>
<%if role.new_record? || !role.is_a?(GlobalRole)%>
<div id="member_permissions">
<%= render :partial => "permissions", :locals => {:permissions => member_permissions, :role => role }%>
</div>
<%end%>