feat(billing): polish the add-ons page after the first review #184
No reviewers
Labels
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
codefloe/forgejo-codefloe!184
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/billing-page-feedback"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Address the first round of feedback on the Creem add-ons page from #180.
Changes
templates/shared/codefloe_billing.tmpl: put the price on its own line instead of joining it with " · ", keep the quantity field 5rem wide on one row with its label and the Buy button, add a Billing section at the top with one "Manage billing" button, show named quota rows instead of<code>size:repos:all</code>, and add athemefield to the checkout forms.templates/shared/codefloe_billing_list.tmpl: drop the per-add-on "Manage billing" button; other owners of an organisation still see "Billed to ".routers/web/shared/codefloe_billing.go: say "Each unit adds 10 GiB of storage" for storage and "adds 1000 minutes per month" for CI time, name each limit row, show the Billing section to anyone who ever bought an add-on, and append?theme=light|darkto the Creem checkout URL when the form reports it.routers/web/shared/codefloe_quota_ci.go:prettyLimitSubjectnames any limit subject, mirroring the upstream storage overview's closure, which stays untouched.services/codefloe/billing/catalog.go: write whole prices without cents ("5 EUR"), others with them ("5.50 EUR").services/codefloe/billing/actions.go,models/codefloe/billing/addon.go:PortalLink(ctx, doer)opens the doer's own Creem customer portal, found from the newest add-on they paid for (any owner, any status).ErrNotBuyerbecomesErrNoCustomer.routers/web/web.go:POST .../settings/addons/{id}/portalbecomesPOST .../settings/addons/portalfor users and organisations.web_src/js/codefloe/billing-checkout.js: fill the checkout form'sthemeon submit fromisDarkTheme(), so an automatic theme follows the browser.options/locale_next/locale_en-US.json: new and reworded strings.README.md: update the "Billing add-ons" row.models/quota/addon_codefloe_test.go,custom/conf/app.example.ini: test and document a shared asset pool, a product namingsize:assets:allplus the subjects under it. It raises the pool rule, which bounds the total, and each per-type cap, so a 5 GiB pack can go to packages, attachments or artifacts in any mix. No code is needed for it.Behaviour change
Not in this PR
The product line-up and prices live in the infrastructure repository and Creem: IaC #297 now sells
git-2g(2 GiB Git storage, EUR 1.00) andassets-5g(5 GiB asset storage as a shared pool, EUR 1.00) next toci-1000on dev.Validation
go testformodels/codefloe/billing,services/codefloe/billingandservices/codefloe/quota_storagepass.TestBilling|TestAPIQuota|TestQuota|TestActionsQuotaCI|TestCodefloe(284 tests, 19 of themTestBilling*) pass.codefloe-billing.test.e2e.tspasses in Chromium, Firefox and Mobile Chrome.vitestforbilling-checkout.test.jspasses;make lint-goon the pinned go1.26.7 andprek run -apass.181bcbbc72a882303404a882303404d54f481929