diff --git a/pyproject.toml b/pyproject.toml index 2b4b9878..2a9f00b2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,3 +27,24 @@ known_first_party = [ "scripts", "hooks", ] + + +# ==== djLint ==== +[tool.djlint] +blank_line_after_tag = "load,extends" +close_void_tags = true +format_css = true +format_js = true +# TODO: remove T002 when fixed https://github.com/Riverside-Healthcare/djLint/issues/687 +ignore = "H006,H030,H031,T002,T028" +ignore_blocks = "raw" +include = "H017,H035" +indent = 2 +max_line_length = 119 +profile = "jinja" + +[tool.djlint.css] +indent_size = 2 + +[tool.djlint.js] +indent_size = 2 diff --git a/requirements.txt b/requirements.txt index c547458b..d6d0ca75 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,6 +8,7 @@ black==23.3.0 isort==5.12.0 flake8==6.0.0 django-upgrade==1.14.0 +djlint==1.31.1 pre-commit==3.3.3 # Testing diff --git a/tests/test_cookiecutter_generation.py b/tests/test_cookiecutter_generation.py index 778e3411..bb91e329 100755 --- a/tests/test_cookiecutter_generation.py +++ b/tests/test_cookiecutter_generation.py @@ -239,6 +239,32 @@ def test_django_upgrade_passes(cookies, context_override): pytest.fail(e.stdout.decode()) +@pytest.mark.parametrize("context_override", SUPPORTED_COMBINATIONS, ids=_fixture_id) +def test_djlint_lint_passes(cookies, context_override): + """Check whether generated project passes djLint --lint.""" + result = cookies.bake(extra_context=context_override) + + autofixable_rules = "H014,T001" + # TODO: remove T002 when fixed https://github.com/Riverside-Healthcare/djLint/issues/687 + ignored_rules = "H006,H030,H031,T002" + try: + sh.djlint("--lint", "--ignore", f"{autofixable_rules},{ignored_rules}", ".", _cwd=str(result.project_path)) + except sh.ErrorReturnCode as e: + pytest.fail(e.stdout.decode()) + + +@auto_fixable +@pytest.mark.parametrize("context_override", SUPPORTED_COMBINATIONS, ids=_fixture_id) +def test_djlint_check_passes(cookies, context_override): + """Check whether generated project passes djLint --check.""" + result = cookies.bake(extra_context=context_override) + + try: + sh.djlint("--check", ".", _cwd=str(result.project_path)) + except sh.ErrorReturnCode as e: + pytest.fail(e.stdout.decode()) + + @pytest.mark.parametrize( ["use_docker", "expected_test_script"], [ diff --git a/{{cookiecutter.project_slug}}/.pre-commit-config.yaml b/{{cookiecutter.project_slug}}/.pre-commit-config.yaml index f16a87fd..f400001f 100644 --- a/{{cookiecutter.project_slug}}/.pre-commit-config.yaml +++ b/{{cookiecutter.project_slug}}/.pre-commit-config.yaml @@ -51,6 +51,12 @@ repos: hooks: - id: flake8 + - repo: https://github.com/Riverside-Healthcare/djLint + rev: v1.31.1 + hooks: + - id: djlint-reformat-django + - id: djlint-django + # sets up .pre-commit-ci.yaml to ensure pre-commit dependencies stay up to date ci: autoupdate_schedule: weekly diff --git a/{{cookiecutter.project_slug}}/pyproject.toml b/{{cookiecutter.project_slug}}/pyproject.toml index 6acac9b2..7e4c9aa9 100644 --- a/{{cookiecutter.project_slug}}/pyproject.toml +++ b/{{cookiecutter.project_slug}}/pyproject.toml @@ -90,3 +90,23 @@ generated-members = [ "save", "delete", ] + + +# ==== djLint ==== +[tool.djlint] +blank_line_after_tag = "load,extends" +close_void_tags = true +format_css = true +format_js = true +# TODO: remove T002 when fixed https://github.com/Riverside-Healthcare/djLint/issues/687 +ignore = "H006,H030,H031,T002" +include = "H017,H035" +indent = 2 +max_line_length = 119 +profile = "django" + +[tool.djlint.css] +indent_size = 2 + +[tool.djlint.js] +indent_size = 2 diff --git a/{{cookiecutter.project_slug}}/requirements/local.txt b/{{cookiecutter.project_slug}}/requirements/local.txt index 543b86b7..bf4e8a49 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -32,6 +32,7 @@ flake8==6.0.0 # https://github.com/PyCQA/flake8 flake8-isort==6.0.0 # https://github.com/gforcada/flake8-isort coverage==7.2.7 # https://github.com/nedbat/coveragepy black==23.3.0 # https://github.com/psf/black +djlint==1.31.1 # https://github.com/Riverside-Healthcare/djLint pylint-django==2.5.3 # https://github.com/PyCQA/pylint-django {%- if cookiecutter.use_celery == 'y' %} pylint-celery==0.3 # https://github.com/PyCQA/pylint-celery diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/403.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/403.html index 4c4745f7..d90b33f9 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/403.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/403.html @@ -1,10 +1,14 @@ {% raw %}{% extends "base.html" %} -{% block title %}Forbidden (403){% endblock %} - +{% block title %}Forbidden (403){% endblock title %} {% block content %} -

