Files
member-console/internal/embeds/templates/partials/operator_subscriptions.html
T

70 lines
3.0 KiB
HTML

{{- /* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial */ -}}
{{- /* SPDX-FileCopyrightText: 2025-2026 Christian Galo */ -}}
{{/* operator_subscriptions.html
Subscriptions view inside the operator_billing.html wrapper (which
owns the page header). Built from the page-anatomy parts: states
through statusBadge, the empty and blocked states through emptyState.
The organization is the row's subject and leads as the row header
(chrome-conventions); cancel-at-period-end is an exception marker
beside the status, the always-"Default" billing account name and the
truncated ID column are retired (maintainer, 2026-08-30); a
subscription has no detail page today, so no cell links its own. */}}
{{ if .Error }}
<div class="alert alert-danger" role="alert">
<strong>Error:</strong> {{ .Error }}
</div>
{{ else }}
{{ template "environmentNotice" .EnvNotice }}
{{ if eq (len .Subscriptions) 0 }}
{{ if .Nav.Filtered }}
{{ template "listControls" .Nav }}
{{ template "listNoMatch" .Nav }}
{{ else }}
{{ template "emptyState" .Empty }}
{{ end }}
{{ else }}
{{ template "listControls" .Nav }}
<div class="table-responsive">
<table class="table table-hover table-sm table-record">
<thead>
<tr>
<th>Organization</th>
<th>Status</th>
<th>Current period</th>
<th>Created</th>
<th>Stripe sync {{ template "helpIcon" (helpIcon "Stripe sync" "Whether the row has a linked Stripe object. Not mapped means none is linked yet; that is expected when Stripe is not configured or a sync has not run. Check the Stripe integration settings before assuming something is broken.") }}</th>
</tr>
</thead>
<tbody>
{{ range .Subscriptions }}
<tr>
<th scope="row">
{{ if .OrgName }}
<a href="{{ routeURL "/operator/organizations/{orgID}" .OrgID }}">{{ .OrgName }}</a>
{{ else }}
<span class="text-muted">{{ .OrgID }}</span>
{{ end }}{{ if .EnvState }}<span class="ms-1">{{ template "statusBadge" .EnvBadge }}</span>{{ end }}
</th>
<td>
{{ template "statusBadge" .StatusBadge }}
{{ if .CancelAtPeriodEnd }}{{ template "statusBadge" .CancelingBadge }}{{ end }}
</td>
<td class="text-nowrap">
{{ if .CurrentPeriodStart }}
{{ .CurrentPeriodStart }} to {{ .CurrentPeriodEnd }}
{{ else }}
<span class="text-muted"></span>
{{ end }}
</td>
<td class="text-nowrap">{{ .CreatedAt }}</td>
<td>{{ template "statusBadge" .SyncBadge }}</td>
</tr>
{{ end }}
</tbody>
</table>
</div>
{{ template "listPager" .Nav }}
{{ end }}
{{ end }}