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.

remote_billing: Fix up templates and HTML names in them.

Mateusz Mandera1e6d9d28f895
diff --git a/corporate/tests/test_remote_billing.py b/corporate/tests/test_remote_billing.py
index 5a66b582b9b..8d5a3dcb643 100644
--- a/corporate/tests/test_remote_billing.py
+++ b/corporate/tests/test_remote_billing.py
@@ -105,7 +105,7 @@ class RemoteBillingAuthenticationTest(BouncerTestCase):
# Final confirmation page - just confirm your details, possibly
# agreeing to ToS if needed and an authenticated session will be granted:
self.assertEqual(result.status_code, 200)
- self.assert_in_success_response(["Log in to Zulip server billing"], result)
+ self.assert_in_success_response(["Log in to Zulip plan management"], result)
self.assert_in_success_response([user.realm.host], result)
params = {}
@@ -510,7 +510,7 @@ class LegacyServerLoginTest(BouncerTestCase):
result = self.client_get(confirmation_url, subdomain="selfhosting")
self.assertEqual(result.status_code, 200)
self.assert_in_success_response(
- [f"Log in to Zulip server billing for {self.server.hostname}", email], result
+ [f"Log in to Zulip plan management for {self.server.hostname}", email], result
)
self.assert_in_success_response([f'action="{confirmation_url}"'], result)
if expect_tos:
diff --git a/corporate/views/remote_billing_page.py b/corporate/views/remote_billing_page.py
index da155613971..7b2e665535e 100644
--- a/corporate/views/remote_billing_page.py
+++ b/corporate/views/remote_billing_page.py
@@ -203,7 +203,7 @@ def remote_realm_billing_finalize_login(
}
return render(
request,
- "corporate/remote_realm_billing_finalize_login_confirmation.html",
+ "corporate/remote_billing_finalize_login_confirmation.html",
context=context,
)
else:
@@ -218,9 +218,7 @@ def remote_realm_billing_finalize_login(
}
return render(
request,
- # TODO: We're re-using a template originally made for the legacy server
- # flow. We should rename it and its HTML contents to a more general name.
- "corporate/remote_billing_legacy_server_confirm_login_form.html",
+ "corporate/remote_billing_confirm_email_form.html",
context=context,
)
@@ -562,7 +560,7 @@ def remote_billing_legacy_server_login(
}
return render(
request,
- "corporate/remote_billing_legacy_server_confirm_login_form.html",
+ "corporate/remote_billing_confirm_email_form.html",
context=context,
)
@@ -677,9 +675,7 @@ def remote_billing_legacy_server_from_login_confirmation_link(
}
return render(
request,
- # TODO: We're re-using the template, so it should be renamed
- # to a more general name.
- "corporate/remote_realm_billing_finalize_login_confirmation.html",
+ "corporate/remote_billing_finalize_login_confirmation.html",
context=context,
)
diff --git a/templates/corporate/remote_billing_legacy_server_confirm_login_form.html b/templates/corporate/remote_billing_confirm_email_form.html
similarity index 86%
rename from templates/corporate/remote_billing_legacy_server_confirm_login_form.html
rename to templates/corporate/remote_billing_confirm_email_form.html
index 23ef1681bf7..16446943489 100644
--- a/templates/corporate/remote_billing_legacy_server_confirm_login_form.html
+++ b/templates/corporate/remote_billing_confirm_email_form.html
@@ -14,7 +14,7 @@
<p>Next, we will send a verification email to the address you provide.</p>
</div>
<div class="white-box">
- <form id="server-confirm-login-form" method="post" action="{{ action_url }}">
+ <form id="remote-billing-confirm-email-form" method="post" action="{{ action_url }}">
{{ csrf_input }}
{% if next_page %}
<input type="hidden" name="next_page" value="{{ next_page }}" />
@@ -24,7 +24,7 @@
<input id="email" name="email" class="email required" type="email" {% if email %}value="{{ email }}"{% endif %} />
</div>
<div class="upgrade-button-container">
- <button type="submit" id="server-confirm-login-button" class="stripe-button-el invoice-button">
+ <button type="submit" id="remote-billing-confirm-email-button" class="stripe-button-el invoice-button">
<span class="server-login-button-text">Continue</span>
<img class="loader server-login-button-loader" src="{{ static('images/loading/loader-white.svg') }}" alt="" />
</button>
diff --git a/templates/corporate/remote_realm_billing_finalize_login_confirmation.html b/templates/corporate/remote_billing_finalize_login_confirmation.html
similarity index 60%
rename from templates/corporate/remote_realm_billing_finalize_login_confirmation.html
rename to templates/corporate/remote_billing_finalize_login_confirmation.html
index 9e47653e71a..bc093c84930 100644
--- a/templates/corporate/remote_realm_billing_finalize_login_confirmation.html
+++ b/templates/corporate/remote_billing_finalize_login_confirmation.html
@@ -2,22 +2,21 @@
{% set entrypoint = "upgrade" %}
{% block title %}
-<title>{{ _("Billing login confirmation") }} | Zulip</title>
+<title>{{ _("Zulip plan management login confirmation") }} | Zulip</title>
{% endblock %}
{% block portico_content %}
-<div id="remote-realm-confirm-login-page" class="register-account flex full-page">
+<div id="remote-billing-confirm-login-page" class="register-account flex full-page">
<div class="center-block new-style">
<div class="pitch">
- <h1>Log in to Zulip server billing for {{ host }}</h1>
+ <h1>Log in to Zulip plan management for {{ host }}</h1>
</div>
<div class="white-box">
- <p>Click <b>Continue</b> to log in to Zulip server
- billing with the account below.</p>
+ <p>Click <b>Continue</b> to log in to the Zulip plan management system with the account below.</p>
Email: {{ user_email }}<br />
- <form id="remote-realm-confirm-login-form" method="post" action="{{ action_url }}">
+ <form id="remote-billing-confirm-login-form" method="post" action="{{ action_url }}">
{{ csrf_input }}
- <div class="input-box remote-realm-confirm-login-form-field">
+ <div class="input-box remote-billing-confirm-login-form-field">
<label for="full_name" class="inline-block label-title">Full name</label>
<input id="full_name" name="full_name" class="required" type="text" {% if user_full_name %}value="{{ user_full_name }}"{% endif %} />
</div>
@@ -31,9 +30,9 @@
</div>
{% endif %}
<div class="upgrade-button-container">
- <button type="submit" id="remote-realm-confirm-login-button" class="stripe-button-el invoice-button">
- <span class="remote-realm-confirm-login-button-text">Continue</span>
- <img class="loader remote-realm-confirm-login-button-loader" src="{{ static('images/loading/loader-white.svg') }}" alt="" />
+ <button type="submit" id="remote-billing-confirm-login-button" class="stripe-button-el invoice-button">
+ <span class="remote-billing-confirm-login-button-text">Continue</span>
+ <img class="loader remote-billing-confirm-login-button-loader" src="{{ static('images/loading/loader-white.svg') }}" alt="" />
</button>
</div>
</form>
diff --git a/web/src/billing/legacy_server_login.ts b/web/src/billing/legacy_server_login.ts
index 41b5d902c6f..4e5c718deb3 100644
--- a/web/src/billing/legacy_server_login.ts
+++ b/web/src/billing/legacy_server_login.ts
@@ -1,14 +1,14 @@
import $ from "jquery";
export function initialize(): void {
- $("#server-login-form, #server-confirm-login-form").validate({
+ $("#server-login-form, #remote-billing-confirm-email-form").validate({
errorClass: "text-error",
wrapper: "div",
submitHandler(form) {
$("#server-login-form").find(".loader").css("display", "inline-block");
$("#server-login-button .server-login-button-text").hide();
- $("#server-confirm-login-form").find(".loader").css("display", "inline-block");
- $("#server-confirm-login-button .server-login-button-text").hide();
+ $("#remote-billing-confirm-email-form").find(".loader").css("display", "inline-block");
+ $("#remote-billing-confirm-email-button .server-login-button-text").hide();
form.submit();
},
@@ -16,12 +16,12 @@ export function initialize(): void {
// this removes all previous errors that were put on screen
// by the server.
$("#server-login-form .alert.alert-error").remove();
- $("#server-confirm-login-form .alert.alert-error").remove();
+ $("#remote-billing-confirm-email-form .alert.alert-error").remove();
},
showErrors(error_map) {
if (error_map.password) {
$("#server-login-form .alert.alert-error").remove();
- $("#server-confirm-login-form .alert.alert-error").remove();
+ $("#remote-billing-confirm-email-form .alert.alert-error").remove();
}
this.defaultShowErrors!();
},
diff --git a/web/src/billing/remote_billing_confirmation.ts b/web/src/billing/remote_billing_confirmation.ts
index 3031038b316..ff04c65a4dd 100644
--- a/web/src/billing/remote_billing_confirmation.ts
+++ b/web/src/billing/remote_billing_confirmation.ts
@@ -1,23 +1,25 @@
import $ from "jquery";
export function initialize(): void {
- $("#remote-realm-confirm-login-form").find(".loader").hide();
+ $("#remote-billing-confirm-login-form").find(".loader").hide();
- $("#remote-realm-confirm-login-form").validate({
+ $("#remote-billing-confirm-login-form").validate({
errorClass: "text-error",
wrapper: "div",
submitHandler(form) {
- $("#remote-realm-confirm-login-form").find(".loader").show();
- $("#remote-realm-confirm-login-button .remote-realm-confirm-login-button-text").hide();
+ $("#remote-billing-confirm-login-form").find(".loader").show();
+ $(
+ "#remote-billing-confirm-login-button .remote-billing-confirm-login-button-text",
+ ).hide();
form.submit();
},
invalidHandler() {
- $("#remote-realm-confirm-login-form .alert.alert-error").remove();
+ $("#remote-billing-confirm-login-form .alert.alert-error").remove();
},
showErrors(error_map) {
if (error_map.id_terms) {
- $("#remote-realm-confirm-login-form .alert.alert-error").remove();
+ $("#remote-billing-confirm-login-form .alert.alert-error").remove();
}
this.defaultShowErrors!();
},
diff --git a/web/styles/portico/billing.css b/web/styles/portico/billing.css
index 9b190aa4bb1..fc7904df264 100644
--- a/web/styles/portico/billing.css
+++ b/web/styles/portico/billing.css
@@ -685,7 +685,7 @@ input[name="licenses"] {
display: none;
}
-#remote-realm-confirm-login-form .text-error {
+#remote-billing-confirm-login-form .text-error {
margin-bottom: 15px;
}