rastrillo / abono Public

Clone
git clone https://amadan.net/rastrillo/abono

Plain git — no account needed to clone.

Download

Download this file

1{{/* abono/plan: GET /subscribe/{plan}, one plan with a card per interval
2 it is sold at and a promotion code field, and the page a failed
3 POST /subscribe/{plan} comes back to with its message.
4
5 Data:
6 Title string, the page title's message key
7 Open bool, something is for sale
8 Cards []abonoCard, this plan's cards; none when the plan is
9 not on sale
10 SignedIn bool
11 PlansURL string, the pricing page
12 Error string, a message key, or ""
13 L the request's localizer */}}
14{{define "content"}}{{$L := localizer $}}
15{{template "back-nav" dict "Href" .PlansURL "Label" (T $L "abono.pages.plan_back")}}
16{{if .Cards}}{{$offer := (index .Cards 0).Offer}}
17{{if gt (len .Cards) 1}}{{template "page-header" dict "L" $L "Title" $offer.Name "Sub" (T $L "abono.pages.plan_intro")}}{{else}}{{template "page-header" dict "L" $L "Title" $offer.Name}}{{end}}
18{{with .Error}}{{template "callout" dict "L" $L "Tone" "negative" "Focus" true "Body" (T $L .)}}{{end}}
19{{range .Cards}}{{template "abono-plan-card" dict "L" $L "Offer" .Offer "Interval" .Interval "Action" .Action "Code" true}}
20{{end}}
21{{if not .SignedIn}}<p>{{T $L "abono.pages.plan_signed_out"}}</p>{{end}}
22{{else if .Open}}
23{{template "page-header" dict "L" $L "Title" (T $L "abono.pages.pricing_title")}}
24{{with .Error}}{{template "callout" dict "L" $L "Tone" "negative" "Focus" true "Body" (T $L .)}}{{end}}
25{{else}}
26{{template "page-header" dict "L" $L "Title" (T $L "abono.pages.pricing_title")}}
27{{with .Error}}{{template "callout" dict "L" $L "Tone" "negative" "Focus" true "Body" (T $L .)}}{{end}}
28{{template "empty-state" dict "L" $L "Title" (T $L "abono.pages.closed_title") "Body" (T $L "abono.pages.closed_body")}}
29{{end}}
30{{end}}
31