@ -9,7 +9,7 @@
= f.input :name, wrapper: :with_label
= f.input :name, wrapper: :with_label
.fields-group
.fields-group
= f.input :position, wrapper: :with_label
= f.input :position, wrapper: :with_label, input_html: { max: current_user.role.position - 1 }
.fields-group
.fields-group
= f.input :color, wrapper: :with_label, input_html: { placeholder: '#000000' }
= f.input :color, wrapper: :with_label, input_html: { placeholder: '#000000' }
@ -29,7 +29,7 @@
- (@role.everyone? ? UserRole::Flags::CATEGORIES.slice(:invites) : UserRole::Flags::CATEGORIES).each do |category, permissions|
- (@role.everyone? ? UserRole::Flags::CATEGORIES.slice(:invites) : UserRole::Flags::CATEGORIES).each do |category, permissions|
%h4= t(category, scope: 'admin.roles.categories')
%h4= t(category, scope: 'admin.roles.categories')
= f.input :permissions_as_keys, collection: permissions, wrapper: :with_block_label, include_blank: false, label_method: lambda { |privilege| safe_join([t("admin.roles.privileges.#{privilege}"), content_tag(:span, t("admin.roles.privileges.#{privilege}_description"), class: 'hint')]) }, required: false, as: :check_boxes, collection_wrapper_tag: 'ul', item_wrapper_tag: 'li', label: false, hint: false
= f.input :permissions_as_keys, collection: permissions, wrapper: :with_block_label, include_blank: false, label_method: lambda { |privilege| safe_join([t("admin.roles.privileges.#{privilege}"), content_tag(:span, t("admin.roles.privileges.#{privilege}_description"), class: 'hint')]) }, required: false, as: :check_boxes, collection_wrapper_tag: 'ul', item_wrapper_tag: 'li', label: false, hint: false, disabled: permissions.filter { |privilege| UserRole::FLAGS[privilege] & current_user.role.computed_permissions == 0 }
%hr.spacer/
%hr.spacer/