All checks were successful
Build and Release / Create Release (push) Successful in 0s
Build and Release / Unit Tests (push) Successful in 3m10s
Build and Release / Integration Tests (PostgreSQL) (push) Successful in 5m13s
Build and Release / Lint (push) Successful in 5m25s
Build and Release / Build Binaries (amd64, linux, linux-latest) (push) Successful in 3m13s
Build and Release / Build Binaries (amd64, windows, windows-latest) (push) Successful in 8h5m42s
Build and Release / Build Binaries (amd64, darwin, macos) (push) Successful in 7m30s
Build and Release / Build Binaries (arm64, darwin, macos) (push) Successful in 7m55s
Build and Release / Build Binary (linux/arm64) (push) Successful in 7m36s
Implement complete subscription monetization system for repositories with Stripe and PayPal integration. Includes: - Database models and migrations for monetization settings, subscription products, and user subscriptions - Payment provider abstraction layer with Stripe and PayPal implementations - Admin UI for configuring payment providers and viewing subscriptions - Repository settings UI for managing subscription products and tiers - Subscription checkout flow and webhook handlers for payment events - Access control to gate repository code behind active subscriptions
101 lines
3.5 KiB
Handlebars
101 lines
3.5 KiB
Handlebars
{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings subscriptions products")}}
|
|
<div class="repo-setting-content">
|
|
<h4 class="ui top attached header">
|
|
{{ctx.Locale.Tr "repo.settings.subscriptions.products"}}
|
|
</h4>
|
|
<div class="ui attached segment">
|
|
{{if .Products}}
|
|
<table class="ui very basic striped table">
|
|
<thead>
|
|
<tr>
|
|
<th>{{ctx.Locale.Tr "repo.settings.subscriptions.product_name"}}</th>
|
|
<th>{{ctx.Locale.Tr "repo.settings.subscriptions.product_type"}}</th>
|
|
<th>{{ctx.Locale.Tr "repo.settings.subscriptions.product_price"}}</th>
|
|
<th>{{ctx.Locale.Tr "repo.settings.subscriptions.product_status"}}</th>
|
|
<th></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{{range .Products}}
|
|
<tr>
|
|
<td>{{.Name}}</td>
|
|
<td>
|
|
{{if eq .Type 1}}Monthly
|
|
{{else if eq .Type 2}}Yearly
|
|
{{else if eq .Type 3}}Lifetime
|
|
{{end}}
|
|
</td>
|
|
<td>{{.PriceCents}} {{.Currency}}</td>
|
|
<td>
|
|
{{if .IsActive}}
|
|
<span class="ui small label green">Active</span>
|
|
{{else}}
|
|
<span class="ui small label grey">Inactive</span>
|
|
{{end}}
|
|
</td>
|
|
<td class="right aligned">
|
|
<form method="post" action="{{$.RepoLink}}/settings/subscriptions/products/delete">
|
|
{{$.CsrfTokenHtml}}
|
|
<input type="hidden" name="id" value="{{.ID}}">
|
|
<button class="ui red tiny button">{{svg "octicon-trash" 14}} {{ctx.Locale.Tr "remove"}}</button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
{{end}}
|
|
</tbody>
|
|
</table>
|
|
{{else}}
|
|
<div class="ui placeholder segment">
|
|
<div class="ui icon header">
|
|
{{svg "octicon-package" 48}}
|
|
<div class="content">
|
|
{{ctx.Locale.Tr "repo.settings.subscriptions.no_products"}}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{{end}}
|
|
</div>
|
|
|
|
<h4 class="ui top attached header">
|
|
{{ctx.Locale.Tr "repo.settings.subscriptions.add_product"}}
|
|
</h4>
|
|
<div class="ui attached segment">
|
|
<form class="ui form" method="post" action="{{.RepoLink}}/settings/subscriptions/products">
|
|
{{.CsrfTokenHtml}}
|
|
<div class="required field">
|
|
<label>{{ctx.Locale.Tr "repo.settings.subscriptions.product_name"}}</label>
|
|
<input type="text" name="name" required placeholder="e.g. Monthly Access">
|
|
</div>
|
|
<div class="required field">
|
|
<label>{{ctx.Locale.Tr "repo.settings.subscriptions.product_type"}}</label>
|
|
<select name="type" class="ui dropdown">
|
|
<option value="1">Monthly</option>
|
|
<option value="2">Yearly</option>
|
|
<option value="3">Lifetime</option>
|
|
</select>
|
|
</div>
|
|
<div class="required field">
|
|
<label>{{ctx.Locale.Tr "repo.settings.subscriptions.product_price"}}</label>
|
|
<div class="ui right labeled input">
|
|
<input type="number" name="price_cents" min="1" required placeholder="999">
|
|
<div class="ui basic label">cents</div>
|
|
</div>
|
|
</div>
|
|
<div class="field">
|
|
<label>{{ctx.Locale.Tr "repo.settings.subscriptions.product_currency"}}</label>
|
|
<input type="text" name="currency" value="USD" maxlength="3" placeholder="USD">
|
|
</div>
|
|
<div class="inline field">
|
|
<div class="ui toggle checkbox">
|
|
<input type="checkbox" name="is_active" checked>
|
|
<label>{{ctx.Locale.Tr "repo.settings.subscriptions.product_active"}}</label>
|
|
</div>
|
|
</div>
|
|
<div class="field">
|
|
<button class="ui primary button">{{svg "octicon-plus" 16}} {{ctx.Locale.Tr "repo.settings.subscriptions.add_product"}}</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
{{template "repo/settings/layout_footer" .}}
|