discourse-subscriptions/assets/javascripts/discourse/templates/admin/plugins-discourse-subscript...

61 lines
1.9 KiB
Handlebars
Raw Permalink Normal View History

2024-11-20 12:34:34 -05:00
{{#if this.model.unconfigured}}
<p>{{i18n "discourse_subscriptions.admin.unconfigured"}}</p>
<p>
<a href="https://meta.discourse.org/t/discourse-subscriptions/140818/">
{{i18n "discourse_subscriptions.admin.on_meta"}}
</a>
</p>
{{else}}
2024-11-20 12:34:34 -05:00
{{#if this.model}}
<table class="table discourse-patrons-table">
<thead>
<th>{{i18n "discourse_subscriptions.admin.coupons.code"}}</th>
<th>{{i18n "discourse_subscriptions.admin.coupons.discount"}}</th>
<th>{{i18n "discourse_subscriptions.admin.coupons.times_redeemed"}}</th>
<th>{{i18n "discourse_subscriptions.admin.coupons.active"}}</th>
<th>{{i18n "discourse_subscriptions.admin.coupons.actions"}}</th>
</thead>
<tbody>
2024-11-20 12:34:34 -05:00
{{#each this.model as |coupon|}}
<tr>
<td>{{coupon.code}}</td>
<td>{{coupon.discount}}</td>
<td>{{coupon.times_redeemed}}</td>
<td>
2023-05-02 10:24:28 -04:00
<Input
@type="checkbox"
@checked={{coupon.active}}
{{on "click" (action "toggleActive" coupon)}}
/>
</td>
<td>
2023-05-02 10:24:28 -04:00
<DButton
@action={{action "deleteCoupon"}}
2023-05-02 10:24:28 -04:00
@actionParam={{coupon}}
@icon="trash-alt"
class="btn-danger btn btn-icon btn-no-text"
2023-05-02 10:24:28 -04:00
/>
</td>
</tr>
{{/each}}
</tbody>
</table>
{{/if}}
2024-11-20 12:34:34 -05:00
{{#unless this.creating}}
2023-05-02 10:24:28 -04:00
<DButton
@action={{action "openCreateForm"}}
2023-05-02 10:24:28 -04:00
@label="discourse_subscriptions.admin.coupons.create"
@title="discourse_subscriptions.admin.coupons.create"
@icon="plus"
class="btn btn-icon btn-primary create-coupon"
2023-05-02 10:24:28 -04:00
/>
{{/unless}}
2024-11-20 12:34:34 -05:00
{{#if this.creating}}
2023-05-28 10:32:27 -04:00
<CreateCouponForm
@cancel={{action "closeCreateForm"}}
@create={{action "createNewCoupon"}}
/>
{{/if}}
{{/if}}