Files
discourse-subscriptions/assets/javascripts/discourse/templates/components/create-coupon-form.hbs
T
Justin DiRose 400313cded FEATURE: Allow creation of coupons in admin panel (#43)
Adds full support to create coupon/promo codes in the Admin > Plugins > Subscriptions section of the plugin. The Create Coupon button opens a form on the same page, and the active checkboxes toggle the active status of the coupon code.
2021-01-13 11:47:22 -06:00

37 lines
1.1 KiB
Handlebars

<div class='create-coupon-form'>
<form class="form-horizontal">
<p>
<label for="promo_code">{{i18n 'discourse_subscriptions.admin.coupons.promo_code'}}</label>
{{input type="text" name="promo_code" value=promoCode}}
</p>
<p>
<label for="amount">{{i18n 'discourse_subscriptions.admin.coupons.discount'}}</label>
{{combo-box
content=discountTypes
value=discountType
onChange=(action (mut discountType))
}}
{{input class="discount-amount" type="text" name="amount" value=discount}}
</p>
<p>
<label for="active">
{{i18n 'discourse_subscriptions.admin.coupons.active'}}
</label>
{{input type="checkbox" name="active" checked=active}}
</p>
</form>
{{d-button
action=(action "createNewCoupon")
label="discourse_subscriptions.admin.coupons.create"
title="discourse_subscriptions.admin.coupons.create"
icon="plus"
class="btn-primary btn btn-icon"}}
{{d-button
action=(action "cancelCreate")
label="cancel"
title="cancel"
icon="times"
class="btn btn-icon"}}
</div>