diff --git a/app/views/roles/_form.html.erb b/app/views/roles/_form.html.erb index 7489926f1b..45e7c755d5 100644 --- a/app/views/roles/_form.html.erb +++ b/app/views/roles/_form.html.erb @@ -24,7 +24,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. <%= error_messages_for :role %>
- <%= f.text_field :name, required: true %> + <%= f.text_field :name, required: true, container_class: '-slim' %>
<% if role.new_record? %> @@ -38,24 +38,23 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. <% if role.new_record? || role.is_a?(GlobalRole) %> <% end %> <% if role.new_record? || !role.is_a?(GlobalRole) %>
- <%= render :partial => "member_attributes", :locals => { :f => f, :role => role, :roles => (roles.present? ? roles.select {|r| !r.is_a?(GlobalRole)} : nil)}%> + <%= render partial: "member_attributes", locals: { f: f, role: role, roles: (roles.present? ? roles.select {|r| !r.is_a?(GlobalRole)} : nil)}%>
<% end %> -

<%= l(:label_permissions) %>

<% 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/_member_attributes.html.erb b/app/views/roles/_member_attributes.html.erb index b79eeb0553..b3af6b1df4 100644 --- a/app/views/roles/_member_attributes.html.erb +++ b/app/views/roles/_member_attributes.html.erb @@ -24,6 +24,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. <% if role.new_record? && roles.any? %>
<%= styled_label_tag :copy_workflow_from, l(:label_copy_workflow_from) %> - <%= styled_select_tag(:copy_workflow_from, content_tag("option") + options_from_collection_for_select(@roles.select{|r| !r.is_a?(GlobalRole)}, :id, :name)) %> + <%= styled_select_tag(:copy_workflow_from, content_tag("option") + options_from_collection_for_select(@roles.select{|r| !r.is_a?(GlobalRole)}, :id, :name), container_class: '-slim') %>
<% end %> diff --git a/app/views/roles/_permissions.html.erb b/app/views/roles/_permissions.html.erb index 62b01fe580..d0ab91a2d6 100644 --- a/app/views/roles/_permissions.html.erb +++ b/app/views/roles/_permissions.html.erb @@ -20,14 +20,28 @@ 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| %> -
<%= mod.blank? ? Project.model_name.human : l_or_humanize(mod, :prefix => 'project_module_') %> - <% perms_by_module[mod].each do |permission| %> - + <% if globalRole === 'false' %> +
+ <% else %> +
<% end %> + + + <%= mod.blank? ? Project.model_name.human : l_or_humanize(mod, prefix: 'project_module_') %> + + <% perms_by_module[mod].each do |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][]', '' %>