{{ trans('settings.webhooks_details_desc') }}

@include('form.toggle-switch', [ 'name' => 'active', 'value' => old('active') ?? $model->active ?? true, 'label' => trans('settings.webhooks_active'), ]) @include('form.errors', ['name' => 'active'])
@include('form.text', ['name' => 'name'])
@include('form.text', ['name' => 'endpoint'])
@include('form.number', ['name' => 'timeout', 'min' => 1, 'max' => 600])
@include('form.errors', ['name' => 'events'])

{{ trans('settings.webhooks_events_desc') }}

{{ trans('settings.webhooks_events_warning') }}

@include('form.custom-checkbox', [ 'name' => 'events[]', 'value' => 'all', 'label' => trans('settings.webhooks_events_all'), 'checked' => old('events') ? in_array('all', old('events')) : (isset($webhook) ? $webhook->tracksEvent('all') : false), ])

@foreach(\BookStack\Actions\ActivityType::all() as $activityType)
@include('form.custom-checkbox', [ 'name' => 'events[]', 'value' => $activityType, 'label' => $activityType, 'checked' => old('events') ? in_array($activityType, old('events')) : (isset($webhook) ? $webhook->tracksEvent($activityType) : false), ])
@endforeach