2023-09-28 10:36:24 -04:00
|
|
|
= render 'shared/error_messages', object: form.object
|
2022-07-04 20:41:40 -04:00
|
|
|
|
2023-09-28 10:36:24 -04:00
|
|
|
- if form.object.everyone?
|
|
|
|
.flash-message.info
|
|
|
|
= t('admin.roles.everyone_full_description_html')
|
|
|
|
- else
|
|
|
|
.fields-group
|
|
|
|
= form.input :name, wrapper: :with_label
|
2022-07-04 20:41:40 -04:00
|
|
|
|
2023-09-28 10:36:24 -04:00
|
|
|
- unless current_user.role == form.object
|
2022-07-04 20:41:40 -04:00
|
|
|
.fields-group
|
2023-09-28 10:36:24 -04:00
|
|
|
= form.input :position, wrapper: :with_label, input_html: { max: current_user.role.position - 1 }
|
2022-07-04 20:41:40 -04:00
|
|
|
|
2023-09-28 10:36:24 -04:00
|
|
|
.fields-group
|
|
|
|
= form.input :color, wrapper: :with_label, input_html: { placeholder: '#000000', type: 'color' }
|
2022-07-04 20:41:40 -04:00
|
|
|
|
2023-09-28 10:36:24 -04:00
|
|
|
%hr.spacer/
|
2022-07-04 20:41:40 -04:00
|
|
|
|
2023-09-28 10:36:24 -04:00
|
|
|
.fields-group
|
|
|
|
= form.input :highlighted, wrapper: :with_label
|
2022-07-04 20:41:40 -04:00
|
|
|
|
2023-09-28 10:36:24 -04:00
|
|
|
%hr.spacer/
|
2022-07-17 07:37:30 -04:00
|
|
|
|
2023-09-28 10:36:24 -04:00
|
|
|
- unless current_user.role == form.object
|
2022-07-04 20:41:40 -04:00
|
|
|
|
2023-09-28 10:36:24 -04:00
|
|
|
.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')
|
2022-07-04 20:41:40 -04:00
|
|
|
|
2023-09-28 10:36:24 -04:00
|
|
|
- (form.object.everyone? ? UserRole::Flags::CATEGORIES.slice(:invites) : UserRole::Flags::CATEGORIES).each do |category, permissions|
|
|
|
|
%h4= t(category, scope: 'admin.roles.categories')
|
2022-07-04 20:41:40 -04:00
|
|
|
|
2023-11-29 05:00:52 -05:00
|
|
|
= 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)
|
2022-07-04 20:41:40 -04:00
|
|
|
|
2023-09-28 10:36:24 -04:00
|
|
|
%hr.spacer/
|