2021-01-13 11:47:22 -06:00
|
|
|
{{#if model.unconfigured}}
|
2021-07-04 21:53:55 +02:00
|
|
|
<p>{{i18n "discourse_subscriptions.admin.unconfigured"}}</p>
|
2022-06-11 06:54:30 -04:00
|
|
|
<p>
|
2023-01-04 12:39:58 +00:00
|
|
|
<a href="https://meta.discourse.org/t/discourse-subscriptions/140818/">
|
2022-06-11 06:54:30 -04:00
|
|
|
{{i18n "discourse_subscriptions.admin.on_meta"}}
|
|
|
|
</a>
|
|
|
|
</p>
|
2021-01-13 11:47:22 -06:00
|
|
|
{{else}}
|
|
|
|
{{#if model}}
|
|
|
|
<table class="table discourse-patrons-table">
|
|
|
|
<thead>
|
2021-07-04 21:53:55 +02:00
|
|
|
<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>
|
2021-01-13 11:47:22 -06:00
|
|
|
</thead>
|
2021-07-04 21:53:55 +02:00
|
|
|
<tbody>
|
|
|
|
{{#each model as |coupon|}}
|
|
|
|
<tr>
|
|
|
|
<td>{{coupon.code}}</td>
|
|
|
|
<td>{{coupon.discount}}</td>
|
|
|
|
<td>{{coupon.times_redeemed}}</td>
|
2022-06-11 06:54:30 -04:00
|
|
|
<td>
|
2023-05-02 09:24:28 -05:00
|
|
|
<Input
|
|
|
|
@type="checkbox"
|
|
|
|
@checked={{coupon.active}}
|
|
|
|
{{on "click" (action "toggleActive" coupon)}}
|
|
|
|
/>
|
2022-06-11 06:54:30 -04:00
|
|
|
</td>
|
2021-07-04 21:53:55 +02:00
|
|
|
<td>
|
2023-05-02 09:24:28 -05:00
|
|
|
<DButton
|
|
|
|
@action={{this.deleteCoupon}}
|
|
|
|
@actionParam={{coupon}}
|
|
|
|
@icon="trash-alt"
|
2021-07-04 21:53:55 +02:00
|
|
|
class="btn-danger btn btn-icon btn-no-text"
|
2023-05-02 09:24:28 -05:00
|
|
|
/>
|
2021-07-04 21:53:55 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{{/each}}
|
|
|
|
</tbody>
|
2021-01-13 11:47:22 -06:00
|
|
|
</table>
|
|
|
|
{{/if}}
|
|
|
|
|
|
|
|
{{#unless creating}}
|
2023-05-02 09:24:28 -05:00
|
|
|
<DButton
|
|
|
|
@action={{this.openCreateForm}}
|
|
|
|
@label="discourse_subscriptions.admin.coupons.create"
|
|
|
|
@title="discourse_subscriptions.admin.coupons.create"
|
|
|
|
@icon="plus"
|
2021-07-04 21:53:55 +02:00
|
|
|
class="btn btn-icon btn-primary create-coupon"
|
2023-05-02 09:24:28 -05:00
|
|
|
/>
|
2021-01-13 11:47:22 -06:00
|
|
|
{{/unless}}
|
|
|
|
|
|
|
|
{{#if creating}}
|
2022-06-11 06:54:30 -04:00
|
|
|
{{create-coupon-form
|
|
|
|
cancel=(action "closeCreateForm")
|
|
|
|
create=(action "createNewCoupon")
|
|
|
|
}}
|
2021-01-13 11:47:22 -06:00
|
|
|
{{/if}}
|
2023-01-04 12:39:58 +00:00
|
|
|
{{/if}}
|