Files
member-console/internal/embeds/templates/partials/operator_subscriptions.html
2026-04-06 03:15:20 -05:00

69 lines
2.4 KiB
HTML

<!-- Subscriptions partial for operator -->
{{ if .Error }}
<div class="alert alert-danger" role="alert">
<strong>Error:</strong> {{ .Error }}
</div>
{{ else }}
{{ if eq (len .Subscriptions) 0 }}
<div class="text-center py-4">
<p class="text-muted mb-0">No subscriptions found.</p>
</div>
{{ else }}
<div class="table-responsive">
<table class="table table-hover table-sm">
<thead>
<tr>
<th>ID</th>
<th>Billing Account</th>
<th>Status</th>
<th>Current Period</th>
<th>Cancel at Period End</th>
<th>Stripe Sync</th>
<th>Created</th>
</tr>
</thead>
<tbody>
{{ range .Subscriptions }}
<tr>
<td><code class="small" title="{{ .SubscriptionID }}">{{ slice .SubscriptionID 0 8 }}...</code></td>
<td>{{ .BillingAccountName }}</td>
<td>
<span class="badge bg-{{ .StatusClass }}">{{ .Status }}</span>
</td>
<td>
{{ if .CurrentPeriodStart }}
{{ .CurrentPeriodStart }} → {{ .CurrentPeriodEnd }}
{{ else }}
<span class="text-muted"></span>
{{ end }}
</td>
<td>
{{ if .CancelAtPeriodEnd }}
<span class="badge bg-warning">Yes</span>
{{ else }}
<span class="badge bg-secondary">No</span>
{{ end }}
</td>
<td>
{{ if eq .StripeSyncStatus "synced" }}
<span class="badge bg-success">Synced</span>
{{ else if eq .StripeSyncStatus "pending" }}
<span class="badge bg-warning">Pending</span>
{{ else if eq .StripeSyncStatus "not_mapped" }}
<span class="badge bg-secondary">Not Mapped</span>
{{ else }}
<span class="badge bg-secondary">{{ .StripeSyncStatus }}</span>
{{ end }}
</td>
<td>{{ .CreatedAt }}</td>
</tr>
{{ end }}
</tbody>
</table>
</div>
<p class="text-muted small mt-2">Total: {{ len .Subscriptions }} subscriptions</p>
{{ end }}
{{ end }}