nyastodon/app/views/admin/roles/_form.html.haml

37 lines
1.4 KiB
Text
Raw Normal View History

= render 'shared/error_messages', object: form.object
- if form.object.everyone?
.flash-message.info
= t('admin.roles.everyone_full_description_html')
- else
.fields-group
= form.input :name, wrapper: :with_label
- unless current_user.role == form.object
.fields-group
= form.input :position, wrapper: :with_label, input_html: { max: current_user.role.position - 1 }
.fields-group
= form.input :color, wrapper: :with_label, input_html: { placeholder: '#000000', type: 'color' }
%hr.spacer/
.fields-group
= form.input :highlighted, wrapper: :with_label
%hr.spacer/
- unless current_user.role == form.object
.field-group
.input.with_block_label
%label= t('simple_form.labels.user_role.permissions_as_keys')
%span.hint= t('simple_form.hints.user_role.permissions_as_keys')
- (form.object.everyone? ? UserRole::Flags::CATEGORIES.slice(:invites) : UserRole::Flags::CATEGORIES).each do |category, permissions|
%h4= t(category, scope: 'admin.roles.categories')
= form.input :permissions_as_keys, collection: permissions, wrapper: :with_block_label, include_blank: false, label_method: ->(privilege) { privilege_label(privilege) }, required: false, as: :check_boxes, collection_wrapper_tag: 'ul', item_wrapper_tag: 'li', label: false, hint: false, disabled: disable_permissions?(permissions)
%hr.spacer/