discourse/app/assets/javascripts/admin/addon/templates/web-hooks-show.hbs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

93 lines
4.0 KiB
Handlebars
Raw Normal View History

<LinkTo @route="adminWebHooks" class="go-back">
{{d-icon "arrow-left"}}
2016-06-16 01:49:57 +08:00
{{i18n "admin.web_hooks.go_back"}}
</LinkTo>
2016-06-16 01:49:57 +08:00
<div class="web-hook-container">
<p>{{i18n "admin.web_hooks.detailed_instruction"}}</p>
<form class="web-hook form-horizontal">
2021-09-20 21:52:03 +08:00
<div class="control-group">
2016-06-16 01:49:57 +08:00
<label for="payload-url">{{i18n "admin.web_hooks.payload_url"}}</label>
<TextField @name="payload-url" @value={{model.payload_url}} @placeholderKey="admin.web_hooks.payload_url_placeholder" />
<InputTip @validation={{urlValidation}} />
2016-06-16 01:49:57 +08:00
</div>
2021-09-20 21:52:03 +08:00
<div class="control-group">
2016-06-16 01:49:57 +08:00
<label for="content-type">{{i18n "admin.web_hooks.content_type"}}</label>
<ComboBox @content={{contentTypes}} @name="content-type" @value={{model.content_type}} @onChange={{action (mut model.content_type)}} />
2016-06-16 01:49:57 +08:00
</div>
2021-09-20 21:52:03 +08:00
<div class="control-group">
2016-06-16 01:49:57 +08:00
<label for="secret">{{i18n "admin.web_hooks.secret"}}</label>
<TextField @name="secret" @value={{model.secret}} @placeholderKey="admin.web_hooks.secret_placeholder" />
<InputTip @validation={{secretValidation}} />
2016-06-16 01:49:57 +08:00
</div>
2021-09-20 21:52:03 +08:00
<div class="control-group">
2016-06-16 01:49:57 +08:00
<label>{{i18n "admin.web_hooks.event_chooser"}}</label>
<div>
<RadioButton @class="subscription-choice" @name="subscription-choice" @value="individual" @selection={{model.webHookType}} />
2016-06-16 01:49:57 +08:00
{{i18n "admin.web_hooks.individual_event"}}
<InputTip @validation={{eventTypeValidation}} />
2016-06-16 01:49:57 +08:00
</div>
{{#unless model.wildcard_web_hook}}
<div class="event-selector">
{{#each eventTypes as |type|}}
<AdminWebHookEventChooser @type={{type}} @model={{model.web_hook_event_types}} />
2016-06-16 01:49:57 +08:00
{{/each}}
</div>
{{/unless}}
<div>
<RadioButton @class="subscription-choice" @name="subscription-choice" @value="wildcard" @selection={{model.webHookType}} />
2016-06-16 01:49:57 +08:00
{{i18n "admin.web_hooks.wildcard_event"}}
</div>
</div>
2021-09-20 21:52:03 +08:00
<div class="filters control-group">
2018-07-03 11:14:53 +08:00
<div class="filter">
<label>{{d-icon "circle" class="tracking"}}{{i18n "admin.web_hooks.categories_filter"}}</label>
<CategorySelector @categories={{model.categories}} @onChange={{action (mut model.categories)}} />
2016-06-16 01:49:57 +08:00
<div class="instructions">{{i18n "admin.web_hooks.categories_filter_instructions"}}</div>
</div>
{{#if showTagsFilter}}
<div class="filter">
<label>{{d-icon "circle" class="tracking"}}{{i18n "admin.web_hooks.tags_filter"}}</label>
<TagChooser @tags={{model.tag_names}} @everyTag={{true}} @excludeSynonyms={{true}} />
<div class="instructions">{{i18n "admin.web_hooks.tags_filter_instructions"}}</div>
</div>
{{/if}}
2018-07-03 11:14:53 +08:00
<div class="filter">
<label>{{d-icon "circle" class="tracking"}}{{i18n "admin.web_hooks.groups_filter"}}</label>
<GroupSelector @groupNames={{model.groupsFilterInName}} @groupFinder={{model.groupFinder}} />
2016-06-16 01:49:57 +08:00
<div class="instructions">{{i18n "admin.web_hooks.groups_filter_instructions"}}</div>
</div>
</div>
<PluginOutlet @name="web-hook-fields" @tagName="span" @connectorTagName="div" @args={{hash model=model}} />
2016-06-16 01:49:57 +08:00
<div>
<Input @type="checkbox" @name="verify_certificate" @checked={{model.verify_certificate}} /> {{i18n "admin.web_hooks.verify_certificate"}}
2016-06-16 01:49:57 +08:00
</div>
<div>
<div>
<Input @type="checkbox" @name="active" @checked={{model.active}} /> {{i18n "admin.web_hooks.active"}}
2016-06-16 01:49:57 +08:00
</div>
{{#if model.active}}
<div class="instructions">{{i18n "admin.web_hooks.active_notice"}}</div>
{{/if}}
</div>
</form>
<div class="controls">
<DButton @class="btn-default" @translatedLabel={{saveButtonText}} @action={{action "save"}} @disabled={{saveButtonDisabled}} />
2016-06-16 01:49:57 +08:00
{{#unless model.isNew}}
<DButton @class="btn-danger" @label="admin.web_hooks.destroy" @action={{action "destroy"}} />
<LinkTo @route="adminWebHooks.showEvents" @model={{model.id}} class="btn">
2016-06-16 01:49:57 +08:00
{{i18n "admin.web_hooks.events.go_events"}}
</LinkTo>
2016-06-16 01:49:57 +08:00
{{/unless}}
<span class="saving">{{savingStatus}}</span>
</div>
</div>