NOW MANAGED ON CODEBERG
Added webhook format example to webhook management views
Dan Brown3bf34b6a0dbe
diff --git a/resources/lang/en/settings.php b/resources/lang/en/settings.phpindex 3556fcf64..1cca516c8 100755--- a/resources/lang/en/settings.php+++ b/resources/lang/en/settings.php@@ -252,6 +252,8 @@ return ['webhooks_delete' => 'Delete Webhook','webhooks_delete_warning' => 'This will fully delete this webhook, with the name \':webhookName\', from the system.','webhooks_delete_confirm' => 'Are you sure you want to delete this webhook?',+ 'webhooks_format_example' => 'Webhook Format Example',+ 'webhooks_format_example_desc' => 'Webhook data is sent as a POST request to the configured endpoint as JSON following the format below. The "related_item" and "url" properties are optional and will depend on the type of event triggered.',//! If editing translations files directly please ignore this in all//! languages apart from en. Content will be auto-copied from en.diff --git a/resources/views/settings/webhooks/create.blade.php b/resources/views/settings/webhooks/create.blade.phpindex d5fd1d38d..4f20dd077 100644--- a/resources/views/settings/webhooks/create.blade.php+++ b/resources/views/settings/webhooks/create.blade.php@@ -11,6 +11,8 @@<form action="{{ url("/settings/webhooks/create") }}" method="POST">@include('settings.webhooks.parts.form', ['title' => trans('settings.webhooks_create')])</form>++ @include('settings.webhooks.parts.format-example')</div>@stopdiff --git a/resources/views/settings/webhooks/edit.blade.php b/resources/views/settings/webhooks/edit.blade.phpindex a221b4ce7..3b297eb7b 100644--- a/resources/views/settings/webhooks/edit.blade.php+++ b/resources/views/settings/webhooks/edit.blade.php@@ -11,6 +11,8 @@{!! method_field('PUT') !!}@include('settings.webhooks.parts.form', ['model' => $webhook, 'title' => trans('settings.webhooks_edit')])</form>++ @include('settings.webhooks.parts.format-example')</div>@stopdiff --git a/resources/views/settings/webhooks/parts/format-example.blade.php b/resources/views/settings/webhooks/parts/format-example.blade.phpnew file mode 100644index 000000000..135d3193b--- /dev/null+++ b/resources/views/settings/webhooks/parts/format-example.blade.php@@ -0,0 +1,34 @@+<div component="code-highlighter" class="card content-wrap auto-height">+ <h2 class="list-heading">{{ trans('settings.webhooks_format_example') }}</h2>+ <p>{{ trans('settings.webhooks_format_example_desc') }}</p>+ <pre><code class="language-json">{+ "event": "page_update",+ "text": "Benny updated page \"My wonderful updated page\"",+ "triggered_at": "2021-12-11T22:25:10.000000Z",+ "triggered_by": {+ "id": 1,+ "name": "Benny",+ "slug": "benny"+ },+ "triggered_by_profile_url": "https://bookstack.local/user/benny",+ "webhook_id": 2,+ "webhook_name": "My page update webhook",+ "url": "https://bookstack.local/books/my-awesome-book/page/my-wonderful-updated-page",+ "related_item": {+ "id": 2432,+ "book_id": 13,+ "chapter_id": 554,+ "name": "My wonderful updated page",+ "slug": "my-wonderful-updated-page",+ "priority": 2,+ "created_at": "2021-12-11T21:53:24.000000Z",+ "updated_at": "2021-12-11T22:25:10.000000Z",+ "created_by": 1,+ "updated_by": 1,+ "draft": false,+ "revision_count": 9,+ "template": false,+ "owned_by": 1+ }+}</code></pre>+</div>\ No newline at end of file