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.

accounts_accept_terms: Make elements looks similar to other pages.

Aman Agrawalca71e28cd661
diff --git a/static/styles/portico/portico_signin.css b/static/styles/portico/portico_signin.css
index 00164ed4581..fff0e874dce 100644
--- a/static/styles/portico/portico_signin.css
+++ b/static/styles/portico/portico_signin.css
@@ -284,9 +284,33 @@ html {
}
}
-.account-accept-terms-page .terms-of-service .input-group {
- width: 450px;
- margin: 0 auto 10px;
+.account-accept-terms-page {
+ #registration,
+ #accept_tos_button {
+ margin: 0;
+ }
+
+ .fakecontrol {
+ font-weight: normal;
+ }
+
+ .description {
+ margin-bottom: 20px;
+ font-size: 16px;
+ font-weight: 400;
+ }
+
+ .center-block {
+ max-width: 800px;
+
+ .control-group {
+ margin-bottom: 5px;
+ }
+ }
+
+ #accept_tos_button {
+ margin-top: 20px;
+ }
}
.register-account {
diff --git a/templates/zerver/accounts_accept_terms.html b/templates/zerver/accounts_accept_terms.html
index ad4ee166997..ec6b5a035dc 100644
--- a/templates/zerver/accounts_accept_terms.html
+++ b/templates/zerver/accounts_accept_terms.html
@@ -13,7 +13,7 @@ the registration flow has its own (nearly identical) copy of the fields below in
{% include special_message_template %}
{% else %}
<div class="pitch">
- <h1 class="get-started">{{ _("Accept the new Terms of Service") }}…</h1>
+ <h1 class="get-started">{{ _("Accept the Terms of Service") }}</h1>
</div>
{% endif %}
@@ -27,7 +27,13 @@ the registration flow has its own (nearly identical) copy of the fields below in
</div>
</div>
- <div class="input-group margin terms-of-service">
+ {% if terms_of_service_message %}
+ <div class="description">
+ <p>{{ terms_of_service_message |safe }}</p>
+ </div>
+ {% endif %}
+
+ <div class="input-group terms-of-service">
{#
This is somewhat subtle.
Checkboxes have a name and value, and when the checkbox is ticked, the form posts
@@ -48,10 +54,9 @@ the registration flow has its own (nearly identical) copy of the fields below in
{% endfor %}
{% endif %}
</div>
- <br />
<div class="control-group">
<div class="controls">
- <input type="submit" class="btn btn-primary" value="{{ _('Enter') }}" /><br />
+ <button id="accept_tos_button" type="submit">{{ _('Accept') }}</button>
<input type="hidden" name="next" value="{{ next }}" />
</div>
</div>
diff --git a/zerver/context_processors.py b/zerver/context_processors.py
index 3e0278e4ae8..1ca8702cd9e 100644
--- a/zerver/context_processors.py
+++ b/zerver/context_processors.py
@@ -176,6 +176,7 @@ def zulip_default_context(request: HttpRequest) -> Dict[str, Any]:
"platform": RequestNotes.get_notes(request).client_name,
"allow_search_engine_indexing": allow_search_engine_indexing,
"landing_page_navbar_message": settings.LANDING_PAGE_NAVBAR_MESSAGE,
+ "terms_of_service_message": settings.TERMS_OF_SERVICE_MESSAGE,
"is_isolated_page": is_isolated_page(request),
"default_page_params": default_page_params,
}
diff --git a/zerver/tests/test_home.py b/zerver/tests/test_home.py
index 8a0e252f491..5ebe1df2aa4 100644
--- a/zerver/tests/test_home.py
+++ b/zerver/tests/test_home.py
@@ -462,7 +462,7 @@ class HomeTest(ZulipTestCase):
result = self.client_get("/", dict(stream="Denmark"))
html = result.content.decode()
- self.assertIn("Accept the new Terms of Service", html)
+ self.assertIn("Accept the Terms of Service", html)
def test_banned_desktop_app_versions(self) -> None:
user = self.example_user("hamlet")
diff --git a/zproject/default_settings.py b/zproject/default_settings.py
index c9d3dbd1b28..edc17ea73a2 100644
--- a/zproject/default_settings.py
+++ b/zproject/default_settings.py
@@ -355,8 +355,16 @@ REALM_CREATION_LINK_VALIDITY_DAYS = 7
# user to click through to re-accept terms of service before using
# Zulip again on the web.
TERMS_OF_SERVICE_VERSION: Optional[str] = None
-# Template to use when bumping TERMS_OF_SERVICE_VERSION to explain situation.
+# HTML template path (e.g. "corporate/zulipchat_migration_tos.html")
+# displayed to users when increasing TERMS_OF_SERVICE_VERSION when a
+# user is to accept the terms of service for the first time, but
+# already has an account. This primarily comes up when doing a data
+# import.
FIRST_TIME_TERMS_OF_SERVICE_TEMPLATE: Optional[str] = None
+# Custom message (HTML allowed) to be displayed to explain why users
+# need to re-accept the terms of service when a new major version is
+# written.
+TERMS_OF_SERVICE_MESSAGE: Optional[str] = None
# Hostname used for Zulip's statsd logging integration.
STATSD_HOST = ""
diff --git a/zproject/dev_settings.py b/zproject/dev_settings.py
index cb30e382ee9..c8f25862447 100644
--- a/zproject/dev_settings.py
+++ b/zproject/dev_settings.py
@@ -80,6 +80,7 @@ INVITES_MIN_USER_AGE_DAYS = 0
# For development convenience, configure the ToS/Privacy Policies
POLICIES_DIRECTORY = "corporate/policies"
TERMS_OF_SERVICE_VERSION = "1.0"
+TERMS_OF_SERVICE_MESSAGE: Optional[str] = "Description of changes to the ToS!"
EMBEDDED_BOTS_ENABLED = True