Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
support: Consolidate sponsorship forms for remote and Zulip Cloud views.
Lauryn Menardb52b1bcca81b
diff --git a/corporate/lib/stripe.py b/corporate/lib/stripe.pyindex 2438213158a..d9bc15e3eaf 100644--- a/corporate/lib/stripe.py+++ b/corporate/lib/stripe.py@@ -3999,7 +3999,7 @@ class RealmBillingSession(BillingSession):end_link="](/help/linking-to-zulip-website)",)internal_send_private_message(notification_bot, user, message)- return f"Sponsorship approved for {self.billing_entity_display_name}"+ return f"Sponsorship approved for {self.billing_entity_display_name}; Emailed organization owners and billing admins."@overridedef is_sponsored(self) -> bool:diff --git a/corporate/tests/test_support_views.py b/corporate/tests/test_support_views.pyindex 37752f8793b..ea102c183b3 100644--- a/corporate/tests/test_support_views.py+++ b/corporate/tests/test_support_views.py@@ -221,7 +221,7 @@ class TestRemoteServerSupportEndpoint(ZulipTestCase):"<b>UUID</b>:","<b>Zulip version</b>:","📶 Push notification status:",- "💸 Discount and sponsorship information:",+ "💸 Discounts and sponsorship information:",],result,)diff --git a/templates/corporate/support/realm_details.html b/templates/corporate/support/realm_details.htmlindex 402758e696e..df2f2053982 100644--- a/templates/corporate/support/realm_details.html+++ b/templates/corporate/support/realm_details.html@@ -37,8 +37,9 @@<b>First human user</b>:{% endif %}</div>-<div class="realm-support-forms">- <div class="realm-form-container">+<div>+ <div class="realm-management-actions">+ <p class="support-section-header">🛠️ Realm management:</p><form method="POST" class="support-form"><b>Status</b>:<br />{{ csrf_input }}@@ -86,44 +87,18 @@</select><button type="submit" class="support-submit-button">Update</button></form>- <form method="POST" class="support-form">- <b>Sponsorship pending</b>:<br />- {{ csrf_input }}- <input type="hidden" name="realm_id" value="{{ realm.id }}" />- <select name="sponsorship_pending">- <option value="true" {% if realm_support_data[realm.id].sponsorship_data.sponsorship_pending %}selected{% endif %}>Yes</option>- <option value="false" {% if not realm_support_data[realm.id].sponsorship_data.sponsorship_pending %}selected{% endif %}>No</option>- </select>- <button type="submit" class="support-submit-button">Update</button>- </form>-- {% if realm_support_data[realm.id].sponsorship_data.sponsorship_pending %}- <form method="POST" class="support-form">- {{ csrf_input }}- <input type="hidden" name="realm_id" value="{{ realm.id }}" />- <input type="hidden" name="approve_sponsorship" value="true" />- <button class="approve-sponsorship-button">- Approve full sponsorship- </button>- (will email organization owners)- </form>- {% endif %}-+ </div>+ {% if realm.plan_type != SPONSORED_PLAN_TYPE %}+ <div class="support-sponsorship-container">{% with %}{% set sponsorship_data = realm_support_data[realm.id].sponsorship_data %}{% set PLAN_TYPES = REALM_PLAN_TYPES_FOR_DISCOUNT %}{% set remote_id = realm.id %}{% set remote_type = "realm_id" %}- {% include 'corporate/support/sponsorship_discount_forms.html' %}+ {% include 'corporate/support/sponsorship_forms_support.html' %}{% endwith %}-- {% if realm_support_data[realm.id].sponsorship_data.sponsorship_pending %}- {% with %}- {% set latest_sponsorship_request = realm_support_data[realm.id].sponsorship_data.latest_sponsorship_request %}- {% include 'corporate/support/sponsorship_request_details.html' %}- {% endwith %}- {% endif %}</div>+ {% endif %}{% if realm_support_data[realm.id].plan_data.current_plan %}<div class="current-plan-container">{% with %}diff --git a/templates/corporate/support/remote_realm_details.html b/templates/corporate/support/remote_realm_details.htmlindex ca1b5b75030..fdf2d5154f6 100644--- a/templates/corporate/support/remote_realm_details.html+++ b/templates/corporate/support/remote_realm_details.html@@ -45,7 +45,7 @@{% endwith %}{% if remote_server_deactivated %}- <div class="remote-support-sponsorship-container">+ <div class="support-sponsorship-container">{% with %}{% set sponsorship_data = support_data[remote_realm.id].sponsorship_data %}{% set dollar_amount = dollar_amount %}@@ -53,9 +53,10 @@{% endwith %}</div>{% elif remote_realm.plan_type != SPONSORED_PLAN_TYPE %}- <div class="remote-support-sponsorship-container">+ <div class="support-sponsorship-container">{% with %}{% set sponsorship_data = support_data[remote_realm.id].sponsorship_data %}+ {% set PLAN_TYPES = REMOTE_PLAN_TIERS %}{% set remote_id = remote_realm.id %}{% set remote_type = "remote_realm_id" %}{% set has_fixed_price = support_data[remote_realm.id].plan_data.has_fixed_price %}diff --git a/templates/corporate/support/remote_server_support.html b/templates/corporate/support/remote_server_support.htmlindex af817af4b42..6db26e5120b 100644--- a/templates/corporate/support/remote_server_support.html+++ b/templates/corporate/support/remote_server_support.html@@ -91,16 +91,17 @@{% endwith %}{% if remote_server.deactivated %}- <div class="remote-support-sponsorship-container">+ <div class="support-sponsorship-container">{% with %}{% set sponsorship_data = remote_servers_support_data[remote_server.id].sponsorship_data %}{% include 'corporate/support/sponsorship_details.html' %}{% endwith %}</div>{% elif remote_server.plan_type != SPONSORED_PLAN_TYPE %}- <div class="remote-support-sponsorship-container">+ <div class="support-sponsorship-container">{% with %}{% set sponsorship_data = remote_servers_support_data[remote_server.id].sponsorship_data %}+ {% set PLAN_TYPES = REMOTE_PLAN_TIERS %}{% set remote_id = remote_server.id %}{% set remote_type = "remote_server_id" %}{% set has_fixed_price = remote_servers_support_data[remote_server.id].plan_data.has_fixed_price %}diff --git a/templates/corporate/support/sponsorship_details.html b/templates/corporate/support/sponsorship_details.htmlindex a35a005252e..84b07b37ec8 100644--- a/templates/corporate/support/sponsorship_details.html+++ b/templates/corporate/support/sponsorship_details.html@@ -1,5 +1,5 @@<div class="remote-sponsorship-details">- <p class="support-section-header">💸 Discount and sponsorship information:</p>+ <p class="support-section-header">💸 Discounts and sponsorship information:</p><b>Sponsorship pending</b>: {{ sponsorship_data.sponsorship_pending }}<br />{% if sponsorship_data.has_discount %}{% if sponsorship_data.monthly_discounted_price %}diff --git a/templates/corporate/support/sponsorship_forms_support.html b/templates/corporate/support/sponsorship_forms_support.htmlindex 63a7305bfdc..55f5b895825 100644--- a/templates/corporate/support/sponsorship_forms_support.html+++ b/templates/corporate/support/sponsorship_forms_support.html@@ -1,3 +1,4 @@+<p class="support-section-header">💸 Discounts and sponsorship:</p><form method="POST" class="support-form"><b>Sponsorship pending</b>:<br />{{ csrf_input }}@@ -21,7 +22,7 @@{% endif %}{% with %}- {% set PLAN_TYPES = REMOTE_PLAN_TIERS %}+ {% set PLAN_TYPES = PLAN_TYPES %}{% include 'corporate/support/sponsorship_discount_forms.html' %}{% endwith %}diff --git a/web/styles/portico/activity.css b/web/styles/portico/activity.cssindex 74f66a4967e..64bbb271a37 100644--- a/web/styles/portico/activity.css+++ b/web/styles/portico/activity.css@@ -464,29 +464,28 @@ tr.admin td:first-child {}.push-notification-status,-.realm-form-container,+.realm-management-actions,.next-plan-container,.current-plan-container,-.remote-support-sponsorship-container {+.support-sponsorship-container {border-radius: 4px;padding: 10px;margin: 10px 0;}-.push-notification-status {+.push-notification-status,+.realm-management-actions {border: 2px solid hsl(186deg 76% 36%);background-color: hsl(188deg 35% 87%);}-.realm-form-container,.next-plan-container,.current-plan-container,-.remote-support-sponsorship-container {+.support-sponsorship-container {border: 2px solid hsl(33deg 99% 60%);}-.realm-form-container,-.remote-support-sponsorship-container {+.support-sponsorship-container {background-color: hsl(30deg 100% 96%);}