discourse/app/assets/javascripts/admin/addon/templates/web-hooks-index.hbs
Ella E. 37f032752e
UX: Apply admin table to webhooks (#30317)
* UX: Apply admin table classes for consistent mobile styling on the web hooks page

* DEV: Remove icon on the status component; update status classes

* DEV: Update tests for webhook status component

* DEV: add space var with a smaller value

* DEV: Add styling for different status labels
2024-12-17 08:52:29 -07:00

80 lines
2.7 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="d-admin-table web-hooks">
<thead>
<tr>
<th>{{i18n "admin.web_hooks.payload_url"}}</th>
<th>{{i18n "admin.web_hooks.description_label"}}</th>
<th>{{i18n "admin.web_hooks.delivery_status.title"}}</th>
<th></th>
</tr>
</thead>
<tbody>
{{#each this.model as |webhook|}}
<tr class="d-admin-row__content">
<td class="d-admin-row__overview payload-url">
<LinkTo @route="adminWebHooks.edit" @model={{webhook}}>
{{webhook.payload_url}}
</LinkTo>
</td>
<td class="d-admin-row__detail description">
<div class="d-admin-row__mobile-label">
{{i18n "admin.web_hooks.description_label"}}
</div>
{{webhook.description}}
</td>
<td class="d-admin-row__detail delivery-status">
<div class="d-admin-row__mobile-label">
{{i18n "admin.web_hooks.delivery_status.title"}}
</div>
<LinkTo @route="adminWebHooks.show" @model={{webhook}}>
<WebhookStatus
@deliveryStatuses={{this.deliveryStatuses}}
@webhook={{webhook}}
/>
</LinkTo>
</td>
<td class="d-admin-row__controls controls">
<div class="d-admin-row__controls-options">
<LinkTo
@route="adminWebHooks.edit"
@model={{webhook}}
class="btn btn-default no-text"
title={{i18n "admin.web_hooks.edit"}}
>
{{d-icon "far-pen-to-square"}}
</LinkTo>
<DButton
@action={{fn this.destroyWebhook webhook}}
@icon="xmark"
@title="delete"
class="destroy btn-danger"
/>
</div>
</td>
</tr>
{{/each}}
</tbody>
</table>
<ConditionalLoadingSpinner @condition={{this.model.loadingMore}} />
</LoadMore>
{{else}}
<p>{{i18n "admin.web_hooks.none"}}</p>
{{/if}}
</div>