{{/* abono/owner-offers: GET /admin/offers, each plan with its prices (the one on sale, and old ones whose members keep the plan; a price billed other than every month or every year is marked unsupported, since it is never sold), and the paying subscriptions on a price no plan has, each with a form that puts it, and everyone else on its price, onto a plan. With Stripe on, a legacy price has a button that puts it back on sale, and a form adds an existing Stripe price to a plan, on sale or legacy. Data: Title string, the page title's message key On bool, Stripe (or the sandbox) is configured Offers []abono.Offer Unrecognised []abonoUnrecognised, {SubscriptionID, PriceID, Subject, Label, ...}; empty while Stripe is off PlanOptions []abonoOption, the plans, as field-select options AdoptAction string, where an adopt form posts PriceOptions []abonoOption, the plans, for the add-a-price form PriceForm abonoPriceForm, {Plan, Price, Sold}: that form as posted PriceAction string, where the add-a-price form and the put-on-sale buttons post StripeURL string, the Stripe page Done *abonoNotice, {Kind, N, Plan}: what the last action did Error string, a message key, or "" L the request's localizer */}} {{define "content"}}{{$L := localizer $}} {{template "page-header" dict "L" $L "Title" (T $L .Title) "Sub" (T $L "abono.owner.offers_intro")}} {{with .Done}}{{if eq .Kind "adopt"}}{{template "notice" (Tf $L "abono.owner.adopted" "plan" .Plan)}}{{end}}{{end}} {{with .Error}}{{template "callout" dict "L" $L "Tone" "negative" "Focus" true "Body" (T $L .)}}{{end}} {{if not .On}}
{{T $L "abono.owner.nothing_for_sale"}} {{T $L "abono.owner.stripe_title"}}
{{end}} {{range .Offers}}{{$plan := .Plan}}{{.ID}}{{if .Currency}}{{$m := money $L .Amount .Currency}} {{if .Unsupported}}{{$m}}{{else if eq .Interval "month"}}{{Tf $L "abono.price.per_month" "amount" $m}}{{else if eq .Interval "year"}}{{Tf $L "abono.price.per_year" "amount" $m}}{{else}}{{$m}}{{end}}{{end}} {{if .Sold}}{{template "badge" dict "L" $L "Label" (T $L "abono.owner.price_sold") "Tone" "positive"}}{{else}}{{template "badge" dict "L" $L "Label" (T $L "abono.owner.price_legacy")}}{{end}}{{if .Unsupported}} {{template "badge" dict "L" $L "Label" (T $L "abono.owner.price_unsupported") "Tone" "warning"}}{{end}}{{if and $.On (not .Sold) (not .Unsupported)}}
{{end}}{{T $L "abono.owner.unrecognised_body"}}
{{T $L "abono.owner.unrecognised_warn"}}
{{range .Unrecognised}} {{end}} {{else}}{{T $L "abono.owner.unrecognised_none"}}
{{end}}