Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

upgrade: Show sponsorship requested banner like billing page.

Aman Agrawalc61275cab279
diff --git a/corporate/lib/stripe.py b/corporate/lib/stripe.py
index fab9125da35..509e5341f1d 100644
--- a/corporate/lib/stripe.py
+++ b/corporate/lib/stripe.py
@@ -646,6 +646,8 @@ class UpgradePageContext(TypedDict):
seat_count: int
signed_seat_count: str
success_message: str
+ is_sponsorship_pending: bool
+ sponsorship_plan_name: str
class SponsorshipRequestForm(forms.Form):
@@ -1824,8 +1826,8 @@ class BillingSession(ABC):
free_trial_days = None
free_trial_end_date = None
# Don't show free trial for remote servers on legacy plan.
+ is_self_hosted_billing = not isinstance(self, RealmBillingSession)
if remote_server_legacy_plan_end_date is None:
- is_self_hosted_billing = not isinstance(self, RealmBillingSession)
free_trial_days = get_free_trial_days(is_self_hosted_billing)
if free_trial_days is not None:
_, _, free_trial_end, _ = compute_plan_parameters(
@@ -1871,6 +1873,10 @@ class BillingSession(ABC):
"seat_count": seat_count,
"signed_seat_count": signed_seat_count,
"success_message": initial_upgrade_request.success_message,
+ "is_sponsorship_pending": customer is not None and customer.sponsorship_pending,
+ "sponsorship_plan_name": self.get_sponsorship_plan_name(
+ customer, is_self_hosted_billing
+ ),
}
return None, context
diff --git a/templates/corporate/upgrade.html b/templates/corporate/upgrade.html
index bfeac3aac93..7660127f619 100644
--- a/templates/corporate/upgrade.html
+++ b/templates/corporate/upgrade.html
@@ -8,6 +8,15 @@
{% block portico_content %}
<div id="upgrade-page" class="register-account flex full-page">
<div class="center-block new-style">
+ {% if is_self_hosting_management_page and is_sponsorship_pending %}
+ <div class="alert alert-success billing-page-success" id="upgrade-page-sponsorship-pending-message-top">
+ This organization has requested sponsorship for a
+ {% if sponsorship_plan_name == "Business" %}
+ discounted
+ {% endif %}
+ <a href="{{ page_params.billing_base_url }}/plans/">{{ sponsorship_plan_name }}</a> plan.<br/><a href="mailto:[email protected]">Contact Zulip support</a> with any questions or updates.
+ </div>
+ {% endif %}
{% if success_message %}
<div class="alert alert-success billing-page-success" id="upgrade-success-message-top">
{{ success_message }}
diff --git a/web/styles/portico/billing.css b/web/styles/portico/billing.css
index 47a2177446a..d678824fbce 100644
--- a/web/styles/portico/billing.css
+++ b/web/styles/portico/billing.css
@@ -599,6 +599,7 @@ input[name="licenses"] {
text-align: left;
}
+#upgrade-page-sponsorship-pending-message-top,
#billing-sponsorship-pending-message-top,
#sponsorship-status-success-message-top,
#upgrade-success-message-top,