Forbidden (403)

- -

{% if exception %}{{ exception }}{% else %}You're not allowed to access this page.{% endif %}

+

Forbidden (403)

+

+ {% if exception %} + {{ exception }} + {% else %} + You're not allowed to access this page. + {% endif %} +

{% endblock content %} {%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/404.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/404.html index d9824185..62159641 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/404.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/404.html @@ -1,10 +1,14 @@ {% raw %}{% extends "base.html" %} -{% block title %}Page not found{% endblock %} - +{% block title %}Page not found{% endblock title %} {% block content %} -

Page not found

- -

{% if exception %}{{ exception }}{% else %}This is not the page you were looking for.{% endif %}

+

Page not found

+

+ {% if exception %} + {{ exception }} + {% else %} + This is not the page you were looking for. + {% endif %} +

{% endblock content %} {%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/500.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/500.html index 481bb2d0..89032016 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/500.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/500.html @@ -1,12 +1,11 @@ {% raw %}{% extends "base.html" %} -{% block title %}Server Error{% endblock %} - +{% block title %}Server Error{% endblock title %} {% block content %} -

Ooops!!! 500

- -

Looks like something went wrong!

- -

We track these errors automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.

+

Ooops!!! 500

+

Looks like something went wrong!

+

+ We track these errors automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing. +

{% endblock content %} {%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/account_inactive.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/account_inactive.html index ab910820..a9112cf0 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/account_inactive.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/account_inactive.html @@ -2,11 +2,11 @@ {% load i18n %} -{% block head_title %}{% translate "Account Inactive" %}{% endblock %} - +{% block head_title %} + {% translate "Account Inactive" %} +{% endblock head_title %} {% block inner %} -

{% translate "Account Inactive" %}

- -

{% translate "This account is inactive." %}

-{% endblock %} +

{% translate "Account Inactive" %}

+

{% translate "This account is inactive." %}

+{% endblock inner %} {%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/base.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/base.html index 03c86724..05761825 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/base.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/base.html @@ -1,11 +1,14 @@ {% raw %}{% extends "base.html" %} -{% block title %}{% block head_title %}{% endblock head_title %}{% endblock title %} +{% block title %} + {% block head_title %} + {% endblock head_title %} +{% endblock title %} {% block content %} -
-
- {% block inner %}{% endblock %} +
+
+ {% block inner %}{% endblock inner %} +
-
-{% endblock %} +{% endblock content %} {%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/email.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/email.html index 1faa2b9f..37770f00 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/email.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/email.html @@ -4,76 +4,77 @@ {% load i18n %} {% load crispy_forms_tags %} -{% block head_title %}{% translate "Account" %}{% endblock %} - +{% block head_title %} + {% translate "Account" %} +{% endblock head_title %} {% block inner %} -

{% translate "E-mail Addresses" %}

- -{% if user.emailaddress_set.all %} -

{% translate 'The following e-mail addresses are associated with your account:' %}

- -
-{% csrf_token %} -
- - {% for emailaddress in user.emailaddress_set.all %} -
- -
- {% endfor %} - -
- - - -
- -
-
- -{% else %} -

{% translate 'Warning:'%} {% translate "You currently do not have any e-mail address set up. You should really add an e-mail address so you can receive notifications, reset your password, etc." %}

- -{% endif %} - - -

{% translate "Add E-mail Address" %}

- -
- {% csrf_token %} - {{ form|crispy }} - +

{% translate "E-mail Addresses" %}

+ {% if user.emailaddress_set.all %} +

{% translate "The following e-mail addresses are associated with your account:" %}

+ + {% csrf_token %} +
+ {% for emailaddress in user.emailaddress_set.all %} +
+ +
+ {% endfor %} +
+ + + +
+
- -{% endblock %} - - + {% else %} +

+ {% translate "Warning:" %} {% translate "You currently do not have any e-mail address set up. You should really add an e-mail address so you can receive notifications, reset your password, etc." %} +

+ {% endif %} +

{% translate "Add E-mail Address" %}

+
+ {% csrf_token %} + {{ form|crispy }} + +
+{% endblock inner %} {% block inline_javascript %} -{{ block.super }} - -{% endblock %} + +{% endblock inline_javascript %} {%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/email_confirm.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/email_confirm.html index 5e4924c8..40ca4a47 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/email_confirm.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/email_confirm.html @@ -3,30 +3,26 @@ {% load i18n %} {% load account %} -{% block head_title %}{% translate "Confirm E-mail Address" %}{% endblock %} - - +{% block head_title %} + {% translate "Confirm E-mail Address" %} +{% endblock head_title %} {% block inner %} -

{% translate "Confirm E-mail Address" %}

- -{% if confirmation %} - -{% user_display confirmation.email_address.user as user_display %} - -

{% blocktranslate with confirmation.email_address.email as email %}Please confirm that {{ email }} is an e-mail address for user {{ user_display }}.{% endblocktranslate %}

- -
-{% csrf_token %} - -
- -{% else %} - -{% url 'account_email' as email_url %} - -

{% blocktranslate %}This e-mail confirmation link expired or is invalid. Please issue a new e-mail confirmation request.{% endblocktranslate %}

- -{% endif %} - -{% endblock %} +

{% translate "Confirm E-mail Address" %}

+ {% if confirmation %} + {% user_display confirmation.email_address.user as user_display %} +

+ {% blocktranslate with confirmation.email_address.email as email %}Please confirm that {{ email }} is an e-mail address for user {{ user_display }}.{% endblocktranslate %} +

+
+ {% csrf_token %} + +
+ {% else %} + {% url 'account_email' as email_url %} +

+ {% blocktranslate %}This e-mail confirmation link expired or is invalid. Please issue a new e-mail confirmation request.{% endblocktranslate %} +

+ {% endif %} +{% endblock inner %} {%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/login.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/login.html index 25a292ed..5737afc0 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/login.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/login.html @@ -4,57 +4,50 @@ {% load account socialaccount %} {% load crispy_forms_tags %} -{% block head_title %}{% translate "Sign In" %}{% endblock %} - +{% block head_title %} + {% translate "Sign In" %} +{% endblock head_title %} {% block inner %} - -

{% translate "Sign In" %}

- -{% get_providers as socialaccount_providers %} - -{% if socialaccount_providers %} -

- {% translate "Please sign in with one of your existing third party accounts:" %} - {% if ACCOUNT_ALLOW_REGISTRATION %} - {% blocktranslate trimmed %} - Or, sign up - for a {{ site_name }} account and sign in below: - {% endblocktranslate %} - {% endif %} -

- -
- - - - - -
- - {% include "socialaccount/snippets/login_extra.html" %} - -{% else %} - {% if ACCOUNT_ALLOW_REGISTRATION %} +

{% translate "Sign In" %}

+ {% get_providers as socialaccount_providers %} + {% if socialaccount_providers %}

- {% blocktranslate trimmed %} - If you have not created an account yet, then please - sign up first. - {% endblocktranslate %} + {% translate "Please sign in with one of your existing third party accounts:" %} + {% if ACCOUNT_ALLOW_REGISTRATION %} + {% blocktranslate trimmed %} + Or, sign up + for a {{ site_name }} account and sign in below: + {% endblocktranslate %} + {% endif %}

+
+ + +
+ {% include "socialaccount/snippets/login_extra.html" %} + {% else %} + {% if ACCOUNT_ALLOW_REGISTRATION %} +

+ {% blocktranslate trimmed %} + If you have not created an account yet, then please + sign up first. + {% endblocktranslate %} +

+ {% endif %} {% endif %} -{% endif %} - -
- {% csrf_token %} - {{ form|crispy }} - {% if redirect_field_value %} - - {% endif %} - {% translate "Forgot Password?" %} - -
- -{% endblock %} +
+ {% csrf_token %} + {{ form|crispy }} + {% if redirect_field_value %} + + {% endif %} + {% translate "Forgot Password?" %} + +
+{% endblock inner %} {%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/logout.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/logout.html index 5edc6047..43ae9ed3 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/logout.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/logout.html @@ -2,19 +2,20 @@ {% load i18n %} -{% block head_title %}{% translate "Sign Out" %}{% endblock %} - +{% block head_title %} + {% translate "Sign Out" %} +{% endblock head_title %} {% block inner %} -

{% translate "Sign Out" %}

- -

{% translate 'Are you sure you want to sign out?' %}

- -
- {% csrf_token %} - {% if redirect_field_value %} - - {% endif %} - -
-{% endblock %} +

{% translate "Sign Out" %}

+

{% translate "Are you sure you want to sign out?" %}

+
+ {% csrf_token %} + {% if redirect_field_value %} + + {% endif %} + +
+{% endblock inner %} {%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_change.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_change.html index b8dd7ac5..2e6110d5 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_change.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_change.html @@ -3,15 +3,17 @@ {% load i18n %} {% load crispy_forms_tags %} -{% block head_title %}{% translate "Change Password" %}{% endblock %} - +{% block head_title %} + {% translate "Change Password" %} +{% endblock head_title %} {% block inner %} -

{% translate "Change Password" %}

- -
- {% csrf_token %} - {{ form|crispy }} - -
-{% endblock %} +

{% translate "Change Password" %}

+
+ {% csrf_token %} + {{ form|crispy }} + +
+{% endblock inner %} {%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset.html index f424b211..0c184269 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset.html @@ -4,23 +4,26 @@ {% load account %} {% load crispy_forms_tags %} -{% block head_title %}{% translate "Password Reset" %}{% endblock %} - +{% block head_title %} + {% translate "Password Reset" %} +{% endblock head_title %} {% block inner %} - -

{% translate "Password Reset" %}

- {% if user.is_authenticated %} +

{% translate "Password Reset" %}

+ {% if user.is_authenticated %} {% include "account/snippets/already_logged_in.html" %} - {% endif %} - -

{% translate "Forgotten your password? Enter your e-mail address below, and we'll send you an e-mail allowing you to reset it." %}

- -
- {% csrf_token %} - {{ form|crispy }} - -
- -

{% blocktranslate %}Please contact us if you have any trouble resetting your password.{% endblocktranslate %}

-{% endblock %} + {% endif %} +

+ {% translate "Forgotten your password? Enter your e-mail address below, and we'll send you an e-mail allowing you to reset it." %} +

+
+ {% csrf_token %} + {{ form|crispy }} + +
+

{% blocktranslate %}Please contact us if you have any trouble resetting your password.{% endblocktranslate %}

+{% endblock inner %} {%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset_done.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset_done.html index 76d07eb2..a596425b 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset_done.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset_done.html @@ -3,15 +3,16 @@ {% load i18n %} {% load account %} -{% block head_title %}{% translate "Password Reset" %}{% endblock %} - +{% block head_title %} + {% translate "Password Reset" %} +{% endblock head_title %} {% block inner %} -

{% translate "Password Reset" %}

- - {% if user.is_authenticated %} +

{% translate "Password Reset" %}

+ {% if user.is_authenticated %} {% include "account/snippets/already_logged_in.html" %} - {% endif %} - -

{% blocktranslate %}We have sent you an e-mail. Please contact us if you do not receive it within a few minutes.{% endblocktranslate %}

-{% endblock %} + {% endif %} +

+ {% blocktranslate %}We have sent you an e-mail. Please contact us if you do not receive it within a few minutes.{% endblocktranslate %} +

+{% endblock inner %} {%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset_from_key.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset_from_key.html index ce5d72a6..a958ba08 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset_from_key.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset_from_key.html @@ -2,24 +2,36 @@ {% load i18n %} {% load crispy_forms_tags %} -{% block head_title %}{% translate "Change Password" %}{% endblock %} +{% block head_title %} + {% translate "Change Password" %} +{% endblock head_title %} {% block inner %} -

{% if token_fail %}{% translate "Bad Token" %}{% else %}{% translate "Change Password" %}{% endif %}

- +

{% if token_fail %} - {% url 'account_reset_password' as passwd_reset_url %} -

{% blocktranslate %}The password reset link was invalid, possibly because it has already been used. Please request a new password reset.{% endblocktranslate %}

+ {% translate "Bad Token" %} {% else %} - {% if form %} -
- {% csrf_token %} - {{ form|crispy }} - -
- {% else %} -

{% translate 'Your password is now changed.' %}

- {% endif %} + {% translate "Change Password" %} {% endif %} -{% endblock %} +

+ {% if token_fail %} + {% url 'account_reset_password' as passwd_reset_url %} +

+ {% blocktranslate %}The password reset link was invalid, possibly because it has already been used. Please request a new password reset.{% endblocktranslate %} +

+ {% else %} + {% if form %} +
+ {% csrf_token %} + {{ form|crispy }} + +
+ {% else %} +

{% translate "Your password is now changed." %}

+ {% endif %} + {% endif %} +{% endblock inner %} {%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset_from_key_done.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset_from_key_done.html index 34123fd5..ee399b40 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset_from_key_done.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset_from_key_done.html @@ -1,10 +1,12 @@ {% raw %}{% extends "account/base.html" %} {% load i18n %} -{% block head_title %}{% translate "Change Password" %}{% endblock %} +{% block head_title %} + {% translate "Change Password" %} +{% endblock head_title %} {% block inner %} -

{% translate "Change Password" %}

-

{% translate 'Your password is now changed.' %}

-{% endblock %} +

{% translate "Change Password" %}

+

{% translate "Your password is now changed." %}

+{% endblock inner %} {%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_set.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_set.html index 812410fc..3efc3087 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_set.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_set.html @@ -3,15 +3,20 @@ {% load i18n %} {% load crispy_forms_tags %} -{% block head_title %}{% translate "Set Password" %}{% endblock %} - +{% block head_title %} + {% translate "Set Password" %} +{% endblock head_title %} {% block inner %} -

{% translate "Set Password" %}

- -
- {% csrf_token %} - {{ form|crispy }} - -
-{% endblock %} +

{% translate "Set Password" %}

+
+ {% csrf_token %} + {{ form|crispy }} + +
+{% endblock inner %} {%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/signup.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/signup.html index 8c1c11ac..54150a47 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/signup.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/signup.html @@ -3,21 +3,26 @@ {% load i18n %} {% load crispy_forms_tags %} -{% block head_title %}{% translate "Signup" %}{% endblock %} - +{% block head_title %} + {% translate "Signup" %} +{% endblock head_title %} {% block inner %} -

{% translate "Sign Up" %}

- -

{% blocktranslate %}Already have an account? Then please sign in.{% endblocktranslate %}

- -
- {% csrf_token %} - {{ form|crispy }} - {% if redirect_field_value %} - - {% endif %} - -
- -{% endblock %} +

{% translate "Sign Up" %}

+

+ {% blocktranslate %}Already have an account? Then please sign in.{% endblocktranslate %} +

+
+ {% csrf_token %} + {{ form|crispy }} + {% if redirect_field_value %} + + {% endif %} + +
+{% endblock inner %} {%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/signup_closed.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/signup_closed.html index c2e64d14..b3472ed6 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/signup_closed.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/signup_closed.html @@ -2,11 +2,11 @@ {% load i18n %} -{% block head_title %}{% translate "Sign Up Closed" %}{% endblock %} - +{% block head_title %} + {% translate "Sign Up Closed" %} +{% endblock head_title %} {% block inner %} -

{% translate "Sign Up Closed" %}

- -

{% translate "We are sorry, but the sign up is currently closed." %}

-{% endblock %} +

{% translate "Sign Up Closed" %}

+

{% translate "We are sorry, but the sign up is currently closed." %}

+{% endblock inner %} {%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/verification_sent.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/verification_sent.html index be8f1cef..d71bbc41 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/verification_sent.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/verification_sent.html @@ -2,12 +2,13 @@ {% load i18n %} -{% block head_title %}{% translate "Verify Your E-mail Address" %}{% endblock %} - +{% block head_title %} + {% translate "Verify Your E-mail Address" %} +{% endblock head_title %} {% block inner %} -

{% translate "Verify Your E-mail Address" %}

- -

{% blocktranslate %}We have sent an e-mail to you for verification. Follow the link provided to finalize the signup process. Please contact us if you do not receive it within a few minutes.{% endblocktranslate %}

- -{% endblock %} +

{% translate "Verify Your E-mail Address" %}

+

+ {% blocktranslate %}We have sent an e-mail to you for verification. Follow the link provided to finalize the signup process. Please contact us if you do not receive it within a few minutes.{% endblocktranslate %} +

+{% endblock inner %} {%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/verified_email_required.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/verified_email_required.html index 2148a180..b736581c 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/verified_email_required.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/verified_email_required.html @@ -2,21 +2,24 @@ {% load i18n %} -{% block head_title %}{% translate "Verify Your E-mail Address" %}{% endblock %} - +{% block head_title %} + {% translate "Verify Your E-mail Address" %} +{% endblock head_title %} {% block inner %} -

{% translate "Verify Your E-mail Address" %}

- -{% url 'account_email' as email_url %} - -

{% blocktranslate %}This part of the site requires us to verify that +

{% translate "Verify Your E-mail Address" %}

+ {% url 'account_email' as email_url %} +

+ {% blocktranslate %}This part of the site requires us to verify that you are who you claim to be. For this purpose, we require that you -verify ownership of your e-mail address. {% endblocktranslate %}

- -

{% blocktranslate %}We have sent an e-mail to you for +verify ownership of your e-mail address. {% endblocktranslate %} +

+

+ {% blocktranslate %}We have sent an e-mail to you for verification. Please click on the link inside this e-mail. Please -contact us if you do not receive it within a few minutes.{% endblocktranslate %}

- -

{% blocktranslate %}Note: you can still change your e-mail address.{% endblocktranslate %}

-{% endblock %} +contact us if you do not receive it within a few minutes.{% endblocktranslate %} +

+

+ {% blocktranslate %}Note: you can still change your e-mail address.{% endblocktranslate %} +

+{% endblock inner %} {%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/base.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/base.html index 44f0d5c5..421973e5 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/base.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/base.html @@ -1,150 +1,194 @@ -{% raw %}{% load static i18n {% endraw %} -{%- if cookiecutter.frontend_pipeline == 'Django Compressor' %}compress -{%- endif %}{% raw %}%}{% endraw %} -{%- if cookiecutter.frontend_pipeline == 'Webpack' %}{% raw %}{% load render_bundle from webpack_loader %}{% endraw %} +{% raw %} +{% load static i18n {% endraw %} + +{%- if cookiecutter.frontend_pipeline == 'Django Compressor' %}compress{%- endif %}{% raw %}%}{% endraw %} + {%- if cookiecutter.frontend_pipeline == 'Webpack' %}{% raw %} + {% load render_bundle from webpack_loader %} + + {% endraw %} {%- endif %}{% raw %} {% get_current_language as LANGUAGE_CODE %} - - - {% block title %}{% endraw %}{{ cookiecutter.project_name }}{% raw %}{% endblock title %} - - - - - - - {% block css %} - {%- endraw %} - {%- if cookiecutter.frontend_pipeline in ['None', 'Django Compressor'] %} + + + + {% block title %} + {% endraw %}{{ cookiecutter.project_name }}{% raw %} + {% endblock title %} + + + + + + {% block css %} + {%- endraw %} + {%- if cookiecutter.frontend_pipeline in ['None', 'Django Compressor'] %} {%- raw %} - - {%- endraw %} - {%- endif %} - {%- raw %} - - - - {%- endraw %}{% if cookiecutter.frontend_pipeline == 'None' %}{% raw %} - - {%- endraw %}{% elif cookiecutter.frontend_pipeline == 'Django Compressor' %}{% raw %} - {% compress css %} - - {% endcompress %} - {%- endraw %}{% elif cookiecutter.frontend_pipeline == 'Gulp' %}{% raw %} - - {%- endraw %}{% elif cookiecutter.frontend_pipeline == "Webpack" %}{% raw %} - {% render_bundle 'project' 'css' %} - {%- endraw %}{% endif %}{% raw %} - {% endblock %} - + +{%- endraw %} +{% if cookiecutter.frontend_pipeline == 'None' %} + {% raw %} + +{%- endraw %} +{% elif cookiecutter.frontend_pipeline == 'Django Compressor' %} +{% raw %} +{% compress css %} + +{% endcompress %} +{%- endraw %} +{% elif cookiecutter.frontend_pipeline == 'Gulp' %} +{% raw %} + +{%- endraw %} +{% elif cookiecutter.frontend_pipeline == "Webpack" %} +{% raw %} +{% render_bundle 'project' 'css' %} +{%- endraw %} +{% endif %} +{% raw %} +{% endblock css %} + - {# Placed at the top of the document so pages load faster with defer #} - {% block javascript %} - {%- endraw %}{% if cookiecutter.frontend_pipeline == 'Gulp' %}{% raw %} - - - {%- endraw %}{% elif cookiecutter.frontend_pipeline == "Webpack" %}{% raw %} - - {% render_bundle 'vendors' 'js' attrs='defer' %} - {%- endraw %}{% else %}{% raw %} - - - - {%- endraw %}{% endif %}{% raw %} - - - {%- endraw %}{% if cookiecutter.frontend_pipeline == 'None' %}{% raw %} - - {%- endraw %}{% elif cookiecutter.frontend_pipeline == 'Django Compressor' %}{% raw %} - {% compress js %} - - {% endcompress %} - {%- endraw %}{% elif cookiecutter.frontend_pipeline == 'Gulp' %}{% raw %} - - {%- endraw %}{% elif cookiecutter.frontend_pipeline == "Webpack" %}{% raw %} - {% render_bundle 'project' 'js' attrs='defer' %} - {%- endraw %}{% endif %}{% raw %} - - {% endblock javascript %} - - - - - -
- - -
- -
- - {% if messages %} - {% for message in messages %} -
- {{ message }} - -
- {% endfor %} - {% endif %} - - {% block content %} -

Use this document as a way to quick start any new project.

- {% endblock content %} - -
- - {% block modal %}{% endblock modal %} - - {% block inline_javascript %} +
+ + +
+ {% if messages %} + {% for message in messages %} +
+ {{ message }} + +
+ {% endfor %} + {% endif %} + {% block content %} +

Use this document as a way to quick start any new project.

+ {% endblock content %} +
+ + {% block modal %} + {% endblock modal %} + {% block inline_javascript %} {% comment %} Script tags with only code, no src (defer by default). To run with a "defer" so that you run inline code: {% endcomment %} - {% endblock inline_javascript %} - + {% endblock inline_javascript %} + {%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/pages/about.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/pages/about.html index 8968a3d4..3d301eea 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/pages/about.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/pages/about.html @@ -1 +1,3 @@ -{% raw %}{% extends "base.html" %}{% endraw %} +{% raw %}{% extends "base.html" %} + +{% endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/pages/home.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/pages/home.html index 8968a3d4..3d301eea 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/pages/home.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/pages/home.html @@ -1 +1,3 @@ -{% raw %}{% extends "base.html" %}{% endraw %} +{% raw %}{% extends "base.html" %} + +{% endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/users/user_detail.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/users/user_detail.html index ee2c4aee..4e632b01 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/users/user_detail.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/users/user_detail.html @@ -1,35 +1,45 @@ {% raw %}{% extends "base.html" %} + {% load static %} -{% block title %}User: {% endraw %}{% if cookiecutter.username_type == "email" %}{% raw %}{{ object.name }}{% endraw %}{% else %}{% raw %}{{ object.username }}{% endraw %}{% endif %}{% raw %}{% endblock %} - +{% block title %} + User: {% endraw %} + {% if cookiecutter.username_type == "email" %} + {% raw %}{{ object.name }}{% endraw %} + {% else %} + {% raw %}{{ object.username }}{% endraw %} + {% endif %} + {% raw %} +{% endblock title %} {% block content %} -
- -
-
- -

{% endraw %}{% if cookiecutter.username_type == "email" %}{% raw %}{{ object.name }}{% endraw %}{% else %}{% raw %}{{ object.username }}{% endraw %}{% endif %}{% raw %}

- {% if object.name %} -

{{ object.name }}

- {% endif %} +
+
+
+

+ {% endraw %} + {% if cookiecutter.username_type == "email" %} + {% raw %}{{ object.name }}{% endraw %} + {% else %} + {% raw %}{{ object.username }}{% endraw %} + {% endif %} + {% raw %} +

+ {% if object.name %}

{{ object.name }}

{% endif %}
- -{% if object == request.user %} - -
- -
- My Info - E-Mail - -
- -
- -{% endif %} - + {% if object == request.user %} + +
+
+ My Info + E-Mail + +
+
+ + {% endif %}
{% endblock content %} {%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/users/user_form.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/users/user_form.html index 65401624..bd1299a6 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/users/user_form.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/users/user_form.html @@ -1,18 +1,36 @@ {% raw %}{% extends "base.html" %} + {% load crispy_forms_tags %} -{% block title %}{% endraw %}{% if cookiecutter.username_type == "email" %}{% raw %}{{ user.name }}{% endraw %}{% else %}{% raw %}{{ user.username }}{% endraw %}{% endif %}{% raw %}{% endblock %} - +{% block title %} +{% endraw %} +{% if cookiecutter.username_type == "email" %} + {% raw %}{{ user.name }}{% endraw %} +{% else %} + {% raw %}{{ user.username }}{% endraw %} +{% endif %} +{% raw %} +{% endblock title %} {% block content %} -

{% endraw %}{% if cookiecutter.username_type == "email" %}{% raw %}{{ user.name }}{% endraw %}{% else %}{% raw %}{{ user.username }}{% endraw %}{% endif %}{% raw %}

-
- {% csrf_token %} - {{ form|crispy }} -
-
- -
+

+ {% endraw %} + {% if cookiecutter.username_type == "email" %} + {% raw %}{{ user.name }}{% endraw %} + {% else %} + {% raw %}{{ user.username }}{% endraw %} + {% endif %} + {% raw %} +

+ + {% csrf_token %} + {{ form|crispy }} +
+
+
- -{% endblock %} +
+ +{% endblock content %} {%- endraw %}