2023-09-28 16:23:35 +02:00
|
|
|
= render 'shared/error_messages', object: form.object
|
2022-06-09 21:57:36 +02:00
|
|
|
|
2023-09-28 16:23:35 +02:00
|
|
|
.fields-group
|
2024-03-15 12:19:00 +01:00
|
|
|
= form.input :url,
|
|
|
|
wrapper: :with_block_label,
|
|
|
|
input_html: { placeholder: 'https://' }
|
2022-06-09 21:57:36 +02:00
|
|
|
|
2023-09-28 16:23:35 +02:00
|
|
|
.fields-group
|
2024-03-15 12:19:00 +01:00
|
|
|
= form.input :events,
|
|
|
|
collection: Webhook::EVENTS,
|
|
|
|
wrapper: :with_block_label,
|
|
|
|
include_blank: false,
|
|
|
|
as: :check_boxes,
|
|
|
|
collection_wrapper_tag: 'ul',
|
|
|
|
item_wrapper_tag: 'li',
|
2024-09-27 10:20:21 +02:00
|
|
|
disabled: Webhook::EVENTS.filter { |event| !current_user.role.can?(Webhook.permission_for_event(event)) },
|
|
|
|
label_method: ->(event) { tag.samp(event) }
|
2022-06-09 21:57:36 +02:00
|
|
|
|
2023-09-28 16:23:35 +02:00
|
|
|
.fields-group
|
2024-03-15 12:19:00 +01:00
|
|
|
= form.input :template,
|
|
|
|
wrapper: :with_block_label,
|
|
|
|
input_html: { placeholder: '{ "content": "Hello {{object.username}}" }' }
|