forked from pallets-eco/flask-security-3.0
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Uniformity in Templates (pallets-eco#743)
* Update Russian translations * Forms method value to lowercase: GET->get, POST->post * Uniformity of indentation and line breaks in templates * Fix issues with Flask-SQLAlchemy 2.0 - alas, sqlalchemy-utils hasn't caught up yet - so we can't test with it. (pallets-eco#744) * Forms method value to lowercase: GET->get, POST->post * Uniformity of indentation and line breaks in templates * Add djlint to requirements/tests * Add base config to djlint * Adjusted templates based on djlint rules --------- Co-authored-by: Chris Wagner <[email protected]>
- Loading branch information
Showing
35 changed files
with
500 additions
and
524 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"ignore": "H017,H025,H030,H031", | ||
"extension": "html", | ||
"indent": "2", | ||
"profile": "jinja", | ||
"format_attribute_template_tags": "true", | ||
"max_line_length": 120, | ||
"max_attribute_length": 240, | ||
"blank_line_after_tag": "from,endmacro", | ||
"blank_line_before_tag": "block,extends" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,58 @@ | ||
{% if security.registerable or security.recoverable or security.confirmable or security.unified_signin or security.two_factor or security.webauthn %} | ||
<hr> | ||
<h2>{{ _fsdomain('Menu') }}</h2> | ||
<ul> | ||
{% if current_user and current_user.is_authenticated %} | ||
{# already authenticated user #} | ||
<li><a href="{{ url_for_security('logout') }}">{{ _fsdomain("Sign out") }}</a></li> | ||
{% if security.changeable %} | ||
<li><a href="{{ url_for_security('change_password') }}">{{ _fsdomain("Change Password") }}</li> | ||
{% endif %} | ||
{% if security.two_factor %} | ||
<li><a href="{{ url_for_security('two_factor_setup') }}">{{ _fsdomain("Two Factor Setup") }}</li> | ||
{% endif %} | ||
{% if security.unified_signin %} | ||
<li><a href="{{ url_for_security('us_setup') }}">{{ _fsdomain("Unified Signin Setup") }}</li> | ||
{% endif %} | ||
{% if security.webauthn %} | ||
<li><a href="{{ url_for_security('wan_register') }}">{{ _fsdomain("WebAuthn Setup") }}</li> | ||
{% endif %} | ||
{% else %} | ||
{% if not skip_login_menu %} | ||
<li><a href="{{ url_for_security('login') }}{% if 'next' in request.args %}?next={{ request.args.next|urlencode }}{% endif %}">{{ _fsdomain('Login') }}</a></li> | ||
{% endif %} | ||
{% if security.unified_signin and not skip_login_menu %} | ||
<li><a href="{{ url_for_security('us_signin') }}{% if 'next' in request.args %}?next={{ request.args.next|urlencode }}{% endif %}">{{ _fsdomain("Unified Sign In") }}</a><br/></li> | ||
{% endif %} | ||
{% if security.registerable %} | ||
<li><a href="{{ url_for_security('register') }}{% if 'next' in request.args %}?next={{ request.args.next|urlencode }}{% endif %}">{{ _fsdomain('Register') }}</a><br/></li> | ||
{% endif %} | ||
{% if security.recoverable %} | ||
<li><a href="{{ url_for_security('forgot_password') }}">{{ _fsdomain('Forgot password') }}</a><br/></li> | ||
{% endif %} | ||
{% if security.confirmable %} | ||
<li><a href="{{ url_for_security('send_confirmation') }}">{{ _fsdomain('Confirm account') }}</a></li> | ||
{% endif %} | ||
{% endif %} | ||
</ul> | ||
<hr> | ||
<h2>{{ _fsdomain('Menu') }}</h2> | ||
<ul> | ||
{% if current_user and current_user.is_authenticated %} | ||
{# already authenticated user #} | ||
<li> | ||
<a href="{{ url_for_security('logout') }}">{{ _fsdomain("Sign out") }}</a> | ||
</li> | ||
{% if security.changeable %} | ||
<li> | ||
<a href="{{ url_for_security('change_password') }}">{{ _fsdomain("Change Password") }} | ||
</li> | ||
{% endif %} | ||
{% if security.two_factor %} | ||
<li> | ||
<a href="{{ url_for_security('two_factor_setup') }}">{{ _fsdomain("Two Factor Setup") }} | ||
</li> | ||
{% endif %} | ||
{% if security.unified_signin %} | ||
<li> | ||
<a href="{{ url_for_security('us_setup') }}">{{ _fsdomain("Unified Signin Setup") }} | ||
</li> | ||
{% endif %} | ||
{% if security.webauthn %} | ||
<li> | ||
<a href="{{ url_for_security('wan_register') }}">{{ _fsdomain("WebAuthn Setup") }} | ||
</li> | ||
{% endif %} | ||
{% else %} | ||
{% if not skip_login_menu %} | ||
<li> | ||
<a href="{{ url_for_security('login') }}{%- if 'next' in request.args -%}?next={{ request.args.next|urlencode }}{%- endif -%}">{{ _fsdomain('Login') }}</a> | ||
</li> | ||
{% endif %} | ||
{% if security.unified_signin and not skip_login_menu %} | ||
<li> | ||
<a href="{{ url_for_security('us_signin') }}{%- if 'next' in request.args -%}?next={{ request.args.next|urlencode }}{%- endif -%}">{{ _fsdomain('Unified Sign In') }}</a> | ||
</li> | ||
{% endif %} | ||
{% if security.registerable %} | ||
<li> | ||
<a href="{{ url_for_security('register') }}{%- if 'next' in request.args -%}?next={{ request.args.next|urlencode }}{%- endif -%}">{{ _fsdomain('Register') }}</a> | ||
</li> | ||
{% endif %} | ||
{% if security.recoverable %} | ||
<li> | ||
<a href="{{ url_for_security('forgot_password') }}">{{ _fsdomain('Forgot password') }}</a> | ||
</li> | ||
{% endif %} | ||
{% if security.confirmable %} | ||
<li> | ||
<a href="{{ url_for_security('send_confirmation') }}">{{ _fsdomain('Confirm account') }}</a> | ||
</li> | ||
{% endif %} | ||
{% endif %} | ||
</ul> | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
{%- with messages = get_flashed_messages(with_categories=true) -%} | ||
{% if messages %} | ||
<ul class="flashes"> | ||
{% for category, message in messages %} | ||
<li class="{{ category }} fs-error-msg">{{ message }}</li> | ||
{% endfor %} | ||
{% for category, message in messages %}<li class="{{ category }} fs-error-msg">{{ message }}</li>{% endfor %} | ||
</ul> | ||
{% endif %} | ||
{%- endwith %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
<p>{{ _fsdomain('Your password has been changed.') }}</p> | ||
{% if security.recoverable %} | ||
<p>{{ _fsdomain('If you did not change your password,') }} <a href="{{ url_for_security('forgot_password', _external=True) }}">{{ _fsdomain('click here to reset it') }}</a>.</p> | ||
<p> | ||
{{ _fsdomain('If you did not change your password,') }} <a href="{{ url_for_security('forgot_password', _external=True) }}">{{ _fsdomain('click here to reset it') }}</a>. | ||
</p> | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
flask_security/templates/security/email/login_instructions.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<p>{{ _fsdomain('Welcome %(email)s!', email=user.email) }}</p> | ||
|
||
<p>{{ _fsdomain('You can log into your account through the link below:') }}</p> | ||
|
||
<p><a href="{{ login_link }}">{{ _fsdomain('Login now') }}</a></p> | ||
<p> | ||
<a href="{{ login_link }}">{{ _fsdomain('Login now') }}</a> | ||
</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
flask_security/templates/security/email/two_factor_instructions.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
<p>{{ _fsdomain("Welcome") }} {{ username }}!</p> | ||
|
||
<p>{{ _fsdomain("You can log into your account using the following code:") }} {{ token }}</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<p> {{ user.email }} {{ _fsdomain("can not access mail account") }}</p> | ||
<p>{{ user.email }} {{ _fsdomain("can not access mail account") }}</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.