tidy up the user subscription list

This commit is contained in:
Rimian Perkins 2019-12-05 14:59:07 +11:00
parent 42b79fdaaa
commit 7db60e2c4b
2 changed files with 40 additions and 32 deletions

View File

@ -1,33 +1,35 @@
{{i18n 'discourse_subscriptions.user.subscriptions.title'}}
{{#d-section pageClass="user-subscriptions" class="user-content"}}
<h2>{{i18n 'discourse_subscriptions.user.subscriptions.title'}}</h2>
{{#if model}}
<table class="table discourse-patrons-user-table">
<thead>
<th>{{i18n 'discourse_subscriptions.user.subscriptions.id'}}</th>
<th>{{i18n 'discourse_subscriptions.user.plans.product'}}</th>
<th>{{i18n 'discourse_subscriptions.user.plans.rate'}}</th>
<th>{{i18n 'discourse_subscriptions.user.subscriptions.status'}}</th>
<th>{{i18n 'discourse_subscriptions.user.subscriptions.created_at'}}</th>
<th></th>
</thead>
{{#each model as |subscription|}}
<tr>
<td>{{subscription.id}}</td>
<td>{{subscription.product.name}}</td>
<td>{{subscription.plan.subscriptionRate}}</td>
<td>{{subscription.status}}</td>
<td>{{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=(route-action "cancelSubscription" subscription) icon="times"}}
{{/if}}
</td>
</tr>
{{/each}}
</table>
{{else}}
<p>{{i18n 'discourse_subscriptions.user.subscriptions_help'}}</p>
{{/if}}
{{#if model}}
<table class="table discourse-subscriptions-user-table">
<thead>
<th>{{i18n 'discourse_subscriptions.user.subscriptions.id'}}</th>
<th>{{i18n 'discourse_subscriptions.user.plans.product'}}</th>
<th>{{i18n 'discourse_subscriptions.user.plans.rate'}}</th>
<th>{{i18n 'discourse_subscriptions.user.subscriptions.status'}}</th>
<th>{{i18n 'discourse_subscriptions.user.subscriptions.created_at'}}</th>
<th></th>
</thead>
{{#each model as |subscription|}}
<tr>
<td>{{subscription.id}}</td>
<td>{{subscription.product.name}}</td>
<td>{{subscription.plan.subscriptionRate}}</td>
<td>{{subscription.status}}</td>
<td>{{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=(route-action "cancelSubscription" subscription) icon="times"}}
{{/if}}
</td>
</tr>
{{/each}}
</table>
{{else}}
<p>{{i18n 'discourse_subscriptions.user.subscriptions_help'}}</p>
{{/if}}
{{/d-section}}

View File

@ -28,12 +28,18 @@ textarea[readonly] {
text-align: right;
}
table.discourse-patrons-user-table {
table.discourse-subscriptions-user-table {
width: 100%;
th,
td {
padding: 10px;
}
th:first-child,
td:first-child,
th:last-child,
td:last-child {
padding-left: 0;
}
}
.desc {