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.

templates: Extract template for terms of service form field.

Lauryn Menarda06d188b4934
diff --git a/templates/zerver/accounts_accept_terms.html b/templates/zerver/accounts_accept_terms.html
index ff227e475f1..0f00448c85d 100644
--- a/templates/zerver/accounts_accept_terms.html
+++ b/templates/zerver/accounts_accept_terms.html
@@ -38,27 +38,7 @@ the registration flow has its own (nearly identical) copy of the fields below in
{% endif %}
{% if terms_of_service %}
- <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
- with name=value. If the checkbox is unticked, the field just isn't present at all.
-
- This is distinct from 'checked', which determines whether the checkbox appears
- at all. (So, it's not symmetric to the code above.)
- #}
- <label for="id_terms" class="inline-block checkbox">
- <input id="id_terms" class="required" type="checkbox" name="terms"
- {% if form.terms.value() %}checked="checked"{% endif %} />
- <span class="rendered-checkbox"></span>
- {% trans %}I agree to the <a href="{{ root_domain_url }}/policies/terms" target="_blank" rel="noopener noreferrer">Terms of Service</a>.{% endtrans %}
- </label>
- {% if form.terms.errors %}
- {% for error in form.terms.errors %}
- <p class="error help-inline alert alert-error">{{ error }}</p>
- {% endfor %}
- {% endif %}
- </div>
+ {% include 'zerver/terms_of_service_form_field.html' %}
{% if first_time_terms_of_service_message_template %}
<div class="input-group">
<label for="id_enable_marketing_emails_first_login" class="inline-block checkbox marketing_emails_checkbox">
diff --git a/templates/zerver/register.html b/templates/zerver/register.html
index 108e18a64f5..13cbde5d26c 100644
--- a/templates/zerver/register.html
+++ b/templates/zerver/register.html
@@ -218,32 +218,12 @@ Form is validated both client-side using jquery-validation (see signup.js) and s
</div>
{% endif %}
- <div class="input-group terms-of-service">
+ <div class="input-group">
{% if terms_of_service %}
- <div class="input-group">
- {#
- This is somewhat subtle.
- Checkboxes have a name and value, and when the checkbox is ticked, the form posts
- with name=value. If the checkbox is unticked, the field just isn't present at all.
-
- This is distinct from 'checked', which determines whether the checkbox appears
- at all. (So, it's not symmetric to the code above.)
- #}
- <label for="id_terms" class="inline-block checkbox">
- <input id="id_terms" class="required" type="checkbox" name="terms"
- {% if form.terms.value() %}checked="checked"{% endif %} />
- <span class="rendered-checkbox"></span>
- {% trans %}I agree to the <a href="{{ root_domain_url }}/policies/terms" target="_blank" rel="noopener noreferrer">Terms of Service</a>.{% endtrans %}
- </label>
- {% if form.terms.errors %}
- {% for error in form.terms.errors %}
- <p class="error help-inline alert alert-error">{{ error }}</p>
- {% endfor %}
- {% endif %}
- </div>
+ {% include 'zerver/terms_of_service_form_field.html' %}
{% endif %}
{% if corporate_enabled %}
- <div class="input-group">
+ <div class="input-group marketing-emails">
<label for="id_enable_marketing_emails" class="inline-block checkbox marketing_emails_checkbox">
<input id="id_enable_marketing_emails" type="checkbox" name="enable_marketing_emails"
checked="checked" />
diff --git a/templates/zerver/terms_of_service_form_field.html b/templates/zerver/terms_of_service_form_field.html
new file mode 100644
index 00000000000..bfa6c69c0bc
--- /dev/null
+++ b/templates/zerver/terms_of_service_form_field.html
@@ -0,0 +1,21 @@
+<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
+ with name=value. If the checkbox is unticked, the field just isn't present at all.
+
+ This is distinct from 'checked', which determines whether the checkbox appears
+ at all. (So, it's not symmetric to the code above.)
+ #}
+ <label for="id_terms" class="inline-block checkbox">
+ <input id="id_terms" class="required" type="checkbox" name="terms"
+ {% if form.terms.value() %}checked="checked"{% endif %} />
+ <span class="rendered-checkbox"></span>
+ {% trans %}I agree to the <a href="{{ root_domain_url }}/policies/terms" target="_blank" rel="noopener noreferrer">Terms of Service</a>.{% endtrans %}
+ </label>
+ {% if form.terms.errors %}
+ {% for error in form.terms.errors %}
+ <p class="error help-inline alert alert-error">{{ error }}</p>
+ {% endfor %}
+ {% endif %}
+</div>
diff --git a/web/styles/portico/portico_signin.css b/web/styles/portico/portico_signin.css
index 23f987b3708..487e0df389f 100644
--- a/web/styles/portico/portico_signin.css
+++ b/web/styles/portico/portico_signin.css
@@ -364,8 +364,9 @@ html {
}
}
-.register-account {
- .terms-of-service .input-group,
+.register-account #registration {
+ .terms-of-service,
+ .input-group .marketing-emails,
.default-stream-groups .input-group,
.default-stream-groups p {
width: 330px;