linter: Make html singleton tags use 2 space indentation.

This commit is contained in:
Aditya Bansal 2018-04-03 13:37:23 +05:30 committed by Tim Abbott
parent 7eacf2aa9a
commit 2fe012ffff
31 changed files with 154 additions and 112 deletions

View File

@ -9,7 +9,7 @@
<div class="input-group">
<label for="create_alert_word_name">{{t "New alert word" }}</label>
<input type="text" name="alert_word_name" id="create_alert_word_name" class="required"
maxlength=100 placeholder="{{t 'Alert word' }}" value="" />
maxlength=100 placeholder="{{t 'Alert word' }}" value="" />
</div>
<button class="button rounded sea-green add-alert-word" id="create_alert_word_button" type="button">
{{t 'Add alert word'}}

View File

@ -1,5 +1,5 @@
<div class="input-group" name="{{botname}}" id="{{botname}}_{{key}}">
<label for="{{botname}}_{{key}}_input">{{key}}</label>
<input type="text" name="{{key}}" id="{{botname}}_{{key}}_input"
maxlength=1000 placeholder="{{value}}" value="" />
maxlength=1000 placeholder="{{value}}" value="" />
</div>

View File

@ -8,7 +8,7 @@
<label class="checkbox display-block">
<input type="checkbox" name="stream" value="{{name}}"
{{#if default_stream}}checked="checked"{{/if}} />
{{#if default_stream}}checked="checked"{{/if}} />
<span></span>
{{#if invite_only}}<i class="fa fa-lock" aria-hidden="true"></i>{{/if}}
{{name}}

View File

@ -19,7 +19,7 @@
<br />
<input class="add-user-list-filter" name="user_list_filter" type="text"
autocomplete="off" placeholder="{{t "Filter" }}" />
autocomplete="off" placeholder="{{t "Filter" }}" />
<div>

View File

@ -48,8 +48,8 @@
</button>
</a>
<i class="icon-vector-question-sign change_name_tooltip settings-info-icon" data-toggle="tooltip"
{{#if page_params.is_admin}}style="display:none"{{else}}{{#unless page_params.realm_name_changes_disabled}}style="display:none"{{/unless}}{{/if}}
title="{{t 'Changing your name has been disabled by your Zulip organization administrators. Contact an administrator for help.' }}"/>
{{#if page_params.is_admin}}style="display:none"{{else}}{{#unless page_params.realm_name_changes_disabled}}style="display:none"{{/unless}}{{/if}}
title="{{t 'Changing your name has been disabled by your Zulip organization administrators. Contact an administrator for help.' }}"/>
</div>
<div id="change_full_name_modal" class="modal modal-bg hide" tabindex="-1" role="dialog"
aria-labelledby="change_full_name_modal_label" aria-hidden="true">
@ -103,7 +103,7 @@
<div class="field">
<label for="new_password" class="title">{{t "New password" }}</label>
<input type="password" autocomplete="off" name="new_password" id="new_password" class="w-200 inline-block" value=""
data-min-length="{{ page_params.password_min_length }}" data-min-guesses="{{ page_params.password_min_guesses }}" />
data-min-length="{{ page_params.password_min_length }}" data-min-guesses="{{ page_params.password_min_guesses }}" />
<div class="progress inline-block" id="pw_strength">
<div class="bar bar-danger fade" style="width: 10%;"></div>
</div>
@ -192,7 +192,7 @@
<div class="control-group">
<label for="password" class="control-label">{{t "Current password" }}</label>
<input type="password" autocomplete="off"
name="password" id="get_api_key_password" value="" />
name="password" id="get_api_key_password" value="" />
</div>
<div class="control-group">
<button type="submit" name="view_api_key"

View File

@ -4,7 +4,7 @@
<td>
<label class="checkbox">
<input type="checkbox" class="allow-subdomains"
{{#if allow_subdomains}} checked="checked" {{/if}} />
{{#if allow_subdomains}} checked="checked" {{/if}} />
<span></span>
</label>
</td>

View File

@ -55,13 +55,13 @@
<div class="input-group">
<label for="create_bot_name">{{t "Full name" }}</label>
<input type="text" name="bot_name" id="create_bot_name" class="required"
maxlength=100 placeholder="{{t 'Cookie Bot' }}" value="" />
maxlength=100 placeholder="{{t 'Cookie Bot' }}" value="" />
<div><label for="create_bot_name" generated="true" class="text-error"></label></div>
</div>
<div class="input-group">
<label for="bot_short_name">{{t "Username" }}</label>
<input type="text" name="bot_short_name" id="create_bot_short_name" class="required bot_local_part"
placeholder="{{t 'cookie' }}" value="" />
placeholder="{{t 'cookie' }}" value="" />
-bot@{{ page_params.realm_bot_domain }}
<div>
<label for="create_bot_short_name" generated="true" class="text-error"></label>
@ -71,7 +71,7 @@
<div class="input-group">
<label for="create_payload_url">{{t "Endpoint URL" }}</label>
<input type="text" name="payload_url" id="create_payload_url"
maxlength=100 placeholder="https://hostname.example.com/bots/followup" value="" />
maxlength=100 placeholder="https://hostname.example.com/bots/followup" value="" />
<div><label for="create_payload_url" generated="true" class="text-error"></label></div>
</div>
<div class="input-group">

View File

@ -23,9 +23,9 @@
<div class="input-group">
<label class="checkbox">
<input type="checkbox" name="night_mode" id="night_mode"
{{#if page_params.night_mode}}
{{#if page_params.night_mode}}
checked="checked"
{{/if}} />
{{/if}} />
<span></span>
</label>
<label for="night_mode" class="inline-block">{{t "Night mode" }}</label>
@ -34,9 +34,9 @@
<div class="input-group">
<label class="checkbox">
<input type="checkbox" name="high_contrast_mode" id="high_contrast_mode"
{{#if page_params.high_contrast_mode}}
{{#if page_params.high_contrast_mode}}
checked="checked"
{{/if}} />
{{/if}} />
<span></span>
</label>
<label for="high_contrast_mode" class="inline-block">{{t "High contrast mode" }}</label>
@ -45,9 +45,9 @@
<div class="input-group">
<label class="checkbox">
<input type="checkbox" name="left_side_userlist" id="left_side_userlist"
{{#if page_params.left_side_userlist}}
{{#if page_params.left_side_userlist}}
checked="checked"
{{/if}} />
{{/if}} />
<span></span>
</label>
<label for="left_side_userlist" class="inline-block">{{t "User list on left sidebar in narrow windows" }}</label>
@ -59,9 +59,9 @@
<div class="input-group">
<label class="checkbox">
<input type="checkbox" name="twenty_four_hour_time" id="twenty_four_hour_time"
{{#if page_params.twenty_four_hour_time}}
{{#if page_params.twenty_four_hour_time}}
checked="checked"
{{/if}} />
{{/if}} />
<span></span>
</label>
<label for="twenty_four_hour_time" class="inline-block">
@ -109,9 +109,9 @@
<div class="input-group">
<label class="checkbox">
<input type="checkbox" name="translate_emoticons" id="translate_emoticons"
{{#if page_params.translate_emoticons}}
checked="checked"
{{/if}} />
{{#if page_params.translate_emoticons}}
checked="checked"
{{/if}} />
<span></span>
</label>
<label for="translate_emoticons" class="inline-block">

View File

@ -3,7 +3,7 @@
<div class="input-group">
<label for="embedded_bot_{{@key}}_edit">{{@key}}</label>
<input type="text" name="{{@key}}" id="embedded_bot_{{@key}}_edit"
maxlength=1000 value="{{this}}" />
maxlength=1000 value="{{this}}" />
</div>
{{/each}}
</div>

View File

@ -14,7 +14,7 @@
<div class="inline-block">
<span id="emoji-file-name"></span>
<input type="file" name="emoji_file_input" class="notvisible"
id="emoji_file_input" value="{{t 'Upload emoji' }}"/>
id="emoji_file_input" value="{{t 'Upload emoji' }}"/>
<button class="button white rounded display-none" id="emoji_image_clear_button">{{t "Clear emoji image" }}</button>
<button class="button rounded" id="emoji_upload_button">{{t "Upload emoji" }}</button>
</div>

View File

@ -44,11 +44,11 @@
<div class="input-group disableable {{#unless page_params.enable_desktop_notifications}}control-label-disabled{{/unless}}">
<label class="checkbox">
<input type="checkbox" name="pm_content_in_desktop_notifications"
id="pm_content_in_desktop_notifications"
{{#unless page_params.enable_desktop_notifications}}disabled="disabled"{{/unless}}
{{#if page_params.pm_content_in_desktop_notifications}}
checked="checked"
{{/if}} />
id="pm_content_in_desktop_notifications"
{{#unless page_params.enable_desktop_notifications}}disabled="disabled"{{/unless}}
{{#if page_params.pm_content_in_desktop_notifications}}
checked="checked"
{{/if}} />
<span></span>
</label>
<label for="pm_content_in_desktop_notifications" id="pm_content_in_desktop_notifications_label" class="inline-block">
@ -74,10 +74,10 @@
<div class="input-group disableable {{#unless page_params.enable_offline_push_notifications}}control-label-disabled{{/unless}}">
<label class="checkbox">
<input type="checkbox" name="enable_online_push_notifications" id="enable_online_push_notifications"
{{#unless page_params.enable_offline_push_notifications}}disabled="disabled"{{/unless}}
{{#if page_params.enable_online_push_notifications}}
checked="checked"
{{/if}} />
{{#unless page_params.enable_offline_push_notifications}}disabled="disabled"{{/unless}}
{{#if page_params.enable_online_push_notifications}}
checked="checked"
{{/if}} />
<span></span>
</label>
<label for="enable_online_push_notifications" id="enable_online_push_notifications_label" class="inline-block">
@ -99,11 +99,11 @@
<div class="input-group {{#unless page_params.enable_offline_email_notifications}}control-label-disabled{{/unless}}">
<label class="checkbox">
<input type="checkbox" name="message_content_in_email_notifications"
id="message_content_in_email_notifications"
{{#unless page_params.enable_offline_email_notifications}}disabled="disabled"{{/unless}}
{{#if page_params.message_content_in_email_notifications}}
checked="checked"
{{/if}} />
id="message_content_in_email_notifications"
{{#unless page_params.enable_offline_email_notifications}}disabled="disabled"{{/unless}}
{{#if page_params.message_content_in_email_notifications}}
checked="checked"
{{/if}} />
<span></span>
</label>
<label for="message_content_in_email_notifications" id="message_content_in_email_notifications_label" class="inline-block">

View File

@ -12,7 +12,7 @@
<div class="input-group admin-restricted-to-domain">
<label class="checkbox">
<input type="checkbox" name="realm_restricted_to_domain" id="id_realm_restricted_to_domain"
{{#if realm_restricted_to_domain}}checked="checked"{{/if}} />
{{#if realm_restricted_to_domain}}checked="checked"{{/if}} />
<span></span>
</label>
<label for="id_realm_restricted_to_domain" id="realm_restricted_to_domains_label" class="inline-block" />
@ -24,7 +24,7 @@
<div class="input-group admin-disallow-disposable-email-addresses {{#if realm_restricted_to_domain}}control-label-disabled{{/if}}">
<label class="checkbox">
<input type="checkbox" name="realm_disallow_disposable_email_addresses" id="id_realm_disallow_disposable_email_addresses"
{{#if realm_disallow_disposable_email_addresses}}checked="checked"{{/if}} {{#if realm_restricted_to_domain}}disabled="disabled"{{/if}}/>
{{#if realm_disallow_disposable_email_addresses}}checked="checked"{{/if}} {{#if realm_restricted_to_domain}}disabled="disabled"{{/if}}/>
<span></span>
</label>
<label for="id_realm_disallow_disposable_email_addresses" id="id_realm_disallow_disposable_email_addresses_label" class="inline-block">
@ -42,8 +42,8 @@
<div class="input-group disableable {{#unless realm_invite_required}}control-label-disabled{{/unless}}">
<label class="checkbox">
<input type="checkbox" name="realm_invite_by_admins_only" id="id_realm_invite_by_admins_only"
{{#unless realm_invite_required}}disabled="disabled"{{/unless}}
{{#if realm_invite_by_admins_only}}checked="checked"{{/if}} />
{{#unless realm_invite_required}}disabled="disabled"{{/unless}}
{{#if realm_invite_by_admins_only}}checked="checked"{{/if}} />
<span></span>
</label>
<label for="id_realm_invite_by_admins_only" id="id_realm_invite_by_admins_only_label" class="inline-block">
@ -91,9 +91,9 @@
<div class="inline-block">
<label for="aitin" class="inline-block">{{t "Minimum account age (N)" }}:</label>
<input type="text" id="id_realm_waiting_period_threshold"
name="realm_waiting_period_threshold"
class="admin-realm-message-content-edit-limit-minutes"
value="{{ realm_waiting_period_threshold }}"/>
name="realm_waiting_period_threshold"
class="admin-realm-message-content-edit-limit-minutes"
value="{{ realm_waiting_period_threshold }}"/>
</div>
<div class="input-group">

View File

@ -13,7 +13,7 @@
<div class="input-group admin-realm">
<label for="id_realm_name">{{t "Your organization's name" }}</label>
<input type="text" id="id_realm_name" name="realm_name" class="admin-realm-name"
value="{{ realm_name }}" maxlength="40" />
value="{{ realm_name }}" maxlength="40" />
</div>
<div class="input-group admin-realm">
<label for="realm_description">{{t "Your organization's description" }}</label>
@ -29,7 +29,7 @@
<div class="inline-block">
<img id="realm-settings-icon" src="{{ realm_icon_url }}"/>
<input type="file" name="realm_icon_file_input" class="notvisible"
id="realm_icon_file_input" value="{{t 'Upload icon' }}"/>
id="realm_icon_file_input" value="{{t 'Upload icon' }}"/>
<div id="upload_icon_spinner"></div>
</div>
<div class="inline-block avatar-controls">

View File

@ -22,23 +22,23 @@
{{t 'Message edit limit in minutes (0 for no limit)' }}
</label>
<input type="text" id="id_realm_message_content_edit_limit_minutes"
name="realm_message_content_edit_limit_minutes"
class="admin-realm-message-content-edit-limit-minutes"
value="{{ realm_message_content_edit_limit_minutes }}"
{{#unless realm_allow_message_editing}}disabled="disabled"{{/unless}} />
name="realm_message_content_edit_limit_minutes"
class="admin-realm-message-content-edit-limit-minutes"
value="{{ realm_message_content_edit_limit_minutes }}"
{{#unless realm_allow_message_editing}}disabled="disabled"{{/unless}} />
</div>
<div class="input-group">
<label class="checkbox">
<input type="checkbox" id="id_realm_allow_message_deleting" name="realm_allow_message_deleting"
{{#if realm_allow_message_deleting}}checked="checked"{{/if}} />
{{#if realm_allow_message_deleting}}checked="checked"{{/if}} />
<span></span>
</label>
<label for="id_realm_allow_message_deleting" id="id_realm_allow_message_deleting_label" class="inline-block">
{{t "Users can delete their messages" }}
</label>
<i class="icon-vector-info-sign settings-info-icon realm_allow_message_deleting_tooltip" data-toggle="tooltip"
title="{{t 'Administrators can always delete any message.' }}"/>
title="{{t 'Administrators can always delete any message.' }}"/>
</div>
{{partial "settings_checkbox"
@ -62,9 +62,9 @@
{{t 'Messages retention period in days (blank means messages are retained forever)' }}
</label>
<input type="text" id="id_realm_message_retention_days"
name="realm_message_retention_days"
class="admin-realm-message-retention-days"
value="{{ realm_message_retention_days }}"/>
name="realm_message_retention_days"
class="admin-realm-message-retention-days"
value="{{ realm_message_retention_days }}"/>
</div>
{{/if}}
{{partial "settings_checkbox"

View File

@ -1,10 +1,10 @@
<div class="input-group">
<label class="checkbox">
<input type="checkbox" class="inline-block" name="{{setting_name}}"
id="{{prefix}}{{setting_name}}"
{{#if is_checked}}
checked="checked"
{{/if}} />
id="{{prefix}}{{setting_name}}"
{{#if is_checked}}
checked="checked"
{{/if}} />
<span></span>
</label>
<label for="{{prefix}}{{setting_name}}" class="inline-block" id="{{prefix}}{{setting_name}}_label">

View File

@ -8,9 +8,9 @@
<div class="input-group">
<label class="checkbox">
<input type="checkbox" class="inline-block change-setting" name="default_desktop_notifications" id="default_desktop_notifications"
{{#if page_params.default_desktop_notifications}}
checked="checked"
{{/if}} />
{{#if page_params.default_desktop_notifications}}
checked="checked"
{{/if}} />
<span></span>
</label>
<label for="default_desktop_notifications" class="inline-block">

View File

@ -9,7 +9,7 @@
{{t "Stream name" }}
</div>
<input type="text" name="stream_name" id="create_stream_name"
placeholder="{{t 'Stream name' }}" value="" autocomplete="off" />
placeholder="{{t 'Stream name' }}" value="" autocomplete="off" />
<div id="stream_name_error" class="stream_creation_error"></div>
</section>
<section class="block">

View File

@ -15,7 +15,7 @@
placeholder="{{t 'Filter streams' }}" value="" autocomplete="off" />
{{#if can_create_streams}}
<input type="submit" class="create_stream_button"
value="+" title="{{t 'Create new stream' }} (n)"/>
value="+" title="{{t 'Create new stream' }} (n)"/>
{{/if}}
<div class="float-clear"></div>
</form>

View File

@ -37,7 +37,7 @@ the registration flow has its own (nearly identical) copy of the fields below in
at all. (So, it's not symmetric to the code above.)
#}
<input id="id_terms" class="required" type="checkbox" name="terms"
{% if form.terms.value() %}checked="checked"{% endif %} />
{% if form.terms.value() %}checked="checked"{% endif %} />
{% trans %}I agree to the <a href="{{ root_domain_uri }}/terms">Terms of Service</a>.{% endtrans %}
</label>
{% if form.terms.errors %}

View File

@ -70,12 +70,12 @@
<i class="icon-vector-lock" title="{{ _('This is an invite-only stream') }}"></i>
</span>
<input type="text" class="recipient_box" name="stream" id="stream"
maxlength="30"
value="" placeholder="{{ _('Stream') }}" autocomplete="off" tabindex="0" aria-label="{{ _('Stream') }}"/>
maxlength="30"
value="" placeholder="{{ _('Stream') }}" autocomplete="off" tabindex="0" aria-label="{{ _('Stream') }}"/>
<i class="icon-vector-narrow icon-vector-small"></i>
<input type="text" class="recipient_box" name="subject" id="subject"
maxlength="60"
value="" placeholder="{{ _('Topic') }}" autocomplete="off" tabindex="0" aria-label="{{ _('Topic') }}"/>
maxlength="60"
value="" placeholder="{{ _('Topic') }}" autocomplete="off" tabindex="0" aria-label="{{ _('Topic') }}"/>
</td>
</tr>
<tr id="private-message">

View File

@ -31,9 +31,9 @@
<form class="form-inline" id="send_confirm" name="send_confirm"
action="/login/" method="get">
<input type="hidden"
id="email"
name="email"
value="{{ email }}" />
id="email"
name="email"
value="{{ email }}" />
<button>
{{ _("Go back to login") }}
</button>

View File

@ -23,7 +23,7 @@ $(function () {
<div class="input-box horizontal">
<div class="inline-block relative">
<input type="text" class="email required" placeholder="{{ _("Enter your email address") }}"
id="email" name="email" required />
id="email" name="email" required />
<label for="id_username">{{ _('Email') }}</label>
</div>

View File

@ -94,7 +94,7 @@
data-categories="{{ integration.categories }}"
data-name="{{ integration.name }}">
<img class="integration-logo" src="/{{ integration.logo }}"
alt="{{ integration.display_name }} logo"/>
alt="{{ integration.display_name }} logo"/>
{% if integration.secondary_line_text %}
<h3 class="integration-name with-secondary">{{ integration.display_name }}</h3>
<h4 class="integration-secondary-line-text">

View File

@ -218,9 +218,9 @@
<td class="definition">
{% trans %}React to selected message with{% endtrans %}
<img alt=":thumbs_up:"
class="emoji"
src="/static/generated/emoji/images/emoji/unicode/1f44d.png"
title=":thumbs_up:"/>
class="emoji"
src="/static/generated/emoji/images/emoji/unicode/1f44d.png"
title=":thumbs_up:"/>
</td>
</tr>
<tr>

View File

@ -72,9 +72,9 @@
<!-- .no-validation is for removing the red star in CSS -->
<div class="input-box no-validation">
<input id="id_username" type="{% if not require_email_format_usernames %}text{% else %}email{% endif %}"
name="username" class="{% if require_email_format_usernames %}email {% endif %}required"
{% if email %} value="{{ email }}" {% else %} value="" {% endif %}
maxlength="72" required />
name="username" class="{% if require_email_format_usernames %}email {% endif %}required"
{% if email %} value="{{ email }}" {% else %} value="" {% endif %}
maxlength="72" required />
<label for="id_username">
{% if not require_email_format_usernames and email_auth_enabled %}
{{ _('Email or username') }}

View File

@ -50,7 +50,7 @@
<form id="searchbox_form" class="form-search navbar-search">
<div id="search_arrows" class="input-append">
<input class="search-query input-block-level" id="search_query" type="text" placeholder="{{ _('Search') }}"
autocomplete="off" aria-label="{{ _('Search') }}" title="{{ _('Search') }} (/)"/>
autocomplete="off" aria-label="{{ _('Search') }}" title="{{ _('Search') }} (/)"/>
{# Start the button off disabled since there is no active search #}
<button class="btn search_button" type="button" id="search_exit" disabled="disabled" aria-label="{{ _('Exit search') }}"><i class="icon-vector-remove"></i></button>
<a class="search_icon" href="#search-operators" data-overlay-trigger="search-operators" title="{{ _('Search help') }}"><i class="icon-vector-search"></i></a>

View File

@ -47,8 +47,8 @@ Form is validated both client-side using jquery-validate (see signup.js) and ser
<p class="fakecontrol">{{ full_name }}</p>
{% else %}
<input id="id_full_name" class="required" type="text" name="full_name"
value="{% if full_name %}{{ full_name }}{% elif form.full_name.value() %}{{ form.full_name.value() }}{% endif %}"
maxlength={{ MAX_NAME_LENGTH }} placeholder="{% trans %}Full name or 名前{% endtrans %}" required />
value="{% if full_name %}{{ full_name }}{% elif form.full_name.value() %}{{ form.full_name.value() }}{% endif %}"
maxlength={{ MAX_NAME_LENGTH }} placeholder="{% trans %}Full name or 名前{% endtrans %}" required />
<label for="id_full_name" class="inline-block label-title">{{ _('Full name') }}</label>
{% if form.full_name.errors %}
{% for error in form.full_name.errors %}
@ -61,10 +61,10 @@ Form is validated both client-side using jquery-validate (see signup.js) and ser
{% if password_required %}
<div class="input-box">
<input id="id_password" class="required" type="password" name="password"
value="{% if form.password.value() %}{{ form.password.value() }}{% endif %}"
maxlength={{ MAX_PASSWORD_LENGTH }}
data-min-length="{{password_min_length}}"
data-min-guesses="{{password_min_guesses}}" required />
value="{% if form.password.value() %}{{ form.password.value() }}{% endif %}"
maxlength={{ MAX_PASSWORD_LENGTH }}
data-min-length="{{password_min_length}}"
data-min-guesses="{{password_min_guesses}}" required />
<label for="id_password" class="inline-block">{{ _('Password') }}</label>
{% if full_name %}
<span class="help-inline">
@ -89,7 +89,7 @@ Form is validated both client-side using jquery-validate (see signup.js) and ser
{% for default_stream_group in default_stream_groups %}
<div class="input-group radio">
<input class="inline-block" type="checkbox" name="default_stream_group" value="{{ default_stream_group.name }}"
{% if "default_stream_group" in form.data and default_stream_group.name in form.data.getlist('default_stream_group') %} checked {% endif %} />
{% if "default_stream_group" in form.data and default_stream_group.name in form.data.getlist('default_stream_group') %} checked {% endif %} />
<label for="id_radio_{{ default_stream_group.name }}" class="inline-block">{{ default_stream_group.name }}</label>
</div>
{% endfor %}
@ -101,9 +101,9 @@ Form is validated both client-side using jquery-validate (see signup.js) and ser
<div class="input-box">
<div class="inline-block relative">
<input id="id_team_name" class="required" type="text"
placeholder="Acme or Aκμή"
value="{% if form.realm_name.value() %}{{ form.realm_name.value() }}{% endif %}"
name="realm_name" maxlength={{ MAX_REALM_NAME_LENGTH }} required />
placeholder="Acme or Aκμή"
value="{% if form.realm_name.value() %}{{ form.realm_name.value() }}{% endif %}"
name="realm_name" maxlength={{ MAX_REALM_NAME_LENGTH }} required />
</div>
<label for="id_team_name" class="inline-block label-title">{{ _('Organization name') }}</label>
{% if form.realm_name.errors %}
@ -124,7 +124,7 @@ Form is validated both client-side using jquery-validate (see signup.js) and ser
{% 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 %}/>
{% if not form.realm_subdomain.value() and not form.realm_subdomain.errors %}checked="checked"{% endif %}/>
<span></span>
{% trans %}Use {{ external_host }}{% endtrans %}
</label>
@ -135,11 +135,11 @@ Form is validated both client-side using jquery-validate (see signup.js) and ser
<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 %} />
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>
@ -169,7 +169,7 @@ Form is validated both client-side using jquery-validate (see signup.js) and ser
#}
<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 %} />
{% if form.terms.value() %}checked="checked"{% endif %} />
<span></span>
{% trans %}I agree to the <a href="{{ root_domain_uri }}/terms" target="_blank">Terms of Service</a>.{% endtrans %}
</label>

View File

@ -18,8 +18,8 @@
<div class="input-box horizontal moving-label">
<div class="inline-block relative">
<input id="id_email" class="required" type="text" name="email"
value="{% if form.email.value() %}{{ form.email.value() }}{% endif %}"
maxlength="100" required />
value="{% if form.email.value() %}{{ form.email.value() }}{% endif %}"
maxlength="100" required />
<label for="id_email" class="">{{ _('Email') }}</label>
{% if form.email.errors %}
{% for error in form.email.errors %}

View File

@ -29,10 +29,10 @@
<div class="input-box">
<label for="id_new_password1" class="">{{ _('Password') }}</label>
<input id="id_new_password1" class="required" type="password" name="new_password1"
value="{% if form.new_password1.value() %}{{ form.new_password1.value() }}{% endif %}"
maxlength="100"
data-min-length="{{password_min_length}}"
data-min-guesses="{{password_min_guesses}}" required />
value="{% if form.new_password1.value() %}{{ form.new_password1.value() }}{% endif %}"
maxlength="100"
data-min-length="{{password_min_length}}"
data-min-guesses="{{password_min_guesses}}" required />
{% if form.new_password1.errors %}
{% for error in form.new_password1.errors %}
<div class="alert alert-error">{{ error }}</div>
@ -49,8 +49,8 @@
<div class="input-box">
<label for="id_new_password2" class="">{{ _('Confirm password') }}</label>
<input id="id_new_password2" class="required" type="password" name="new_password2"
value="{% if form.new_password2.value() %}{{ form.new_password2.value() }}{% endif %}"
maxlength="100" required />
value="{% if form.new_password2.value() %}{{ form.new_password2.value() }}{% endif %}"
maxlength="100" required />
{% if form.new_password2.errors %}
{% for error in form.new_password2.errors %}
<div class="alert alert-error">{{ error }}</div>

View File

@ -114,19 +114,25 @@ def pretty_print_html(html, num_spaces=4):
offsets[start_line] = info['offset']
line = lines[token.line - 1]
adjustment = len(line)-len(line.lstrip()) + 1
if adjustment == token.col:
if adjustment == token.col and token.kind != 'html_singleton_end':
offsets[end_line] = (info['offset'] +
info['adjustment'] -
adjustment +
info['extra_indent'] -
info['extra_indent_prev'])
elif (start_line + info['line_span'] - 1 == end_line and
info['line_span'] > 2 and token.kind != 'html_singleton_end'):
(info['line_span'] > 2 or
(info['line_span'] == 2 and
token.kind == 'html_singleton_end'))):
offsets[end_line] = (1 + info['extra_indent'] +
(info['depth'] + 1) * num_spaces) - adjustment
if token.kind == 'html_singleton_end':
# We would like singleton tags to have 2 space
# indentation in case they span over multiple lines.
offsets[end_line] -= 2
elif token.line != info['line']:
offsets[end_line] = info['offset']
if token.tag != 'pre' and token.kind != 'html_singleton_end' and token.tag != 'script':
if token.tag != 'pre' and token.tag != 'script':
for line_num in range(start_line + 1, end_line):
# Be careful not to override offsets that happened
# deeper in the HTML within our block.
@ -140,6 +146,10 @@ def pretty_print_html(html, num_spaces=4):
extra_indent = info['extra_indent']
adjustment = len(line)-len(line.lstrip()) + 1
offset = (1 + extra_indent + new_depth * num_spaces) - adjustment
if token.kind == 'html_singleton_end':
# We would like singleton tags to have 2 space
# indentation in case they span over multiple lines.
offset -= 2
offsets[line_num] = offset
elif (token.kind in ('handlebars_end', 'django_end') and
info['indenting'] and

View File

@ -197,7 +197,7 @@ BAD_HTML7 = """
GOOD_HTML7 = """
<div class="foobar">
<input type="foobar" name="temp" value="{{dyn_name}}"
{{#unless invite_only}}checked="checked"{{/unless}} /> {{dyn_name}}
{{#unless invite_only}}checked="checked"{{/unless}} /> {{dyn_name}}
{{#if invite_only}}<i class="icon-vector-lock"></i>{{/if}}
</div>
"""
@ -389,6 +389,37 @@ GOOD_HTML14 = """
{{/if}}
</div>
"""
BAD_HTML15 = """
<div>
<img alt=":thumbs_up:"
class="emoji"
src="/path/to/png"
title=":thumbs_up:"/>
<img alt=":thumbs_up:"
class="emoji"
src="/path/to/png"
title=":thumbs_up:"/>
<img alt=":thumbs_up:"
title=":thumbs_up:"/>
</div>
"""
GOOD_HTML15 = """
<div>
<img alt=":thumbs_up:"
class="emoji"
src="/path/to/png"
title=":thumbs_up:"/>
<img alt=":thumbs_up:"
class="emoji"
src="/path/to/png"
title=":thumbs_up:"/>
<img alt=":thumbs_up:"
title=":thumbs_up:"/>
</div>
"""
class TestPrettyPrinter(unittest.TestCase):
def compare(self, a: str, b: str) -> None:
self.assertEqual(a.split('\n'), b.split('\n'))
@ -410,3 +441,4 @@ class TestPrettyPrinter(unittest.TestCase):
self.compare(pretty_print_html(BAD_HTML12), GOOD_HTML12)
self.compare(pretty_print_html(BAD_HTML13), GOOD_HTML13)
self.compare(pretty_print_html(BAD_HTML14), GOOD_HTML14)
self.compare(pretty_print_html(BAD_HTML15), GOOD_HTML15)