diff --git a/app/views/roles/_form.html.erb b/app/views/roles/_form.html.erb index 6307ab85f8..a4d09be3c7 100644 --- a/app/views/roles/_form.html.erb +++ b/app/views/roles/_form.html.erb @@ -50,11 +50,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. <% if role.new_record? || role.is_a?(GlobalRole) %>
> - <%= render :partial => "permissions", :locals => {:permissions => global_permissions, :role => role }%> + <%= render :partial => "permissions", :locals => {:permissions => global_permissions, :role => role, :globalRole => "true" }%>
<% end %> <% if role.new_record? || !role.is_a?(GlobalRole) %>
> - <%= render :partial => "permissions", :locals => {:permissions => member_permissions, :role => role }%> + <%= render :partial => "permissions", :locals => {:permissions => member_permissions, :role => role, :globalRole => "false" }%>
<% end %> diff --git a/app/views/roles/_permissions.html.erb b/app/views/roles/_permissions.html.erb index 008e728a19..8ca2f83ee7 100644 --- a/app/views/roles/_permissions.html.erb +++ b/app/views/roles/_permissions.html.erb @@ -20,7 +20,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. <% perms_by_module = permissions.group_by {|p| p.project_module.to_s} %> <% perms_by_module.keys.sort.each do |mod| %> -
+ <% if globalRole === 'false' %> +
+ <% else %> +
+ <% end %> + <%= mod.blank? ? Project.model_name.human : l_or_humanize(mod, :prefix => 'project_module_') %> @@ -30,7 +35,13 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. <%= l_or_humanize(permission.name, :prefix => 'permission_') %> <% end %> + + <% if globalRole === 'false' %> +
<%= check_all_links (mod.blank? ? 'fieldset--' + Project.model_name.human.downcase.gsub(' ', '_') : 'fieldset--' + l_or_humanize(mod, :prefix => 'project_module_').downcase.gsub(' ', '_')) %> + <% else %> +
<%= check_all_links (mod.blank? ? 'fieldset--global--' + Project.model_name.human.downcase.gsub(' ', '_') : 'fieldset--global--' + l_or_humanize(mod, :prefix => 'project_module_').downcase.gsub(' ', '_')) %> + <% end %> +
<% end %> -
<%= check_all_links permissions_id(permissions) %> <%= hidden_field_tag 'role[permissions][]', '' %>