discourse-subscriptions/assets/javascripts/discourse/templates/components/stripe-card.hbs

74 lines
2.2 KiB
Handlebars

<form id="payment-form" class="form-horizontal">
<div class="control-group">
<label class="control-label" for="card-element">
{{i18n 'discourse_donations.amount'}}
{{settings.discourse_donations_currency}}
</label>
<div class="controls controls-dropdown">
{{combo-box valueAttribute="value" content=donateAmounts value=amount}}
</div>
</div>
<div class="control-group" style="width: 550px;">
<label class="control-label" for="card-element">{{i18n 'discourse_donations.card'}}</label>
<div id="card-element" class="controls"></div>
</div>
{{#if anon}}
<div class="control-group">
<label class="control-label" for="card-element">{{i18n 'user.email.title'}}</label>
<div class="controls">
{{text-field value=email}}
</div>
</div>
{{#if create_accounts}}
<div class="control-group">
<label class="control-label" for="card-element">{{i18n 'user.username.title'}}</label>
<div class="controls">
{{text-field value=username}}
</div>
</div>
<div class="control-group">
<label class="control-label" for="card-element">{{i18n 'user.name.title'}}</label>
<div class="controls">
{{text-field value=name}}
</div>
</div>
<div class="control-group">
<label class="control-label" for="card-element">{{i18n 'user.password.title'}}</label>
<div class="controls">
{{input type="password" value=password}}
</div>
</div>
{{/if}}
{{/if}}
<div class="control-group save-button">
<div class="controls">
{{#d-button action="submitStripeCard" disabled=transactionInProgress class="btn btn-primary btn-payment"}}
{{#if create_accounts}}
{{i18n 'discourse_donations.submit_with_create_account'}}
{{else}}
{{i18n 'discourse_donations.submit'}}
{{/if}}
{{/d-button}}
{{#if transactionInProgress}}
{{loading-spinner size="small"}}
{{/if}}
{{#each result as |message|}}
<p>{{{message}}}</p>
{{/each}}
{{#if success}}
<p>{{i18n 'discourse_donations.messages.success'}}</p>
{{/if}}
</div>
</div>
</form>