Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
templates: Move subdomain and import realm creation form fields.
Lauryn Menard829400de18a7
diff --git a/templates/zerver/create_realm.html b/templates/zerver/create_realm.htmlindex 87349e0f81b..822c1f7c5da 100644--- a/templates/zerver/create_realm.html+++ b/templates/zerver/create_realm.html@@ -21,6 +21,10 @@{{ csrf_input }}{% include 'zerver/realm_creation_base_form_fields.html' %}+ {% include 'zerver/realm_creation_subdomain_form_field.html' %}+ {% if is_realm_import_enabled %}+ {% include 'zerver/realm_creation_import_form_field.html' %}+ {% endif %}<div class="input-box horizontal"><div class="inline-block relative">diff --git a/templates/zerver/realm_creation_base_form_fields.html b/templates/zerver/realm_creation_base_form_fields.htmlindex d43a227d437..30216a523a1 100644--- a/templates/zerver/realm_creation_base_form_fields.html+++ b/templates/zerver/realm_creation_base_form_fields.html@@ -49,66 +49,4 @@</a></label></div>-- <div class="input-box">- <label class="static org-url">- {{ _('Organization URL') }}- </label>- {% if root_domain_available %}- <label class="checkbox static" for="realm_in_root_domain">- <input type="checkbox" name="realm_in_root_domain" id="realm_in_root_domain"- {% if not form.realm_subdomain.value() and not form.realm_subdomain.errors %}checked="checked"{% endif %}/>- <span class="rendered-checkbox"></span>- {% trans %}Use {{ external_host }}{% endtrans %}- </label>- {% endif %}-- <div id="subdomain_section" {% if root_domain_available and- not form.realm_subdomain.errors and not form.realm_subdomain.value() %}style="display: none;"{% endif %}>- <div class="or"><span>{{ _('OR') }}</span></div>- <div class="inline-block relative">- <input id="id_team_subdomain"- class="{% if root_domain_landing_page %}required{% endif %} subdomain" type="text"- placeholder="acme"- value="{% if form.realm_subdomain.value() %}{{ form.realm_subdomain.value() }}{% endif %}"- name="realm_subdomain" maxlength="{{ MAX_REALM_SUBDOMAIN_LENGTH }}"- {% if root_domain_landing_page %}required{% endif %} />- <label for="id_team_subdomain" class="realm_subdomain_label">.{{ external_host }}</label>- <p id="id_team_subdomain_error_client" class="error help-inline text-error"></p>- </div>- {% if form.realm_subdomain.errors %}- {% for error in form.realm_subdomain.errors %}- <p class="error help-inline text-error team_subdomain_error_server">{{ error }}</p>- {% endfor %}- {% endif %}- </div>- </div>-- {% if is_realm_import_enabled %}- <div class="input-box">- <div class="inline-block" id="realm-creation-import-from-wrapper">- <select id="import_from" name="import_from"- {% if user_registration_form %}- disabled- {% endif %}- >- {% for key, choice in import_from_choices %}- <option value="{{ key }}" {% if key == "none" %}selected{% endif %}>{{ _(choice) }}</option>- {% endfor %}- </select>- {% if not user_registration_form %}- <p class="extra-info-realm-creation-import-from registration-form-hint">- {% trans %}- Learn how to import from- <a href="/help/import-from-mattermost">Mattermost</a> or- <a href="/help/import-from-rocketchat">Rocket.Chat</a>.- {% endtrans %}- </p>- {% endif %}- </div>- <label for="import_from" class="inline-block">- {{ _('Import chat history?') }}- </label>- </div>- {% endif %}</div>diff --git a/templates/zerver/realm_creation_import_form_field.html b/templates/zerver/realm_creation_import_form_field.htmlnew file mode 100644index 00000000000..7facd6b364a--- /dev/null+++ b/templates/zerver/realm_creation_import_form_field.html@@ -0,0 +1,27 @@+<div class="realm-creation-editable-inputs {% if user_registration_form and not form.realm_subdomain.errors %}hide{% endif %}">+ <div class="input-box">+ <div class="inline-block" id="realm-creation-import-from-wrapper">+ <select id="import_from" name="import_from"+ {% if user_registration_form %}+ disabled+ {% endif %}+ >+ {% for key, choice in import_from_choices %}+ <option value="{{ key }}" {% if key == "none" %}selected{% endif %}>{{ _(choice) }}</option>+ {% endfor %}+ </select>+ {% if not user_registration_form %}+ <p class="extra-info-realm-creation-import-from registration-form-hint">+ {% trans %}+ Learn how to import from+ <a href="/help/import-from-mattermost">Mattermost</a> or+ <a href="/help/import-from-rocketchat">Rocket.Chat</a>.+ {% endtrans %}+ </p>+ {% endif %}+ </div>+ <label for="import_from" class="inline-block">+ {{ _('Import chat history?') }}+ </label>+ </div>+</div>diff --git a/templates/zerver/realm_creation_subdomain_form_field.html b/templates/zerver/realm_creation_subdomain_form_field.htmlnew file mode 100644index 00000000000..df4c7e4c8f4--- /dev/null+++ b/templates/zerver/realm_creation_subdomain_form_field.html@@ -0,0 +1,35 @@+<div class="realm-creation-editable-inputs {% if user_registration_form and not form.realm_subdomain.errors %}hide{% endif %}">+ <div class="input-box">+ <label class="static org-url">+ {{ _('Organization URL') }}+ </label>+ {% if root_domain_available %}+ <label class="checkbox static" for="realm_in_root_domain">+ <input type="checkbox" name="realm_in_root_domain" id="realm_in_root_domain"+ {% if not form.realm_subdomain.value() and not form.realm_subdomain.errors %}checked="checked"{% endif %}/>+ <span class="rendered-checkbox"></span>+ {% trans %}Use {{ external_host }}{% endtrans %}+ </label>+ {% endif %}++ <div id="subdomain_section" {% if root_domain_available and+ not form.realm_subdomain.errors and not form.realm_subdomain.value() %}style="display: none;"{% endif %}>+ <div class="or"><span>{{ _('OR') }}</span></div>+ <div class="inline-block relative">+ <input id="id_team_subdomain"+ class="{% if root_domain_landing_page %}required{% endif %} subdomain" type="text"+ placeholder="acme"+ value="{% if form.realm_subdomain.value() %}{{ form.realm_subdomain.value() }}{% endif %}"+ name="realm_subdomain" maxlength="{{ MAX_REALM_SUBDOMAIN_LENGTH }}"+ {% if root_domain_landing_page %}required{% endif %} />+ <label for="id_team_subdomain" class="realm_subdomain_label">.{{ external_host }}</label>+ <p id="id_team_subdomain_error_client" class="error help-inline text-error"></p>+ </div>+ {% if form.realm_subdomain.errors %}+ {% for error in form.realm_subdomain.errors %}+ <p class="error help-inline text-error team_subdomain_error_server">{{ error }}</p>+ {% endfor %}+ {% endif %}+ </div>+ </div>+</div>diff --git a/templates/zerver/register.html b/templates/zerver/register.htmlindex 13cbde5d26c..3c1a678e954 100644--- a/templates/zerver/register.html+++ b/templates/zerver/register.html@@ -41,6 +41,10 @@ Form is validated both client-side using jquery-validation (see signup.js) and s{% with %}{% set user_registration_form = "true" %}{% include 'zerver/realm_creation_base_form_fields.html' %}+ {% include 'zerver/realm_creation_subdomain_form_field.html' %}+ {% if is_realm_import_enabled %}+ {% include 'zerver/realm_creation_import_form_field.html' %}+ {% endif %}{% endwith %}{% if not form.realm_subdomain.errors %}<div class="not-editable-realm-details">diff --git a/tools/linter_lib/custom_check.py b/tools/linter_lib/custom_check.pyindex 4f31728232b..05320949da8 100644--- a/tools/linter_lib/custom_check.py+++ b/tools/linter_lib/custom_check.py@@ -577,7 +577,7 @@ html_rules: list["Rule"] = ["pattern": r'placeholder="[^{#](?:(?!\.com).)+$',"description": "`placeholder` value should be translatable.","exclude_line": {- ("templates/zerver/realm_creation_base_form_fields.html", 'placeholder="acme"'),+ ("templates/zerver/realm_creation_subdomain_form_field.html", 'placeholder="acme"'),("templates/zerver/slack_import.html", 'placeholder="xoxb-…"'),},"exclude": {