mirror of
https://github.com/zulip/zulip.git
synced 2025-11-10 00:46:03 +00:00
templates: Fix minor whitespace errors.
(we also add validation)
This commit is contained in:
@@ -18,7 +18,7 @@
|
|||||||
</p>
|
</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li><code>Python</code> {{t "and" }} <code>https://replit.com/languages/python3/?code=</code></li>
|
<li><code>Python</code> {{t "and" }} <code>https://replit.com/languages/python3/?code=</code></li>
|
||||||
<li><code>JavaScript</code> {{t "and" }} <code>https://replit.com/languages/javascript/?code=</code></li>
|
<li><code>JavaScript</code> {{t "and" }} <code>https://replit.com/languages/javascript/?code=</code></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
{{#if is_admin}}
|
{{#if is_admin}}
|
||||||
|
|||||||
@@ -49,7 +49,7 @@
|
|||||||
How we work
|
How we work
|
||||||
</h1>
|
</h1>
|
||||||
<p>
|
<p>
|
||||||
<strong>Open source.</strong> The Zulip software is 100% free and
|
<strong>Open source.</strong> The Zulip software is 100% free and
|
||||||
open source. We're <a href="/team/">an open-source project</a> first,
|
open source. We're <a href="/team/">an open-source project</a> first,
|
||||||
and we’re building a sustainable business as a means to support the
|
and we’re building a sustainable business as a means to support the
|
||||||
project's growth and long-term future. We provide the same open-source
|
project's growth and long-term future. We provide the same open-source
|
||||||
@@ -77,7 +77,7 @@
|
|||||||
are open to all applicants without regard for location.
|
are open to all applicants without regard for location.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<strong>Maintainable software.</strong> Great
|
<strong>Maintainable software.</strong> Great
|
||||||
software over time depends on a team’s shared
|
software over time depends on a team’s shared
|
||||||
understanding of a system and how to change it, as
|
understanding of a system and how to change it, as
|
||||||
much as on the code itself. Beyond writing our
|
much as on the code itself. Beyond writing our
|
||||||
|
|||||||
@@ -49,7 +49,7 @@
|
|||||||
<input type="hidden" name="onboarding" value="true" />
|
<input type="hidden" name="onboarding" value="true" />
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if onboarding and free_trial_days %}
|
{% if onboarding and free_trial_days %}
|
||||||
<p><b>Not ready to start your trial?</b> <a href="/">Continue with the Zulip Cloud Free plan</a>.</p>
|
<p><b>Not ready to start your trial?</b> <a href="/">Continue with the Zulip Cloud Free plan</a>.</p>
|
||||||
<hr />
|
<hr />
|
||||||
<h2>Zulip Standard free trial</h2>
|
<h2>Zulip Standard free trial</h2>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -165,7 +165,7 @@
|
|||||||
<div id="invoice-input-section">
|
<div id="invoice-input-section">
|
||||||
<form id="invoice-form" method="post">
|
<form id="invoice-form" method="post">
|
||||||
{% if onboarding and free_trial_days %}
|
{% if onboarding and free_trial_days %}
|
||||||
<p><b>Not ready to start your trial?</b> <a href="/">Continue with the Zulip Cloud Free plan</a>.</p>
|
<p><b>Not ready to start your trial?</b> <a href="/">Continue with the Zulip Cloud Free plan</a>.</p>
|
||||||
<hr />
|
<hr />
|
||||||
<h2>Zulip Standard free trial</h2>
|
<h2>Zulip Standard free trial</h2>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
@@ -70,7 +70,7 @@
|
|||||||
<br />
|
<br />
|
||||||
|
|
||||||
<div class="row2">
|
<div class="row2">
|
||||||
<label for="URL"><b>URL</b> (automatically generated)</label>
|
<label for="URL"><b>URL</b> (automatically generated)</label>
|
||||||
<input id="URL" type="text" />
|
<input id="URL" type="text" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -10,5 +10,5 @@
|
|||||||
<p>{% trans realm_uri=macros.link_tag(realm_uri), old_email=macros.email_tag(old_email), new_email=macros.email_tag(new_email) %}We received a request to change the email address for the Zulip account on {{ realm_uri }} from {{ old_email }} to {{ new_email }}. To confirm this change, please click below:{% endtrans %}
|
<p>{% trans realm_uri=macros.link_tag(realm_uri), old_email=macros.email_tag(old_email), new_email=macros.email_tag(new_email) %}We received a request to change the email address for the Zulip account on {{ realm_uri }} from {{ old_email }} to {{ new_email }}. To confirm this change, please click below:{% endtrans %}
|
||||||
<a class="button" href="{{ activate_url }}">{{_('Confirm email change') }}</a></p>
|
<a class="button" href="{{ activate_url }}">{{_('Confirm email change') }}</a></p>
|
||||||
|
|
||||||
<p>{% trans support_email=macros.email_tag(support_email) %}If you did not request this change, please contact us immediately at {{ support_email }}.{% endtrans %}</p>
|
<p>{% trans support_email=macros.email_tag(support_email) %}If you did not request this change, please contact us immediately at {{ support_email }}.{% endtrans %}</p>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@@ -135,7 +135,7 @@ page can be easily identified in it's respective JavaScript file. -->
|
|||||||
<form class="social_login_form form-inline" action="{{ backend.login_url }}" method="get">
|
<form class="social_login_form form-inline" action="{{ backend.login_url }}" method="get">
|
||||||
<input type="hidden" name="next" value="{{ next }}" />
|
<input type="hidden" name="next" value="{{ next }}" />
|
||||||
<button id="login_{{ backend.button_id_suffix }}" class="login-social-button"
|
<button id="login_{{ backend.button_id_suffix }}" class="login-social-button"
|
||||||
{% if backend.display_icon %} style="background-image:url({{ backend.display_icon }})" {% endif %}> {{ _('Log in with %(identity_provider)s', identity_provider=backend.display_name) }}
|
{% if backend.display_icon %} style="background-image:url({{ backend.display_icon }})" {% endif %}> {{ _('Log in with %(identity_provider)s', identity_provider=backend.display_name) }}
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -290,6 +290,7 @@ def validate(fn: Optional[str] = None, text: Optional[str] = None) -> None:
|
|||||||
{e}"""
|
{e}"""
|
||||||
)
|
)
|
||||||
|
|
||||||
|
prevent_whitespace_violations(fn, tokens)
|
||||||
prevent_dangling_tags(fn, tokens)
|
prevent_dangling_tags(fn, tokens)
|
||||||
|
|
||||||
class State:
|
class State:
|
||||||
@@ -435,6 +436,38 @@ def validate(fn: Optional[str] = None, text: Optional[str] = None) -> None:
|
|||||||
raise TemplateParserException("Missing end tag")
|
raise TemplateParserException("Missing end tag")
|
||||||
|
|
||||||
|
|
||||||
|
def prevent_whitespace_violations(fn: str, tokens: List[Token]) -> None:
|
||||||
|
if tokens[0].kind in ("indent", "whitespace"):
|
||||||
|
raise TemplateParserException(f" Please remove the whitespace at the beginning of {fn}.")
|
||||||
|
|
||||||
|
for i in range(1, len(tokens) - 1):
|
||||||
|
token = tokens[i]
|
||||||
|
next_token = tokens[i + 1]
|
||||||
|
|
||||||
|
if token.kind == "indent":
|
||||||
|
if next_token.kind in ("indent", "whitespace"):
|
||||||
|
raise AssertionError("programming error parsing indents")
|
||||||
|
|
||||||
|
if next_token.kind == "newline":
|
||||||
|
raise TemplateParserException(
|
||||||
|
f"""Please just make row {token.line} in {fn} a truly blank line (no spaces)."""
|
||||||
|
)
|
||||||
|
|
||||||
|
if token.kind == "whitespace":
|
||||||
|
if len(token.s) > 1:
|
||||||
|
raise TemplateParserException(
|
||||||
|
f"""
|
||||||
|
We did not expect this much whitespace at row {token.line} column {token.col} in {fn}.
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
if next_token.kind == "newline":
|
||||||
|
raise TemplateParserException(
|
||||||
|
f"""
|
||||||
|
Unexpected trailing whitespace at row {token.line} column {token.col} in {fn}.
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def prevent_dangling_tags(fn: str, tokens: List[Token]) -> None:
|
def prevent_dangling_tags(fn: str, tokens: List[Token]) -> None:
|
||||||
"""
|
"""
|
||||||
Prevent this kind of HTML:
|
Prevent this kind of HTML:
|
||||||
|
|||||||
Reference in New Issue
Block a user