Files
supermarket/internal/web/templates/billing.html
T
davidandClaude Opus 5.5 6d3eb18b5e Phase 14, parts 5 and 6: seats, and moving down to Free
Seats: inviting past the seats paid for offers the owner to add one
(Stripe prorates it); admins are told to ask the owner; Free has two.
Moving down: past the plan's seats, the owner and one other (the owner's
pick, or the first to join) edit and the rest read; storage is measured
hourly, and past the plan's, photo uploads and the SEO crawl stop.
Nothing is deleted. TEST.md section 18.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 13:34:22 -07:00

46 lines
3.4 KiB
HTML

{{define "content"}}{{template "settings-start" .}}{{with .Data}}
<h2>Billing</h2>
{{with .Problem}}<p class="error" role="alert">{{.}}</p>{{end}}
<section class="card">
<h3>{{.Plan.Name}}{{if eq .Account.Status "trialing"}} <span class="pill">trial</span>{{else if eq .Account.Status "past_due"}} <span class="pill warn">payment due</span>{{end}}{{if .ReadOnly}} <span class="pill warn">read-only</span>{{end}}</h3>
<dl class="facts">
{{if eq .Account.Status "trialing"}}<dt>Trial</dt><dd>until {{.Account.TrialEnds.Local.Format "2 Jan 2006"}}; then the Free plan, unless you subscribe</dd>{{end}}
{{if eq .Account.Status "past_due"}}<dt>Payment</dt><dd class="error-text">due since {{.Account.PastDueSince.Local.Format "2 Jan 2006"}}: after 14 days the team becomes read-only, after 60 it's deleted</dd>{{end}}
<dt>People</dt><dd>{{.People}}{{if .Plan.Seats}} of {{.Plan.Seats}}{{else if .Account.Seats}} · {{.Account.Seats}} paid for{{end}}</dd>
<dt>Agents</dt><dd>{{.Agents}} of {{.Plan.Agents}}</dd>
<dt>Storage</dt><dd>{{bytes .Storage}} of {{bytes .StorageOf}}</dd>
<dt>Crawl</dt><dd>{{.Plan.CrawlPages}} pages, {{.Plan.CrawlEvery}}</dd>
{{if .Owner}}{{with .Invoice}}<dt>Next invoice</dt><dd>{{money .AmountDue}} {{.Currency}}, {{.Date.Local.Format "2 Jan 2006"}}</dd>{{end}}{{with .InvoiceErr}}<dt>Next invoice</dt><dd class="muted small">{{.}}</dd>{{end}}{{end}}
</dl>
</section>
{{if .Kept}}
<section class="card">
<h3>Who keeps editing</h3>
<p>The {{.Plan.Name}} plan has {{.Plan.Seats}} people, and the team has {{.People}}. Everyone keeps their account and can read; only {{.Plan.Seats}} change things.{{if not .Owner}} The team's owner chooses who.{{end}} Nothing is deleted.</p>
<ul>{{range .Others}}<li>{{.Name}} &lt;{{.Email}}&gt;: {{if index $.Data.Kept .ID}}<strong>edits</strong>{{else}}<span class="muted">reads</span>{{end}}</li>{{end}}</ul>
{{if .Owner}}<form method="post" action="/settings/billing/keep" class="inline">
<label>Keeps editing, with you <select name="user">{{range .Others}}<option value="{{.ID}}"{{if index $.Data.Kept .ID}} selected{{end}}>{{.Name}}</option>{{end}}</select></label>
<button type="submit" class="secondary">Save</button>
</form>{{end}}
</section>
{{end}}
{{if .Owner}}
{{if ne .Account.Status "active"}}
<form class="card" method="post" action="/settings/billing/checkout">
<h3>Subscribe to {{.Paid.Name}}</h3>
<p>{{money (int64 .Paid.PerSeatCents)}} a person a month, for every module, {{.Paid.Agents}} agents, {{.Paid.StorageGBPerSeat}} GB per person, and a daily SEO crawl of up to {{.Paid.CrawlPages}} pages. Today that's {{.People}} {{if eq .People 1}}person{{else}}people{{end}}.</p>
{{if .Yearly}}<label class="check"><input type="radio" name="interval" value="month" checked> Monthly</label>
<label class="check"><input type="radio" name="interval" value="year"> Yearly</label>{{end}}
<button type="submit">Subscribe with Stripe</button>
</form>
{{end}}
<form class="card" method="post" action="/settings/billing/portal">
<h3>Payment and invoices</h3>
<p class="help">The card, the billing address, past invoices, and cancelling: on Stripe's page.</p>
<button type="submit" class="secondary" {{if not .Account.Customer}}disabled{{end}}>Open Stripe's billing page</button>
</form>
{{else}}
<section class="card"><p class="help">The team's owner manages the subscription and its payments.</p></section>
{{end}}
{{end}}{{template "settings-end"}}{{end}}