Files
discourse-subscriptions/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-subscriptions.hbs
T
Justin DiRose b92627677f FEATURE: Implement refunds from dashboard (#27)
An implementation of refunds from the Admin dashboard. To refund, go to Plugins > Subscriptions > Subscriptions then click the `Cancel` button. You'll be presented with a modal. If you wish to refund only the most recent payment, check the box. 

This only implements refunds for Subscriptions, not One Time Payments. One Time Payments will still need to be handled manually at this time.
2020-10-29 10:31:12 -05:00

44 lines
1.9 KiB
Handlebars

{{#if model.unconfigured}}
<p>{{i18n 'discourse_subscriptions.admin.unconfigured'}}</p>
<p><a href="https://meta.discourse.org/t/discourse-subscriptions/140818/">Discourse Subscriptions on Meta</a></p>
{{else}}
<table class="table discourse-patrons-table">
<thead>
<tr>
<th>{{i18n 'discourse_subscriptions.admin.subscriptions.subscription.user'}}</th>
<th>{{i18n 'discourse_subscriptions.admin.subscriptions.subscription.subscription_id'}}</th>
<th>{{i18n 'discourse_subscriptions.admin.subscriptions.subscription.customer'}}</th>
<th>{{i18n 'discourse_subscriptions.admin.subscriptions.subscription.product'}}</th>
<th>{{i18n 'discourse_subscriptions.admin.subscriptions.subscription.plan'}}</th>
<th>{{i18n 'discourse_subscriptions.admin.subscriptions.subscription.status'}}</th>
<th class="td-right">{{i18n 'discourse_subscriptions.admin.subscriptions.subscription.created_at'}}</th>
<th></th>
</tr>
</thead>
{{#each model as |subscription|}}
<tr>
<td>
{{#if subscription.metadataUserExists}}
<a href="{{unbound subscription.subscriptionUserPath}}">
{{subscription.metadata.username}}
</a>
{{/if}}
</td>
<td>{{subscription.id}}</td>
<td>{{subscription.customer}}</td>
<td>{{subscription.plan.product.name}}</td>
<td>{{subscription.plan.nickname}}</td>
<td>{{subscription.status}}</td>
<td class="td-right">{{format-unix-date subscription.created}}</td>
<td class="td-right">
{{#if subscription.loading}}
{{loading-spinner size="small"}}
{{else}}
{{d-button disabled=subscription.canceled label="cancel" action=(action "showCancelModal" subscription) icon="times"}}
{{/if}}
</td>
</tr>
{{/each}}
</table>
{{/if}}