This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/admin/addon/templates/web-hooks-index.hbs
Jarek Radosz f9bdda84ca
DEV: Admin webhooks interface issues (#19360)
1. The events table had broken styling, making each row overflow
2. It had confusing routes: `/:id` for "edit" and `/:id/events` for "show" (now it's `/:id/edit` and `/:id` respectively)
3. There previously was an unused backend action (`#edit`) - now it is used (and `web_hooks/:id/events` route has been removed)
4. There was outdated/misplaced/duplicated CSS
5. And more
2022-12-13 01:53:08 +01:00

69 lines
2.2 KiB
Handlebars

<div class="web-hooks-listing">
<p>{{i18n "admin.web_hooks.instruction"}}</p>
<div class="new-webhook">
<LinkTo
@route="adminWebHooks.edit"
@model="new"
class="btn btn-default admin-webhooks__new-button"
>
{{d-icon "plus"}}
{{i18n "admin.web_hooks.new"}}
</LinkTo>
</div>
{{#if this.model}}
<LoadMore @selector=".web-hooks tr" @action={{this.loadMore}}>
<table class="web-hooks grid">
<thead>
<tr>
<th>{{i18n "admin.web_hooks.delivery_status.title"}}</th>
<th>{{i18n "admin.web_hooks.payload_url"}}</th>
<th>{{i18n "admin.web_hooks.description_label"}}</th>
<th>{{i18n "admin.web_hooks.controls"}}</th>
</tr>
</thead>
<tbody>
{{#each this.model as |webHook|}}
<tr>
<td class="delivery-status">
<LinkTo @route="adminWebHooks.show" @model={{webHook}}>
<AdminWebHookStatus
@deliveryStatuses={{this.deliveryStatuses}}
@model={{webHook}}
/>
</LinkTo>
</td>
<td class="payload-url">
<LinkTo @route="adminWebHooks.edit" @model={{webHook}}>{{webHook.payload_url}}</LinkTo>
</td>
<td class="description">{{webHook.description}}</td>
<td class="controls">
<LinkTo
@route="adminWebHooks.edit"
@model={{webHook}}
class="btn btn-default no-text"
title={{i18n "admin.web_hooks.edit"}}
>
{{d-icon "far-edit"}}
</LinkTo>
<DButton
@class="destroy btn-danger"
@action={{this.destroy}}
@actionParam={{webHook}}
@icon="times"
@title="delete"
/>
</td>
</tr>
{{/each}}
</tbody>
</table>
<ConditionalLoadingSpinner @condition={{this.model.loadingMore}} />
</LoadMore>
{{else}}
<p>{{i18n "admin.web_hooks.none"}}</p>
{{/if}}
</div>