| 1 | {{ define "page" -}} |
| 2 | <section class="shithub-org-settings-page"> |
| 3 | <header class="shithub-org-pagehead shithub-org-settings-pagehead"> |
| 4 | <div class="shithub-org-pagehead-inner"> |
| 5 | <a class="shithub-org-pagehead-title" href="/{{ .Org.Slug }}"> |
| 6 | <img src="{{ .AvatarURL }}" alt="" width="30" height="30"> |
| 7 | <span>{{ if .Org.DisplayName }}{{ .Org.DisplayName }}{{ else }}{{ .Org.Slug }}{{ end }}</span> |
| 8 | </a> |
| 9 | </div> |
| 10 | </header> |
| 11 | |
| 12 | <div class="shithub-org-settings-layout"> |
| 13 | {{ template "org-settings-nav" . }} |
| 14 | |
| 15 | <div class="shithub-org-settings-main"> |
| 16 | {{ with .Error }}<p class="shithub-flash shithub-flash-error" role="alert">{{ . }}</p>{{ end }} |
| 17 | {{ with .Notice }}<p class="shithub-flash shithub-flash-success" role="status">{{ . }}</p>{{ end }} |
| 18 | {{ with .BillingAlert }}{{ if .Message }} |
| 19 | <p class="shithub-flash {{ .Class }}" role="status"> |
| 20 | {{ .Message }} |
| 21 | {{ if .ActionHref }}<a href="{{ .ActionHref }}">{{ .ActionText }}</a>{{ end }} |
| 22 | </p> |
| 23 | {{ end }}{{ end }} |
| 24 | |
| 25 | <div class="Subhead"> |
| 26 | <h2 class="Subhead-heading Subhead-heading--large">Billing and plans</h2> |
| 27 | </div> |
| 28 | |
| 29 | <section class="shithub-org-settings-section" aria-labelledby="org-billing-summary-heading"> |
| 30 | <h3 id="org-billing-summary-heading" class="sr-only">Billing summary</h3> |
| 31 | <div class="shithub-org-billing-summary"> |
| 32 | {{ range .Summary }} |
| 33 | <section class="Box shithub-org-billing-card"> |
| 34 | <div class="Box-header"> |
| 35 | <h4 class="Box-title">{{ .Label }}</h4> |
| 36 | </div> |
| 37 | <div class="Box-body"> |
| 38 | <p class="shithub-org-billing-card-value">{{ .Value }}</p> |
| 39 | {{ with .Detail }}<p class="shithub-org-billing-card-detail">{{ . }}</p>{{ end }} |
| 40 | </div> |
| 41 | </section> |
| 42 | {{ end }} |
| 43 | </div> |
| 44 | </section> |
| 45 | |
| 46 | <section class="shithub-org-settings-section" aria-labelledby="org-billing-seats-heading"> |
| 47 | <div class="Subhead Subhead--spacious border-bottom-0 mb-0 tmp-mb-0"> |
| 48 | <h2 id="org-billing-seats-heading" class="Subhead-heading">Seats</h2> |
| 49 | </div> |
| 50 | <div class="Box"> |
| 51 | <div class="Box-body p-0"> |
| 52 | <table class="shithub-org-billing-table"> |
| 53 | <thead> |
| 54 | <tr> |
| 55 | <th scope="col">Type</th> |
| 56 | <th scope="col">Count</th> |
| 57 | <th scope="col">How it is used</th> |
| 58 | </tr> |
| 59 | </thead> |
| 60 | <tbody> |
| 61 | <tr> |
| 62 | <td>Active members</td> |
| 63 | <td>{{ .Seats.ActiveMembers }}</td> |
| 64 | <td>Current organization members. Team billing charges active members, including owners.</td> |
| 65 | </tr> |
| 66 | <tr> |
| 67 | <td>Billable seats</td> |
| 68 | <td>{{ .Seats.BillableSeats }}</td> |
| 69 | <td>{{ .Seats.SnapshotLabel }}</td> |
| 70 | </tr> |
| 71 | <tr> |
| 72 | <td>Pending invitations</td> |
| 73 | <td>{{ .Seats.PendingInvites }}</td> |
| 74 | <td>Open invitations are shown separately and are not billed until accepted.</td> |
| 75 | </tr> |
| 76 | </tbody> |
| 77 | </table> |
| 78 | </div> |
| 79 | </div> |
| 80 | </section> |
| 81 | |
| 82 | <section id="manage-plan" class="shithub-org-settings-section" aria-labelledby="org-billing-manage-heading"> |
| 83 | <div class="Subhead Subhead--spacious border-bottom-0 mb-0 tmp-mb-0"> |
| 84 | <h2 id="org-billing-manage-heading" class="Subhead-heading">Manage plan</h2> |
| 85 | </div> |
| 86 | <div class="shithub-org-settings-box"> |
| 87 | <div class="shithub-org-settings-row"> |
| 88 | <div> |
| 89 | <strong>Team plan</strong> |
| 90 | <p>$4 per active organization member per month. Public and private repositories stay available; Team unlocks paid organization controls.</p> |
| 91 | </div> |
| 92 | {{ if .CanManageSubscription }} |
| 93 | <form method="POST" action="/organizations/{{ .Org.Slug }}/billing/portal"> |
| 94 | <input type="hidden" name="csrf_token" value="{{ .CSRFToken }}"> |
| 95 | <button type="submit" class="shithub-button">Manage or cancel</button> |
| 96 | </form> |
| 97 | {{ else if .CanStartCheckout }} |
| 98 | <form method="POST" action="/organizations/{{ .Org.Slug }}/billing/checkout"> |
| 99 | <input type="hidden" name="csrf_token" value="{{ .CSRFToken }}"> |
| 100 | <button type="submit" class="shithub-button shithub-button-primary">Upgrade to Team</button> |
| 101 | </form> |
| 102 | {{ else }} |
| 103 | <span class="shithub-empty-note">Billing is not configured on this instance.</span> |
| 104 | {{ end }} |
| 105 | </div> |
| 106 | {{ if .CanManageSubscription }} |
| 107 | <div class="shithub-org-settings-row"> |
| 108 | <div> |
| 109 | <strong>Downgrade to Free</strong> |
| 110 | <p>Use Stripe Billing Portal to cancel or schedule cancellation. shithub preserves paid configuration and makes Team-only features read-only after downgrade.</p> |
| 111 | </div> |
| 112 | <form method="POST" action="/organizations/{{ .Org.Slug }}/billing/portal"> |
| 113 | <input type="hidden" name="csrf_token" value="{{ .CSRFToken }}"> |
| 114 | <button type="submit" class="shithub-button shithub-button-danger">Open billing portal</button> |
| 115 | </form> |
| 116 | </div> |
| 117 | {{ end }} |
| 118 | <div class="shithub-org-settings-row"> |
| 119 | <div> |
| 120 | <strong>Billing email</strong> |
| 121 | <p>Stripe customer and invoice notifications use the organization billing email when one is set.</p> |
| 122 | </div> |
| 123 | <span>{{ if .Org.BillingEmail }}{{ .Org.BillingEmail }}{{ else }}Not set{{ end }}</span> |
| 124 | </div> |
| 125 | <div class="shithub-org-settings-row"> |
| 126 | <div> |
| 127 | <strong>Payment failures</strong> |
| 128 | <p>Past-due subscriptions enter a grace period before paid entitlements are cut off.</p> |
| 129 | </div> |
| 130 | <span>{{ .GracePeriodLabel }}</span> |
| 131 | </div> |
| 132 | </div> |
| 133 | </section> |
| 134 | |
| 135 | <section id="compare-plans" class="shithub-org-settings-section" aria-labelledby="org-billing-compare-heading"> |
| 136 | <div class="Subhead Subhead--spacious border-bottom-0 mb-0 tmp-mb-0"> |
| 137 | <h2 id="org-billing-compare-heading" class="Subhead-heading">Compare plans</h2> |
| 138 | </div> |
| 139 | <div class="Box shithub-billing-plan-compare shithub-org-billing-compare"> |
| 140 | <div class="Box-body"> |
| 141 | <table class="shithub-org-billing-table"> |
| 142 | <thead> |
| 143 | <tr> |
| 144 | <th scope="col">Feature</th> |
| 145 | <th scope="col">Free</th> |
| 146 | <th scope="col">Team</th> |
| 147 | <th scope="col">Enterprise</th> |
| 148 | </tr> |
| 149 | </thead> |
| 150 | <tbody> |
| 151 | <tr> |
| 152 | <td>Public and private org repositories</td> |
| 153 | <td>Included</td> |
| 154 | <td>Included</td> |
| 155 | <td>Contact sales</td> |
| 156 | </tr> |
| 157 | <tr> |
| 158 | <td>Visible teams</td> |
| 159 | <td>Included</td> |
| 160 | <td>Included</td> |
| 161 | <td>Contact sales</td> |
| 162 | </tr> |
| 163 | <tr> |
| 164 | <td>Secret teams</td> |
| 165 | <td>Upgrade</td> |
| 166 | <td>Included</td> |
| 167 | <td>Contact sales</td> |
| 168 | </tr> |
| 169 | <tr> |
| 170 | <td>Advanced private-repo branch protection</td> |
| 171 | <td>Upgrade</td> |
| 172 | <td>Included</td> |
| 173 | <td>Contact sales</td> |
| 174 | </tr> |
| 175 | <tr> |
| 176 | <td>Required reviewers on private org repos</td> |
| 177 | <td>Upgrade</td> |
| 178 | <td>Included</td> |
| 179 | <td>Contact sales</td> |
| 180 | </tr> |
| 181 | <tr> |
| 182 | <td>Org-level Actions secrets and variables</td> |
| 183 | <td>Upgrade</td> |
| 184 | <td>Included</td> |
| 185 | <td>Contact sales</td> |
| 186 | </tr> |
| 187 | </tbody> |
| 188 | </table> |
| 189 | </div> |
| 190 | </div> |
| 191 | </section> |
| 192 | |
| 193 | <section class="shithub-org-settings-section" aria-labelledby="org-billing-invoices-heading"> |
| 194 | <div class="Subhead Subhead--spacious border-bottom-0 mb-0 tmp-mb-0"> |
| 195 | <h2 id="org-billing-invoices-heading" class="Subhead-heading">Recent invoices</h2> |
| 196 | </div> |
| 197 | {{ if .Invoices }} |
| 198 | <div class="Box"> |
| 199 | <div class="Box-body p-0"> |
| 200 | <table class="shithub-org-billing-table"> |
| 201 | <thead> |
| 202 | <tr> |
| 203 | <th scope="col">Invoice</th> |
| 204 | <th scope="col">Status</th> |
| 205 | <th scope="col">Amount</th> |
| 206 | <th scope="col">Period</th> |
| 207 | <th scope="col">Due</th> |
| 208 | <th scope="col"></th> |
| 209 | </tr> |
| 210 | </thead> |
| 211 | <tbody> |
| 212 | {{ range .Invoices }} |
| 213 | <tr> |
| 214 | <td>{{ .Number }}</td> |
| 215 | <td><span class="shithub-org-billing-status is-{{ .StatusClass }}">{{ .StatusLabel }}</span></td> |
| 216 | <td>{{ .AmountLabel }}</td> |
| 217 | <td>{{ .PeriodLabel }}</td> |
| 218 | <td>{{ .DueLabel }}</td> |
| 219 | <td class="shithub-org-billing-links"> |
| 220 | {{ if .HostedInvoiceURL }}<a href="{{ .HostedInvoiceURL }}" target="_blank" rel="noreferrer">Open</a>{{ end }} |
| 221 | {{ if .InvoicePDFURL }}<a href="{{ .InvoicePDFURL }}" target="_blank" rel="noreferrer">PDF</a>{{ end }} |
| 222 | </td> |
| 223 | </tr> |
| 224 | {{ end }} |
| 225 | </tbody> |
| 226 | </table> |
| 227 | </div> |
| 228 | </div> |
| 229 | {{ else }} |
| 230 | <p class="shithub-empty-note">No invoices have been recorded for this organization yet.</p> |
| 231 | {{ end }} |
| 232 | </section> |
| 233 | |
| 234 | {{ if .IsSiteAdmin }} |
| 235 | <section class="shithub-org-settings-section" aria-labelledby="org-billing-debug-heading"> |
| 236 | <div class="Subhead Subhead--spacious border-bottom-0 mb-0 tmp-mb-0"> |
| 237 | <h2 id="org-billing-debug-heading" class="Subhead-heading">Site admin billing debug</h2> |
| 238 | </div> |
| 239 | <div class="Box"> |
| 240 | <div class="Box-body p-0"> |
| 241 | <table class="shithub-org-billing-table"> |
| 242 | <tbody> |
| 243 | <tr><th scope="row">Stripe customer</th><td>{{ if .Debug.StripeCustomerID }}{{ .Debug.StripeCustomerID }}{{ else }}—{{ end }}</td></tr> |
| 244 | <tr><th scope="row">Stripe subscription</th><td>{{ if .Debug.StripeSubscriptionID }}{{ .Debug.StripeSubscriptionID }}{{ else }}—{{ end }}</td></tr> |
| 245 | <tr><th scope="row">Stripe subscription item</th><td>{{ if .Debug.StripeSubscriptionItemID }}{{ .Debug.StripeSubscriptionItemID }}{{ else }}—{{ end }}</td></tr> |
| 246 | <tr><th scope="row">Last webhook event</th><td>{{ if .Debug.LastWebhookEventID }}{{ .Debug.LastWebhookEventID }}{{ else }}—{{ end }}</td></tr> |
| 247 | <tr><th scope="row">Webhook type</th><td>{{ if .Debug.LastWebhookEventType }}{{ .Debug.LastWebhookEventType }}{{ else }}—{{ end }}</td></tr> |
| 248 | <tr><th scope="row">Webhook status</th><td>{{ if .Debug.LastWebhookStatus }}{{ .Debug.LastWebhookStatus }}{{ else }}—{{ end }}</td></tr> |
| 249 | <tr><th scope="row">Webhook received</th><td>{{ if .Debug.LastWebhookReceivedAt }}{{ .Debug.LastWebhookReceivedAt }}{{ else }}—{{ end }}</td></tr> |
| 250 | <tr><th scope="row">Webhook processed</th><td>{{ if .Debug.LastWebhookProcessedAt }}{{ .Debug.LastWebhookProcessedAt }}{{ else }}—{{ end }}</td></tr> |
| 251 | <tr><th scope="row">Webhook attempts</th><td>{{ .Debug.LastWebhookAttempts }}</td></tr> |
| 252 | <tr><th scope="row">Webhook error</th><td>{{ if .Debug.LastWebhookError }}{{ .Debug.LastWebhookError }}{{ else }}—{{ end }}</td></tr> |
| 253 | </tbody> |
| 254 | </table> |
| 255 | </div> |
| 256 | </div> |
| 257 | </section> |
| 258 | {{ end }} |
| 259 | </div> |
| 260 | </div> |
| 261 | </section> |
| 262 | {{- end }} |