diff --git a/corporate/views/billing_page.py b/corporate/views/billing_page.py index e5d8cc5052..29b2b5cc00 100644 --- a/corporate/views/billing_page.py +++ b/corporate/views/billing_page.py @@ -6,7 +6,7 @@ from django.shortcuts import render from django.urls import reverse from corporate.lib.stripe import RealmBillingSession, UpdatePlanRequest -from corporate.models import CustomerPlan, get_customer_by_realm +from corporate.models import CustomerPlan, get_current_plan_by_customer, get_customer_by_realm from zerver.decorator import require_billing_access, zulip_login_required from zerver.lib.request import REQ, has_request_variables from zerver.lib.response import json_success @@ -47,6 +47,12 @@ def sponsorship_request(request: HttpRequest) -> HttpResponse: if user.realm.plan_type == user.realm.PLAN_TYPE_STANDARD_FREE: context["is_sponsored"] = True + if customer is not None: + plan = get_current_plan_by_customer(customer) + if plan is not None: + context["plan_name"] = plan.name + context["free_trial"] = plan.is_free_trial() + add_sponsorship_info_to_context(context, user) return render(request, "corporate/sponsorship.html", context=context) diff --git a/templates/corporate/sponsorship.html b/templates/corporate/sponsorship.html index 17ef0be1be..3951202ce7 100644 --- a/templates/corporate/sponsorship.html +++ b/templates/corporate/sponsorship.html @@ -7,13 +7,33 @@ {% if is_sponsored %} -
+
+
+ Zulip is sponsoring a free Zulip Cloud Standard plan for this organization. 🎉 +

Zulip Cloud billing for {{realm_name}}

-

Zulip is sponsoring free Zulip Cloud Standard hosting for this organization. 🎉

+
+
+ + +
+
+
+
+
diff --git a/web/styles/portico/billing.css b/web/styles/portico/billing.css index 6d264f401d..83cf8cf0b6 100644 --- a/web/styles/portico/billing.css +++ b/web/styles/portico/billing.css @@ -382,6 +382,11 @@ input[name="licenses"] { margin: -50px; } + .sponsorship-status-page { + transform: scale(0.8); + margin: -10px -50px -50px; + } + #upgrade-page { transform: scale(0.8); margin: -50px 0; @@ -396,6 +401,11 @@ input[name="licenses"] { margin: -150px -100px; } + .sponsorship-status-page { + transform: scale(0.6); + margin: -50px -150px -100px; + } + #upgrade-page { transform: scale(0.6); margin: -150px 0; @@ -406,9 +416,14 @@ input[name="licenses"] { width: 100%; } -.billing-status-page, +.billing-status-page { + font-weight: 400; +} + .sponsorship-status-page .white-box { font-weight: 400; + margin: 30px; + padding: 0; } .billing-status-page p:last-child, @@ -524,11 +539,12 @@ input[name="licenses"] { padding-top: 0; } -#upgrade-page-details .input-box.billing-page-field:first-child, +#sponsorship-status-page-details .input-box.sponsorship-form-field:first-child, #billing-page-details .input-box.billing-page-field:first-child { margin-top: 10px; } +.sponsorship-status-page .support-link, #billing-page .support-link { text-align: center; } @@ -560,9 +576,11 @@ input[name="licenses"] { text-align: left; } +#sponsorship-status-success-message-top, #billing-success-message-top { display: block; text-align: center; + font-weight: 400; } .upgrade-page-success { diff --git a/web/styles/portico/portico_signin.css b/web/styles/portico/portico_signin.css index 0c9764bdc3..04809f79a8 100644 --- a/web/styles/portico/portico_signin.css +++ b/web/styles/portico/portico_signin.css @@ -482,6 +482,7 @@ html { .alert-info, .billing-page-success, .upgrade-page-success, + .sponsorship-page-success, #autopay-error ) { padding: 0; @@ -925,6 +926,7 @@ button#register_auth_button_gitlab { #upgrade-page-details, #billing-page-details, #sponsorship-form, +#sponsorship-status-page-details, #registration, #new-realm-creation { width: auto;