Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
urls: Show sponsorship page on a new URL.
Aman Agrawal00df9c6c187a
diff --git a/corporate/urls.py b/corporate/urls.pyindex 2b3822afc7d..772e9805a89 100644--- a/corporate/urls.py+++ b/corporate/urls.py@@ -4,7 +4,7 @@ from django.conf.urls import includefrom django.urls import pathfrom django.views.generic import RedirectView, TemplateView-from corporate.views.billing_page import billing_home, update_plan+from corporate.views.billing_page import billing_home, sponsorship_request, update_planfrom corporate.views.event_status import event_status, event_status_pagefrom corporate.views.portico import (app_download_link_redirect,@@ -32,6 +32,7 @@ i18n_urlpatterns: Any = [path("jobs/", TemplateView.as_view(template_name="corporate/jobs.html")),# Billingpath("billing/", billing_home, name="billing_home"),+ path("sponsorship/", sponsorship_request, name="sponsorship_request"),path("upgrade/", initial_upgrade, name="initial_upgrade"),path("support/", support_request),path("billing/event_status/", event_status_page, name="event_status_page"),diff --git a/corporate/views/billing_page.py b/corporate/views/billing_page.pyindex 01f8215eb0f..1c1c71f165c 100644--- a/corporate/views/billing_page.py+++ b/corporate/views/billing_page.py@@ -75,6 +75,16 @@ def add_sponsorship_info_to_context(context: Dict[str, Any], user_profile: UserP)+@zulip_login_required+@has_request_variables+def sponsorship_request(request: HttpRequest) -> HttpResponse:+ user = request.user+ assert user.is_authenticated+ context: Dict[str, Any] = {}+ add_sponsorship_info_to_context(context, user)+ return render(request, "corporate/sponsorship.html", context=context)++@zulip_login_required@has_request_variablesdef billing_home(diff --git a/corporate/views/portico.py b/corporate/views/portico.pyindex dfff11d004a..b1c03e9b57b 100644--- a/corporate/views/portico.py+++ b/corporate/views/portico.py@@ -52,7 +52,7 @@ def plans_view(request: HttpRequest) -> HttpResponse:realm = get_realm_from_request(request)free_trial_days = settings.FREE_TRIAL_DAYSsponsorship_pending = False- sponsorship_url = "/upgrade/#sponsorship"+ sponsorship_url = "/sponsorship/"if is_subdomain_root_or_alias(request):# If we're on the root domain, we make this link first ask you which organization.sponsorship_url = f"/accounts/go/?{urlencode({'next': sponsorship_url})}"diff --git a/templates/corporate/plans.html b/templates/corporate/plans.htmlindex 099be18d8e8..a34a3153ece 100644--- a/templates/corporate/plans.html+++ b/templates/corporate/plans.html@@ -50,8 +50,7 @@<div class="plans_faq_questions"><p>Zulip sponsors free Zulip Cloud Standard for hundreds of worthy- organizations. Request sponsorship from your organization's- <a href="{{ sponsorship_url }}">billing page</a>.+ organizations. <a href="{{ sponsorship_url }}">Request sponsorship</a>.</p></div><br />diff --git a/templates/corporate/sponsorship.html b/templates/corporate/sponsorship.htmlindex 2568e44951f..80373cc47e5 100644--- a/templates/corporate/sponsorship.html+++ b/templates/corporate/sponsorship.html@@ -1,3 +1,6 @@+{% extends "zerver/portico_signup.html" %}++{% block portico_content %}<div class="tab-pane" id="sponsorship"><div id="sponsorship-error" class="alert alert-danger"></div><div id="sponsorship-input-section">@@ -49,3 +52,4 @@Request received! The page will now reload.</div></div>+{% endblock %}diff --git a/web/src/billing/sponsorship.ts b/web/src/billing/sponsorship.tsnew file mode 100644index 00000000000..79f3e484569--- /dev/null+++ b/web/src/billing/sponsorship.ts@@ -0,0 +1,11 @@+import $ from "jquery";++import * as helpers from "./helpers";++export function initialize(): void {+ helpers.set_sponsorship_form();+}++$(() => {+ initialize();+});diff --git a/web/styles/portico/billing.css b/web/styles/portico/billing.cssindex eb00d1eb997..6285fd5e0db 100644--- a/web/styles/portico/billing.css+++ b/web/styles/portico/billing.css@@ -342,7 +342,6 @@ input[name="licenses"] {#license-manual-section,#licensechange-input-section,-#sponsorship-form,#invoice-form {& input {padding: 4px 6px;@@ -365,65 +364,6 @@ input[name="licenses"] {}}-#sponsorship-form {- & input {- box-sizing: border-box;- }-- & textarea {- box-sizing: border-box;- color: hsl(0deg 0% 33%);- background-color: hsl(0deg 0% 100%);- border-radius: 4px;- vertical-align: middle;- border: 1px solid hsl(0deg 0% 80%);- padding: 4px 6px;- margin-bottom: 10px;- line-height: 20px;-- box-shadow: inset 0 1px 1px hsl(0deg 0% 0% / 7.5%);- transition:- border linear 0.2s,- box-shadow linear 0.2s;-- &:focus {- border-color: hsl(206.5deg 80% 62% / 80%);- outline: 0;-- box-shadow:- inset 0 1px 1px hsl(0deg 0% 0% / 7.5%),- 0 0 8px hsl(206.5deg 80% 62% / 60%);-- &:invalid {- border-color: hsl(2deg 81% 55%);- box-shadow: 0 0 6px hsl(2deg 82% 85%);- color: hsl(1deg 45% 50%);- }- }- }-- & select {- height: 30px;- width: 100%;- padding: 0 6px;- font-size: 14px;- color: hsl(0deg 0% 33%);- border-radius: 4px;- border: 1px solid hsl(0deg 0% 80%);- margin-bottom: 10px;- cursor: pointer;- background-color: hsl(0deg 0% 100%);- }-- & input[name="website"] {- width: 100%;- }-- & textarea[name="description"] {- width: 100%;- }-}-#confirm-licenses-modal .dialog_submit_button:active {/* This is needed to avoid button background changingwhen clicking on it due to "button:active" CSS indiff --git a/web/templates/gear_menu_popover.hbs b/web/templates/gear_menu_popover.hbsindex c1834eddfe6..0a68cb85f90 100644--- a/web/templates/gear_menu_popover.hbs+++ b/web/templates/gear_menu_popover.hbs@@ -36,7 +36,7 @@</li>{{else if (not is_business_org) }}<li class="org-upgrade navbar-dropdown-menu-inner-list-item">- <a href="/upgrade/" target="_blank" rel="noopener noreferrer" class="navigate-link-on-enter navbar-dropdown-menu-link">{{t 'Request sponsorship' }}</a>+ <a href="/sponsorship/" target="_blank" rel="noopener noreferrer" class="navigate-link-on-enter navbar-dropdown-menu-link">{{t 'Request sponsorship' }}</a></li>{{/if}}{{/if}}diff --git a/web/templates/settings/upgrade_tip_widget.hbs b/web/templates/settings/upgrade_tip_widget.hbsindex 1b3cb656662..f92aa955dc4 100644--- a/web/templates/settings/upgrade_tip_widget.hbs+++ b/web/templates/settings/upgrade_tip_widget.hbs@@ -9,7 +9,7 @@{{#tr}}Available on Zulip Cloud Standard. <z-link-upgrade>Upgrade</z-link-upgrade> or <z-link-sponsorship>request sponsorship</z-link-sponsorship> to access.{{#*inline "z-link-upgrade"}}<a href="/upgrade/" target="_blank" rel="noopener noreferrer">{{> @partial-block}}</a>{{/inline}}- {{#*inline "z-link-sponsorship"}}<a href="/upgrade/#sponsorship" target="_blank" rel="noopener noreferrer">{{> @partial-block}}</a>{{/inline}}+ {{#*inline "z-link-sponsorship"}}<a href="/sponsorship/" target="_blank" rel="noopener noreferrer">{{> @partial-block}}</a>{{/inline}}{{/tr}}</div>{{/if}}diff --git a/web/webpack.assets.json b/web/webpack.assets.jsonindex 9480ce4d993..40537c4c8de 100644--- a/web/webpack.assets.json+++ b/web/webpack.assets.json@@ -16,6 +16,14 @@"./src/loading","./styles/portico/billing.css"],+ "sponsorship": [+ "./src/billing/page_params",+ "./src/bundles/portico",+ "jquery-validation",+ "./src/portico/signup",+ "./src/billing/sponsorship",+ "./styles/portico/billing.css"+ ],"upgrade": ["./src/billing/page_params","./src/bundles/portico",diff --git a/zerver/tests/test_docs.py b/zerver/tests/test_docs.pyindex c594bef07b9..5f0d78945f9 100644--- a/zerver/tests/test_docs.py+++ b/zerver/tests/test_docs.py@@ -502,8 +502,8 @@ class PlansPageTest(ZulipTestCase):root_domain = ""result = self.client_get("/plans/", subdomain=root_domain)self.assert_in_success_response(["Self-host Zulip"], result)- self.assert_not_in_success_response(["/upgrade/#sponsorship"], result)- self.assert_in_success_response(["/accounts/go/?next=%2Fupgrade%2F%23sponsorship"], result)+ self.assert_not_in_success_response(["/sponsorship/"], result)+ self.assert_in_success_response(["/accounts/go/?next=%2Fsponsorship%2F"], result)non_existent_domain = "moo"result = self.client_get("/plans/", subdomain=non_existent_domain)@@ -526,10 +526,8 @@ class PlansPageTest(ZulipTestCase):self.login(organization_member)result = self.client_get("/plans/", subdomain="zulip")self.assert_in_success_response(["Current plan"], result)- self.assert_in_success_response(["/upgrade/#sponsorship"], result)- self.assert_not_in_success_response(- ["/accounts/go/?next=%2Fupgrade%2F%23sponsorship"], result- )+ self.assert_in_success_response(["/sponsorship/"], result)+ self.assert_not_in_success_response(["/accounts/go/?next=%2Fsponsorship%2F"], result)# Test root domain, with login on different domainresult = self.client_get("/plans/", subdomain="")