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.

captcha: Extract the widget form field into a shared template.

Alex Vandiver7001dc4b5352
diff --git a/templates/zerver/altcha_form_field.html b/templates/zerver/altcha_form_field.html
new file mode 100644
index 00000000000..1b44ff7503b
--- /dev/null
+++ b/templates/zerver/altcha_form_field.html
@@ -0,0 +1,8 @@
+{% if has_captcha %}
+ {% if form.captcha.errors %}
+ {% for error in form.captcha.errors %}
+ <p class="help-inline text-error">{{ error }}</p>
+ {% endfor %}
+ {% endif %}
+ {{ form.captcha }}
+{% endif %}
diff --git a/templates/zerver/create_realm/create_demo_realm.html b/templates/zerver/create_realm/create_demo_realm.html
index 860812d12bf..d664bfe2cfe 100644
--- a/templates/zerver/create_realm/create_demo_realm.html
+++ b/templates/zerver/create_realm/create_demo_realm.html
@@ -25,14 +25,7 @@
{% endif %}
<div class="input-box" id="demo-submit-button-container">
<button type="submit" class="new-organization-button register-button">{{ _("Try Zulip") }}</button>
- {% if has_captcha %}
- {% if form.captcha.errors %}
- {% for error in form.captcha.errors %}
- <p class="help-inline text-error">{{ error }}</p>
- {% endfor %}
- {% endif %}
- {{ form.captcha }}
- {% endif %}
+ {% include 'zerver/altcha_form_field.html' %}
</div>
</form>
</div>
diff --git a/templates/zerver/create_realm/create_realm.html b/templates/zerver/create_realm/create_realm.html
index 6e27b94c92e..65ede981233 100644
--- a/templates/zerver/create_realm/create_realm.html
+++ b/templates/zerver/create_realm/create_realm.html
@@ -48,14 +48,7 @@
</div>
<div class="input-box" id="altcha-submit-button-container">
<button type="submit" class="new-organization-button register-button">{{ _("Create organization") }}</button>
- {% if has_captcha %}
- {% if form.captcha.errors %}
- {% for error in form.captcha.errors %}
- <p class="help-inline text-error">{{ error }}</p>
- {% endfor %}
- {% endif %}
- {{ form.captcha }}
- {% endif %}
+ {% include 'zerver/altcha_form_field.html' %}
</div>
</form>
</div>