{{/* 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}}

{{.Name}}

{{else}}{{template "empty-state" dict "L" $L "Body" (T $L "abono.owner.offers_empty")}} {{end}} {{if and .On .Offers}}

{{T $L "abono.owner.add_price_title"}}

{{template "field-select" dict "L" $L "ID" "abono-add-price-plan" "Name" "plan" "Label" (T $L "abono.owner.adopt_plan") "Options" .PriceOptions "Required" true}} {{template "field-text" dict "L" $L "Name" "price" "Label" (T $L "abono.owner.add_price_id") "Value" .PriceForm.Price "Required" true "Autocomplete" "off"}} {{template "field-check" dict "Name" "sold" "Value" "1" "Label" (T $L "abono.owner.price_sold") "Checked" .PriceForm.Sold}} {{template "form-foot" dict "L" $L "Submit" (T $L "abono.button.add_price")}}
{{end}} {{if .On}}

{{T $L "abono.owner.unrecognised_title"}}

{{if .Unrecognised}}

{{T $L "abono.owner.unrecognised_body"}}

{{T $L "abono.owner.unrecognised_warn"}}

{{range .Unrecognised}}

{{.SubscriptionID}} {{.PriceID}} {{.Label}}

{{template "field-select" dict "L" $L "ID" (printf "abono-adopt-%s" .SubscriptionID) "Name" "plan" "Label" (T $L "abono.owner.adopt_plan") "Options" $.PlanOptions "Required" true}}
{{end}} {{else}}

{{T $L "abono.owner.unrecognised_none"}}

{{end}}
{{end}} {{end}}