+ {% trans "Forgotten your password? Enter your e-mail address below, and we'll send you an e-mail allowing you to reset it." %}
+
+
+ {% blocktrans %}Please contact us if you have any trouble resetting your password.{% endblocktrans %}
+
+{% endblock content %}
diff --git a/sampleapp/templates/account/password_reset_done.jinja b/sampleapp/templates/account/password_reset_done.jinja
new file mode 100644
index 0000000..955d66e
--- /dev/null
+++ b/sampleapp/templates/account/password_reset_done.jinja
@@ -0,0 +1,13 @@
+{% extends "base.jinja" %}
+{% block head_title %}
+ {% trans "Password Reset" %}
+{% endblock head_title %}
+{% block content %}
+
+ {% blocktrans %}We have sent you an e-mail. If you have not received it please check your spam folder. Otherwise contact us if you do not receive it in a few minutes.{% endblocktrans %}
+
+{% endblock content %}
diff --git a/sampleapp/templates/account/password_reset_from_key.jinja b/sampleapp/templates/account/password_reset_from_key.jinja
new file mode 100644
index 0000000..c69110d
--- /dev/null
+++ b/sampleapp/templates/account/password_reset_from_key.jinja
@@ -0,0 +1,25 @@
+{% extends "base.jinja" %}
+{% block head_title %}
+ {% trans "Change Password" %}
+{% endblock head_title %}
+{% block content %}
+
+ {% blocktrans %}The password reset link was invalid, possibly because it has already been used. Please request a new password reset .{% endblocktrans %}
+
+ {% else %}
+
+ {{ errors }}
+ {% for field, errors in fields %}
+ {% if field.name == 'first_name' or field.name == 'last_name' %}
+ {% include "django/forms/inputgroup.jinja" with field=field errors=errors layout_classes="w-5/12" %}
+ {% else %}
+ {% include "django/forms/inputgroup.jinja" with field=field errors=errors %}
+ {% endif %}
+ {% endfor %}
+ {% for field in hidden_fields %}{{ field }}{% endfor %}
+
diff --git a/sampleapp/templates/account/welcome.jinja b/sampleapp/templates/account/welcome.jinja
new file mode 100644
index 0000000..c443efa
--- /dev/null
+++ b/sampleapp/templates/account/welcome.jinja
@@ -0,0 +1,9 @@
+{% extends "base.jinja" %}
+{% block head_title %}
+ {% trans %}
+ Sign In
+{% endtrans %}
+{% endblock head_title %}
+{% block content %}
+
Date: Tue, 17 May 2022 11:01:53 -0700
Subject: [PATCH 18/50] work on consistent styling
---
sampleapp/templates/account/logout.jinja | 14 ++++++++------
sampleapp/templates/account/password_reset.jinja | 3 ++-
sampleapp/templates/components/button.jinja | 4 ++--
3 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/sampleapp/templates/account/logout.jinja b/sampleapp/templates/account/logout.jinja
index 3b9ce1f..1625326 100644
--- a/sampleapp/templates/account/logout.jinja
+++ b/sampleapp/templates/account/logout.jinja
@@ -1,3 +1,6 @@
+{% from 'account/components/account_box.jinja' import account_box %}
+{% from 'django/forms/inputgroup.jinja' import inputgroup %}
+{% from 'components/button.jinja' import button %}
{% extends "base.jinja" %}
{% block head_title %}
{% trans %}
@@ -5,8 +8,9 @@
{% endtrans %}
{% endblock head_title %}
{% block content %}
+ {% set title="Sign Out" %}
+ {% set content %}
{% trans %}
- Sign Out
Are you sure you want to sign out?
@@ -18,10 +22,8 @@
name="{{ redirect_field_name }}"
value="{{ redirect_field_value }}"/>
{% endif %}
-
- {% trans %}
- Sign Out
- {% endtrans %}
-
+ {{ button("Sign Out", 'submit') }}
+{% endset %}
+{{ account_box(title, content, back='') }}
{% endblock content %}
diff --git a/sampleapp/templates/account/password_reset.jinja b/sampleapp/templates/account/password_reset.jinja
index aaf59f5..77b7d2b 100644
--- a/sampleapp/templates/account/password_reset.jinja
+++ b/sampleapp/templates/account/password_reset.jinja
@@ -1,5 +1,6 @@
{% from 'django/forms/inputgroup.jinja' import inputgroup %}
{% from 'account/components/account_box.jinja' import account_box %}
+{% from 'components/button.jinja' import button %}
{% extends "base.jinja" %}
{% block head_title %}
{% trans %}
@@ -22,7 +23,7 @@
class="password_reset">
{% csrf_token %}
{{ inputgroup(form) }}
-
+ {{ button("Reset My Password", 'submit') }}
{% trans %}
diff --git a/sampleapp/templates/components/button.jinja b/sampleapp/templates/components/button.jinja
index aae2389..943c610 100644
--- a/sampleapp/templates/components/button.jinja
+++ b/sampleapp/templates/components/button.jinja
@@ -1,5 +1,5 @@
-{% macro button(button_content='Button') %}
-
{{ button_content }}
From 4e350b03c3775e335140d38e9ed3abd329efe6d8 Mon Sep 17 00:00:00 2001
From: Aidan Gerber
Date: Tue, 17 May 2022 11:08:31 -0700
Subject: [PATCH 19/50] reformat jinja files
---
.pre-commit-config.yaml | 2 +-
sampleapp/templates/account/login_form.jinja | 5 +-
.../templates/account/password_reset.jinja | 46 +++++++++----------
.../account/password_reset_from_key.jinja | 1 -
sampleapp/templates/components/menu.jinja | 12 ++---
.../templates/django/forms/inputgroup.jinja | 2 +-
sampleapp/templates/django/forms/label.jinja | 16 +++----
sampleapp/templates/footer.jinja | 1 -
sampleapp/templates/header/mobile_menu.jinja | 2 +-
sampleapp/templates/index.jinja | 14 ++----
sampleapp/templates/random_chart.jinja | 5 +-
sampleapp/templates/svg/svg.jinja | 3 +-
12 files changed, 49 insertions(+), 60 deletions(-)
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index d29d377..d19c859 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -42,7 +42,7 @@ repos:
name: djlint
entry: poetry run djlint --reformat
language: system
- types_or: [html]
+ types_or: [html,jinja]
## system
- repo: https://github.com/asottile/pyupgrade
diff --git a/sampleapp/templates/account/login_form.jinja b/sampleapp/templates/account/login_form.jinja
index 031669c..361f3cf 100644
--- a/sampleapp/templates/account/login_form.jinja
+++ b/sampleapp/templates/account/login_form.jinja
@@ -1,6 +1,5 @@
{% from 'django/forms/inputgroup.jinja' import inputgroup %}
{% from 'django/forms/checkbox.jinja' import checkbox %}
-
diff --git a/sampleapp/templates/account/password_reset.jinja b/sampleapp/templates/account/password_reset.jinja
index 77b7d2b..dd4ce17 100644
--- a/sampleapp/templates/account/password_reset.jinja
+++ b/sampleapp/templates/account/password_reset.jinja
@@ -4,32 +4,32 @@
{% extends "base.jinja" %}
{% block head_title %}
{% trans %}
- Reset Password
- {% endtrans %}
+ Reset Password
+{% endtrans %}
{% endblock head_title %}
{% block content %}
{% set title="Reset Password" %}
{% set content %}
- {% if request.user.is_authenticated %}
- {% include "account/snippets/already_logged_in.jinja" %}
- {% endif %}
-
- {% trans %}
- Forgotten your password? Enter your e-mail address below, and we'll send you an e-mail allowing you to reset it.
- {% endtrans %}
-
-
-
- {% trans %}
- Please contact us if you have any trouble resetting your password.
- {% endtrans %}
-
- {% endset %}
+ {% if request.user.is_authenticated %}
+ {% include "account/snippets/already_logged_in.jinja" %}
+ {% endif %}
+
+ {% trans %}
+ Forgotten your password? Enter your e-mail address below, and we'll send you an e-mail allowing you to reset it.
+ {% endtrans %}
+
+
+
+ {% trans %}
+ Please contact us if you have any trouble resetting your password.
+{% endtrans %}
+
+{% endset %}
{{ account_box(title, content, back='') }}
{% endblock content %}
diff --git a/sampleapp/templates/account/password_reset_from_key.jinja b/sampleapp/templates/account/password_reset_from_key.jinja
index 4f43ed8..c2f0e16 100644
--- a/sampleapp/templates/account/password_reset_from_key.jinja
+++ b/sampleapp/templates/account/password_reset_from_key.jinja
@@ -1,5 +1,4 @@
{% from 'django/forms/inputgroup.jinja' import inputgroup %}
-
{% extends "base.jinja" %}
{% block head_title %}
{% trans %}
diff --git a/sampleapp/templates/components/menu.jinja b/sampleapp/templates/components/menu.jinja
index 2cf6067..b14917d 100644
--- a/sampleapp/templates/components/menu.jinja
+++ b/sampleapp/templates/components/menu.jinja
@@ -19,12 +19,12 @@
class="relative">
+ @click="toggle()"
+ :aria-expanded="open"
+ :aria-controls="$id('dropdown-button')"
+ type="button"
+ :class="open ? 'text-gray-900' : 'text-gray-500'"
+ class="{{ button_style }}">
{{ button }}
-
@@ -42,9 +41,7 @@
{% for data in rc %}
setTimeout(function(){
labels.push({{ loop.index0 }} + 1)
- {% for j in data %}
- datasets[{{ loop.index0 }}].data.push({{ j }})
- {% endfor %}
+ {% for j in data %} datasets[{{ loop.index0 }}].data.push({{ j }}){% endfor %}
chartLine.update()
}, 750 * {{ loop.index0 }});
{% endfor %}
diff --git a/sampleapp/templates/svg/svg.jinja b/sampleapp/templates/svg/svg.jinja
index cd5fc99..9694ac1 100644
--- a/sampleapp/templates/svg/svg.jinja
+++ b/sampleapp/templates/svg/svg.jinja
@@ -177,7 +177,6 @@
{% endmacro %}
-
{% macro signal() %}
-{% endmacro %}
\ No newline at end of file
+{% endmacro %}
From c01b597027c76fb36555832d34b70bdcd7b54535 Mon Sep 17 00:00:00 2001
From: Aidan Gerber
Date: Tue, 17 May 2022 12:50:06 -0700
Subject: [PATCH 20/50] update some package versions
---
poetry.lock | 114 +++++++++++++++----------
pyproject.toml | 4 +-
sampleapp/templates/random_chart.jinja | 16 ++--
3 files changed, 77 insertions(+), 57 deletions(-)
diff --git a/poetry.lock b/poetry.lock
index e319f99..7a9db16 100644
--- a/poetry.lock
+++ b/poetry.lock
@@ -125,28 +125,23 @@ yaml = ["pyyaml"]
[[package]]
name = "black"
-version = "21.12b0"
+version = "22.3.0"
description = "The uncompromising code formatter."
category = "dev"
optional = false
python-versions = ">=3.6.2"
[package.dependencies]
-click = ">=7.1.2"
+click = ">=8.0.0"
mypy-extensions = ">=0.4.3"
-pathspec = ">=0.9.0,<1"
+pathspec = ">=0.9.0"
platformdirs = ">=2"
-tomli = ">=0.2.6,<2.0.0"
-typing-extensions = [
- {version = ">=3.10.0.0", markers = "python_version < \"3.10\""},
- {version = "!=3.10.0.1", markers = "python_version >= \"3.10\""},
-]
+tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""}
[package.extras]
colorama = ["colorama (>=0.4.3)"]
d = ["aiohttp (>=3.7.4)"]
jupyter = ["ipython (>=7.8.0)", "tokenize-rt (>=3.2.0)"]
-python2 = ["typed-ast (>=1.4.3)"]
uvloop = ["uvloop (>=0.15.2)"]
[[package]]
@@ -361,8 +356,8 @@ six = "*"
[[package]]
name = "django-anymail"
-version = "8.5"
-description = "Django email integration for Amazon SES, Mailgun, Mailjet, Postmark, SendGrid, SendinBlue, SparkPost and other transactional ESPs"
+version = "8.6"
+description = "Django email backends and webhooks for Amazon SES, Mailgun, Mailjet, Mandrill, Postal, Postmark, SendGrid, SendinBlue, and SparkPost"
category = "main"
optional = false
python-versions = ">=3.5"
@@ -503,7 +498,7 @@ Django = ">=1.11"
[[package]]
name = "djlint"
-version = "0.7.4"
+version = "1.0.3"
description = "HTML Template Linter and Formatter"
category = "dev"
optional = false
@@ -512,15 +507,15 @@ python-versions = ">=3.7,<4.0"
[package.dependencies]
click = ">=8.0.1,<9.0.0"
colorama = ">=0.4.4,<0.5.0"
-importlib-metadata = ">=4.10.1,<5.0.0"
+importlib-metadata = ">=4.11.0,<5.0.0"
pathspec = ">=0.9.0,<0.10.0"
PyYAML = ">=6.0,<7.0"
regex = ">=2022.1.18,<2023.0.0"
-tomlkit = ">=0.8.0,<0.9.0"
+tomli = {version = ">=2.0.1,<3.0.0", markers = "python_version < \"3.11\""}
tqdm = ">=4.62.2,<5.0.0"
[package.extras]
-test = ["coverage (>=6.3,<7.0)", "pytest (>=6.2.5,<7.0.0)", "pytest-cov (>=3.0.0,<4.0.0)"]
+test = ["coverage (>=6.3.1,<7.0.0)", "pytest (>=7.0.1,<8.0.0)", "pytest-cov (>=3.0.0,<4.0.0)"]
[[package]]
name = "entrypoints"
@@ -809,7 +804,7 @@ python-versions = ">=3.5"
[[package]]
name = "importlib-metadata"
-version = "4.10.1"
+version = "4.11.3"
description = "Read metadata from Python packages"
category = "dev"
optional = false
@@ -819,9 +814,9 @@ python-versions = ">=3.7"
zipp = ">=0.5"
[package.extras]
-docs = ["sphinx", "jaraco.packaging (>=8.2)", "rst.linker (>=1.9)"]
+docs = ["sphinx", "jaraco.packaging (>=9)", "rst.linker (>=1.9)"]
perf = ["ipython"]
-testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytest-cov", "pytest-enabler (>=1.0.1)", "packaging", "pyfakefs", "flufl.flake8", "pytest-perf (>=0.9.2)", "pytest-black (>=0.3.7)", "pytest-mypy", "importlib-resources (>=1.3)"]
+testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytest-cov", "pytest-enabler (>=1.0.1)", "packaging", "pyfakefs", "flufl.flake8", "pytest-perf (>=0.9.2)", "pytest-black (>=0.3.7)", "pytest-mypy (>=0.9.1)", "importlib-resources (>=1.3)"]
[[package]]
name = "importmagic"
@@ -1216,7 +1211,7 @@ python-versions = ">=3.5"
[[package]]
name = "pyjwt"
-version = "2.3.0"
+version = "2.4.0"
description = "JSON Web Token implementation in Python"
category = "main"
optional = false
@@ -1502,11 +1497,11 @@ python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*"
[[package]]
name = "tomli"
-version = "1.2.3"
+version = "2.0.1"
description = "A lil' TOML parser"
category = "dev"
optional = false
-python-versions = ">=3.6"
+python-versions = ">=3.7"
[[package]]
name = "tomlkit"
@@ -1560,14 +1555,6 @@ dev = ["autoflake (>=1.3.1,<2.0.0)", "flake8 (>=3.8.3,<4.0.0)"]
doc = ["mkdocs (>=1.1.2,<2.0.0)", "mkdocs-material (>=5.4.0,<6.0.0)", "markdown-include (>=0.5.1,<0.6.0)"]
test = ["shellingham (>=1.3.0,<2.0.0)", "pytest (>=4.4.0,<5.4.0)", "pytest-cov (>=2.10.0,<3.0.0)", "coverage (>=5.2,<6.0)", "pytest-xdist (>=1.32.0,<2.0.0)", "pytest-sugar (>=0.9.4,<0.10.0)", "mypy (==0.910)", "black (>=19.10b0,<20.0b0)", "isort (>=5.0.6,<6.0.0)"]
-[[package]]
-name = "typing-extensions"
-version = "4.0.1"
-description = "Backported and Experimental Type Hints for Python 3.6+"
-category = "dev"
-optional = false
-python-versions = ">=3.6"
-
[[package]]
name = "tzdata"
version = "2021.5"
@@ -1731,7 +1718,7 @@ testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytest-
[metadata]
lock-version = "1.1"
python-versions = "^3.10"
-content-hash = "bd0c31ac033794283ebc0a6a2fb95e4083951ee9a5f69d9fd7188a74ea270f62"
+content-hash = "ab74734991057594e4a18b5921e78a8c194e6f973f5629daf0bb4d026b0fffef"
[metadata.files]
appdirs = [
@@ -1794,8 +1781,29 @@ bandit = [
{file = "bandit-1.7.2.tar.gz", hash = "sha256:6d11adea0214a43813887bfe71a377b5a9955e4c826c8ffd341b494e3ab25260"},
]
black = [
- {file = "black-21.12b0-py3-none-any.whl", hash = "sha256:a615e69ae185e08fdd73e4715e260e2479c861b5740057fde6e8b4e3b7dd589f"},
- {file = "black-21.12b0.tar.gz", hash = "sha256:77b80f693a569e2e527958459634f18df9b0ba2625ba4e0c2d5da5be42e6f2b3"},
+ {file = "black-22.3.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:2497f9c2386572e28921fa8bec7be3e51de6801f7459dffd6e62492531c47e09"},
+ {file = "black-22.3.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:5795a0375eb87bfe902e80e0c8cfaedf8af4d49694d69161e5bd3206c18618bb"},
+ {file = "black-22.3.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:e3556168e2e5c49629f7b0f377070240bd5511e45e25a4497bb0073d9dda776a"},
+ {file = "black-22.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:67c8301ec94e3bcc8906740fe071391bce40a862b7be0b86fb5382beefecd968"},
+ {file = "black-22.3.0-cp310-cp310-win_amd64.whl", hash = "sha256:fd57160949179ec517d32ac2ac898b5f20d68ed1a9c977346efbac9c2f1e779d"},
+ {file = "black-22.3.0-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:cc1e1de68c8e5444e8f94c3670bb48a2beef0e91dddfd4fcc29595ebd90bb9ce"},
+ {file = "black-22.3.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6d2fc92002d44746d3e7db7cf9313cf4452f43e9ea77a2c939defce3b10b5c82"},
+ {file = "black-22.3.0-cp36-cp36m-win_amd64.whl", hash = "sha256:a6342964b43a99dbc72f72812bf88cad8f0217ae9acb47c0d4f141a6416d2d7b"},
+ {file = "black-22.3.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:328efc0cc70ccb23429d6be184a15ce613f676bdfc85e5fe8ea2a9354b4e9015"},
+ {file = "black-22.3.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:06f9d8846f2340dfac80ceb20200ea5d1b3f181dd0556b47af4e8e0b24fa0a6b"},
+ {file = "black-22.3.0-cp37-cp37m-win_amd64.whl", hash = "sha256:ad4efa5fad66b903b4a5f96d91461d90b9507a812b3c5de657d544215bb7877a"},
+ {file = "black-22.3.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:e8477ec6bbfe0312c128e74644ac8a02ca06bcdb8982d4ee06f209be28cdf163"},
+ {file = "black-22.3.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:637a4014c63fbf42a692d22b55d8ad6968a946b4a6ebc385c5505d9625b6a464"},
+ {file = "black-22.3.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:863714200ada56cbc366dc9ae5291ceb936573155f8bf8e9de92aef51f3ad0f0"},
+ {file = "black-22.3.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:10dbe6e6d2988049b4655b2b739f98785a884d4d6b85bc35133a8fb9a2233176"},
+ {file = "black-22.3.0-cp38-cp38-win_amd64.whl", hash = "sha256:cee3e11161dde1b2a33a904b850b0899e0424cc331b7295f2a9698e79f9a69a0"},
+ {file = "black-22.3.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:5891ef8abc06576985de8fa88e95ab70641de6c1fca97e2a15820a9b69e51b20"},
+ {file = "black-22.3.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:30d78ba6bf080eeaf0b7b875d924b15cd46fec5fd044ddfbad38c8ea9171043a"},
+ {file = "black-22.3.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:ee8f1f7228cce7dffc2b464f07ce769f478968bfb3dd1254a4c2eeed84928aad"},
+ {file = "black-22.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6ee227b696ca60dd1c507be80a6bc849a5a6ab57ac7352aad1ffec9e8b805f21"},
+ {file = "black-22.3.0-cp39-cp39-win_amd64.whl", hash = "sha256:9b542ced1ec0ceeff5b37d69838106a6348e60db7b8fdd245294dc1d26136265"},
+ {file = "black-22.3.0-py3-none-any.whl", hash = "sha256:bc58025940a896d7e5356952228b68f793cf5fcb342be703c3a2669a1488cb72"},
+ {file = "black-22.3.0.tar.gz", hash = "sha256:35020b8886c022ced9282b51b5a875b6d1ab0c387b31a065b84db7c33085ca79"},
]
boto3 = [
{file = "boto3-1.20.46-py3-none-any.whl", hash = "sha256:a2ffce001160d7e7c72a90c3084700d50eb64ea4a3aae8afe21566971d1fd611"},
@@ -1817,6 +1825,9 @@ brotli = [
{file = "Brotli-1.0.9-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7ee83d3e3a024a9618e5be64648d6d11c37047ac48adff25f12fa4226cf23d1c"},
{file = "Brotli-1.0.9-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:19598ecddd8a212aedb1ffa15763dd52a388518c4550e615aed88dc3753c0f0c"},
{file = "Brotli-1.0.9-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:44bb8ff420c1d19d91d79d8c3574b8954288bdff0273bf788954064d260d7ab0"},
+ {file = "Brotli-1.0.9-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:e23281b9a08ec338469268f98f194658abfb13658ee98e2b7f85ee9dd06caa91"},
+ {file = "Brotli-1.0.9-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:3496fc835370da351d37cada4cf744039616a6db7d13c430035e901443a34daa"},
+ {file = "Brotli-1.0.9-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:b83bb06a0192cccf1eb8d0a28672a1b79c74c3a8a5f2619625aeb6f28b3a82bb"},
{file = "Brotli-1.0.9-cp310-cp310-win32.whl", hash = "sha256:26d168aac4aaec9a4394221240e8a5436b5634adc3cd1cdf637f6645cecbf181"},
{file = "Brotli-1.0.9-cp310-cp310-win_amd64.whl", hash = "sha256:622a231b08899c864eb87e85f81c75e7b9ce05b001e59bbfbf43d4a71f5f32b2"},
{file = "Brotli-1.0.9-cp35-cp35m-macosx_10_6_intel.whl", hash = "sha256:c83aa123d56f2e060644427a882a36b3c12db93727ad7a7b9efd7d7f3e9cc2c4"},
@@ -1828,12 +1839,18 @@ brotli = [
{file = "Brotli-1.0.9-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:40d15c79f42e0a2c72892bf407979febd9cf91f36f495ffb333d1d04cebb34e4"},
{file = "Brotli-1.0.9-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:93130612b837103e15ac3f9cbacb4613f9e348b58b3aad53721d92e57f96d46a"},
{file = "Brotli-1.0.9-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:87fdccbb6bb589095f413b1e05734ba492c962b4a45a13ff3408fa44ffe6479b"},
+ {file = "Brotli-1.0.9-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:6d847b14f7ea89f6ad3c9e3901d1bc4835f6b390a9c71df999b0162d9bb1e20f"},
+ {file = "Brotli-1.0.9-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:495ba7e49c2db22b046a53b469bbecea802efce200dffb69b93dd47397edc9b6"},
+ {file = "Brotli-1.0.9-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:4688c1e42968ba52e57d8670ad2306fe92e0169c6f3af0089be75bbac0c64a3b"},
{file = "Brotli-1.0.9-cp36-cp36m-win32.whl", hash = "sha256:61a7ee1f13ab913897dac7da44a73c6d44d48a4adff42a5701e3239791c96e14"},
{file = "Brotli-1.0.9-cp36-cp36m-win_amd64.whl", hash = "sha256:1c48472a6ba3b113452355b9af0a60da5c2ae60477f8feda8346f8fd48e3e87c"},
{file = "Brotli-1.0.9-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:3b78a24b5fd13c03ee2b7b86290ed20efdc95da75a3557cc06811764d5ad1126"},
{file = "Brotli-1.0.9-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:9d12cf2851759b8de8ca5fde36a59c08210a97ffca0eb94c532ce7b17c6a3d1d"},
{file = "Brotli-1.0.9-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:6c772d6c0a79ac0f414a9f8947cc407e119b8598de7621f39cacadae3cf57d12"},
{file = "Brotli-1.0.9-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:29d1d350178e5225397e28ea1b7aca3648fcbab546d20e7475805437bfb0a130"},
+ {file = "Brotli-1.0.9-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:7bbff90b63328013e1e8cb50650ae0b9bac54ffb4be6104378490193cd60f85a"},
+ {file = "Brotli-1.0.9-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:ec1947eabbaf8e0531e8e899fc1d9876c179fc518989461f5d24e2223395a9e3"},
+ {file = "Brotli-1.0.9-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:12effe280b8ebfd389022aa65114e30407540ccb89b177d3fbc9a4f177c4bd5d"},
{file = "Brotli-1.0.9-cp37-cp37m-win32.whl", hash = "sha256:f909bbbc433048b499cb9db9e713b5d8d949e8c109a2a548502fb9aa8630f0b1"},
{file = "Brotli-1.0.9-cp37-cp37m-win_amd64.whl", hash = "sha256:97f715cf371b16ac88b8c19da00029804e20e25f30d80203417255d239f228b5"},
{file = "Brotli-1.0.9-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:e16eb9541f3dd1a3e92b89005e37b1257b157b7256df0e36bd7b33b50be73bcb"},
@@ -1841,6 +1858,9 @@ brotli = [
{file = "Brotli-1.0.9-cp38-cp38-manylinux1_i686.whl", hash = "sha256:b663f1e02de5d0573610756398e44c130add0eb9a3fc912a09665332942a2efb"},
{file = "Brotli-1.0.9-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:5b6ef7d9f9c38292df3690fe3e302b5b530999fa90014853dcd0d6902fb59f26"},
{file = "Brotli-1.0.9-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8a674ac10e0a87b683f4fa2b6fa41090edfd686a6524bd8dedbd6138b309175c"},
+ {file = "Brotli-1.0.9-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:e2d9e1cbc1b25e22000328702b014227737756f4b5bf5c485ac1d8091ada078b"},
+ {file = "Brotli-1.0.9-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:b336c5e9cf03c7be40c47b5fd694c43c9f1358a80ba384a21969e0b4e66a9b17"},
+ {file = "Brotli-1.0.9-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:85f7912459c67eaab2fb854ed2bc1cc25772b300545fe7ed2dc03954da638649"},
{file = "Brotli-1.0.9-cp38-cp38-win32.whl", hash = "sha256:35a3edbe18e876e596553c4007a087f8bcfd538f19bc116917b3c7522fca0429"},
{file = "Brotli-1.0.9-cp38-cp38-win_amd64.whl", hash = "sha256:269a5743a393c65db46a7bb982644c67ecba4b8d91b392403ad8a861ba6f495f"},
{file = "Brotli-1.0.9-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:2aad0e0baa04517741c9bb5b07586c642302e5fb3e75319cb62087bd0995ab19"},
@@ -1848,6 +1868,9 @@ brotli = [
{file = "Brotli-1.0.9-cp39-cp39-manylinux1_i686.whl", hash = "sha256:16d528a45c2e1909c2798f27f7bf0a3feec1dc9e50948e738b961618e38b6a7b"},
{file = "Brotli-1.0.9-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:56d027eace784738457437df7331965473f2c0da2c70e1a1f6fdbae5402e0389"},
{file = "Brotli-1.0.9-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9bf919756d25e4114ace16a8ce91eb340eb57a08e2c6950c3cebcbe3dff2a5e7"},
+ {file = "Brotli-1.0.9-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:e4c4e92c14a57c9bd4cb4be678c25369bf7a092d55fd0866f759e425b9660806"},
+ {file = "Brotli-1.0.9-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:e48f4234f2469ed012a98f4b7874e7f7e173c167bed4934912a29e03167cf6b1"},
+ {file = "Brotli-1.0.9-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:9ed4c92a0665002ff8ea852353aeb60d9141eb04109e88928026d3c8a9e5433c"},
{file = "Brotli-1.0.9-cp39-cp39-win32.whl", hash = "sha256:cfc391f4429ee0a9370aa93d812a52e1fee0f37a81861f4fdd1f4fb28e8547c3"},
{file = "Brotli-1.0.9-cp39-cp39-win_amd64.whl", hash = "sha256:854c33dad5ba0fbd6ab69185fec8dab89e13cda6b7d191ba111987df74f38761"},
{file = "Brotli-1.0.9-pp37-pypy37_pp73-macosx_10_9_x86_64.whl", hash = "sha256:9749a124280a0ada4187a6cfd1ffd35c350fb3af79c706589d98e088c5044267"},
@@ -2019,8 +2042,8 @@ django-annoying = [
{file = "django_annoying-0.10.6-py2.py3-none-any.whl", hash = "sha256:e230f28fec0559b4fdb621ff202068a78170ada2ac1ec7a73ba822cc1f737791"},
]
django-anymail = [
- {file = "django-anymail-8.5.tar.gz", hash = "sha256:677e937dc9e2671ca7631abb1d94ddc6b840beb3d53c0fbf699e866a6a9ba92f"},
- {file = "django_anymail-8.5-py3-none-any.whl", hash = "sha256:2325932f56f914d96e0a54db850f2b246ed2277b753f75319620d051a51551e2"},
+ {file = "django-anymail-8.6.tar.gz", hash = "sha256:783342d49dd07d68778b81dd12a94c86e1d217463a68a85450a0513fabe31345"},
+ {file = "django_anymail-8.6-py3-none-any.whl", hash = "sha256:49d83d7c16316ca86a624097496881d59b7d71b16bf1c5211cffa5b19ef98d0c"},
]
django-cachalot = [
{file = "django-cachalot-2.5.0.tar.gz", hash = "sha256:1682d902842998236f8579541db491bb82f68510587f74e417455667f564c891"},
@@ -2063,8 +2086,8 @@ django-vite = [
{file = "django_vite-1.3.0-py3-none-any.whl", hash = "sha256:510724570d9e48201837388a53e8fdf59d96f0b8ea9c44f5eca597906d507ccc"},
]
djlint = [
- {file = "djlint-0.7.4-py3-none-any.whl", hash = "sha256:1bced1cf7b0712b00d33a8df8418aff56ccea01d21b79a94ca6e876cf763e6b5"},
- {file = "djlint-0.7.4.tar.gz", hash = "sha256:aad18147db996cb93d63493126ad29d13251f60e6e45f98ab0e9b6252875ccf0"},
+ {file = "djlint-1.0.3-py3-none-any.whl", hash = "sha256:9ccd46ea91f2881c6caac595d4267c5c9c4ecc47024df15e665cc5a6f9c77543"},
+ {file = "djlint-1.0.3.tar.gz", hash = "sha256:1477717ccb4f4789f38c86e7dc9194b8eb5951a5b1804fee8945592a3e851554"},
]
entrypoints = [
{file = "entrypoints-0.4-py3-none-any.whl", hash = "sha256:f174b5ff827504fd3cd97cc3f8649f3693f51538c7e4bdf3ef002c8429d42f9f"},
@@ -2249,8 +2272,8 @@ idna = [
{file = "idna-3.3.tar.gz", hash = "sha256:9d643ff0a55b762d5cdb124b8eaa99c66322e2157b69160bc32796e824360e6d"},
]
importlib-metadata = [
- {file = "importlib_metadata-4.10.1-py3-none-any.whl", hash = "sha256:899e2a40a8c4a1aec681feef45733de8a6c58f3f6a0dbed2eb6574b4387a77b6"},
- {file = "importlib_metadata-4.10.1.tar.gz", hash = "sha256:951f0d8a5b7260e9db5e41d429285b5f451e928479f19d80818878527d36e95e"},
+ {file = "importlib_metadata-4.11.3-py3-none-any.whl", hash = "sha256:1208431ca90a8cca1a6b8af391bb53c1a2db74e5d1cef6ddced95d4b2062edc6"},
+ {file = "importlib_metadata-4.11.3.tar.gz", hash = "sha256:ea4c597ebf37142f827b8f39299579e31685c31d3a438b59f469406afd0f2539"},
]
importmagic = [
{file = "importmagic-0.1.7.tar.gz", hash = "sha256:3f7757a5b74c9a291e20e12023bb3bf71bc2fa3adfb15a08570648ab83eaf8d8"},
@@ -2466,6 +2489,9 @@ playwright = [
{file = "playwright-1.18.2-py3-none-macosx_11_0_arm64.whl", hash = "sha256:75aacc73bdfb6c6832e7a09f3e9d356db0e2bd8f18d719b068c17c841c0a5507"},
{file = "playwright-1.18.2-py3-none-macosx_11_0_universal2.whl", hash = "sha256:0d69764ea9a216ce933eb5679ff6aa6399e7e9e43360809ec261549741e1b8d6"},
{file = "playwright-1.18.2-py3-none-manylinux1_x86_64.whl", hash = "sha256:425c475b65562a6a2f7d46c5dcaa13d8ff098da101a100600016d320325ec436"},
+ {file = "playwright-1.18.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6d640e10ce2a41fb474be74526ec1413e71ed242b963a63b4a0ff6f30afabb5d"},
+ {file = "playwright-1.18.2-py3-none-win32.whl", hash = "sha256:51f946c98805eedc965673e873c4d828af298cbe171ef26a256d653e3730632a"},
+ {file = "playwright-1.18.2-py3-none-win_amd64.whl", hash = "sha256:4b55758555dd3937ed0722446182f0b97e96704895bea47cf58d04fd7a900edb"},
]
poetryup = [
{file = "poetryup-0.5.1-py3-none-any.whl", hash = "sha256:595e6ed167bc88496ee5ac1e1a51650871ba11ae9cb2bf0af42c62d38c439e0d"},
@@ -2569,8 +2595,8 @@ pygments = [
{file = "Pygments-2.11.2.tar.gz", hash = "sha256:4e426f72023d88d03b2fa258de560726ce890ff3b630f88c21cbb8b2503b8c6a"},
]
pyjwt = [
- {file = "PyJWT-2.3.0-py3-none-any.whl", hash = "sha256:e0c4bb8d9f0af0c7f5b1ec4c5036309617d03d56932877f2f7a0beeb5318322f"},
- {file = "PyJWT-2.3.0.tar.gz", hash = "sha256:b888b4d56f06f6dcd777210c334e69c737be74755d3e5e9ee3fe67dc18a0ee41"},
+ {file = "PyJWT-2.4.0-py3-none-any.whl", hash = "sha256:72d1d253f32dbd4f5c88eaf1fdc62f3a19f676ccbadb9dbc5d07e951b2b26daf"},
+ {file = "PyJWT-2.4.0.tar.gz", hash = "sha256:d42908208c699b3b973cbeb01a969ba6a96c821eefb1c5bfe4c390c01d67abba"},
]
pylint = [
{file = "pylint-2.12.2-py3-none-any.whl", hash = "sha256:daabda3f7ed9d1c60f52d563b1b854632fd90035bcf01443e234d3dc794e3b74"},
@@ -2761,8 +2787,8 @@ toml = [
{file = "toml-0.10.2.tar.gz", hash = "sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f"},
]
tomli = [
- {file = "tomli-1.2.3-py3-none-any.whl", hash = "sha256:e3069e4be3ead9668e21cb9b074cd948f7b3113fd9c8bba083f48247aab8b11c"},
- {file = "tomli-1.2.3.tar.gz", hash = "sha256:05b6166bff487dc068d322585c7ea4ef78deed501cc124060e0f238e89a9231f"},
+ {file = "tomli-2.0.1-py3-none-any.whl", hash = "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc"},
+ {file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"},
]
tomlkit = [
{file = "tomlkit-0.8.0-py3-none-any.whl", hash = "sha256:b824e3466f1d475b2b5f1c392954c6cb7ea04d64354ff7300dc7c14257dc85db"},
@@ -2780,10 +2806,6 @@ typer = [
{file = "typer-0.4.0-py3-none-any.whl", hash = "sha256:d81169725140423d072df464cad1ff25ee154ef381aaf5b8225352ea187ca338"},
{file = "typer-0.4.0.tar.gz", hash = "sha256:63c3aeab0549750ffe40da79a1b524f60e08a2cbc3126c520ebf2eeaf507f5dd"},
]
-typing-extensions = [
- {file = "typing_extensions-4.0.1-py3-none-any.whl", hash = "sha256:7f001e5ac290a0c0401508864c7ec868be4e701886d5b573a9528ed3973d9d3b"},
- {file = "typing_extensions-4.0.1.tar.gz", hash = "sha256:4ca091dea149f945ec56afb48dae714f21e8692ef22a395223bcd328961b6a0e"},
-]
tzdata = [
{file = "tzdata-2021.5-py2.py3-none-any.whl", hash = "sha256:3eee491e22ebfe1e5cfcc97a4137cd70f092ce59144d81f8924a844de05ba8f5"},
{file = "tzdata-2021.5.tar.gz", hash = "sha256:68dbe41afd01b867894bbdfd54fa03f468cfa4f0086bfb4adcd8de8f24f3ee21"},
diff --git a/pyproject.toml b/pyproject.toml
index 27b30c9..e284418 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -55,9 +55,9 @@ flake8-builtins = "^1.5.3"
flake8-eradicate = "^1.2.0"
flake8-mutable = "^1.2.0"
# flake8-django = "^1.1.2"
-black = "^21.12b0"
+black = "^22.3.0"
isort = "^5.10.1"
-djlint = "^0.7.4"
+djlint = "1.0.3"
pudb = "^2022.1"
poetryup = "^0.5.1"
pylint-celery = "^0.3"
diff --git a/sampleapp/templates/random_chart.jinja b/sampleapp/templates/random_chart.jinja
index a55af57..f24019f 100644
--- a/sampleapp/templates/random_chart.jinja
+++ b/sampleapp/templates/random_chart.jinja
@@ -8,10 +8,9 @@
From be39fafcba43bf280c84a44ee6b826d844227fbc Mon Sep 17 00:00:00 2001
From: Aidan Gerber
Date: Tue, 17 May 2022 13:25:11 -0700
Subject: [PATCH 21/50] create account base
---
.../templates/account/account_base.jinja | 17 ++++++++++++++++
.../account/password_reset_done.jinja | 20 +++++++++----------
.../account/password_reset_from_key.jinja | 10 +++++-----
sampleapp/templates/random_chart.jinja | 2 +-
4 files changed, 33 insertions(+), 16 deletions(-)
create mode 100644 sampleapp/templates/account/account_base.jinja
diff --git a/sampleapp/templates/account/account_base.jinja b/sampleapp/templates/account/account_base.jinja
new file mode 100644
index 0000000..87a2f85
--- /dev/null
+++ b/sampleapp/templates/account/account_base.jinja
@@ -0,0 +1,17 @@
+{% from 'account/components/account_box.jinja' import account_box %}
+{% extends "base.jinja" %}
+{% set account_back %}
+{% block account_back %}
+{% endblock account_back %}
+{% endset %}
+{% set account_title %}
+{% block account_title %}
+{% endblock account_title %}
+{% endset %}
+{% set account_content %}
+{% block account_content %}
+{% endblock account_content %}
+{% endset %}
+{% block content %}
+ {{ account_box(account_title, account_content, back=account_back) }}
+{% endblock content %}
diff --git a/sampleapp/templates/account/password_reset_done.jinja b/sampleapp/templates/account/password_reset_done.jinja
index 053c0cd..a65c345 100644
--- a/sampleapp/templates/account/password_reset_done.jinja
+++ b/sampleapp/templates/account/password_reset_done.jinja
@@ -1,3 +1,4 @@
+{% from 'account/components/account_box.jinja' import account_box %}
{% extends "base.jinja" %}
{% block head_title %}
{% trans %}
@@ -5,17 +6,16 @@
{% endtrans %}
{% endblock head_title %}
{% block content %}
-
+ {% set title="Password Reset" %}
+ {% set content %}
+ {% if request.user.is_authenticated %}
+ {% include "account/snippets/already_logged_in.jinja" %}
+ {% endif %}
+
{% trans %}
- Password Reset
+ We have sent you an e-mail. If you have not received it please check your spam folder. Otherwise contact us if you do not receive it in a few minutes.
{% endtrans %}
-
-{% if user.is_authenticated %}
- {% include "account/snippets/already_logged_in.jinja" %}
-{% endif %}
-
- {% trans %}
- We have sent you an e-mail. If you have not received it please check your spam folder. Otherwise contact us if you do not receive it in a few minutes.
-{% endtrans %}
+{% endset %}
+{{ account_box(title, content, back='') }}
{% endblock content %}
diff --git a/sampleapp/templates/account/password_reset_from_key.jinja b/sampleapp/templates/account/password_reset_from_key.jinja
index c2f0e16..d4d5298 100644
--- a/sampleapp/templates/account/password_reset_from_key.jinja
+++ b/sampleapp/templates/account/password_reset_from_key.jinja
@@ -1,11 +1,11 @@
{% from 'django/forms/inputgroup.jinja' import inputgroup %}
-{% extends "base.jinja" %}
-{% block head_title %}
+{% extends "account/account_base.jinja" %}
+{% block account_title %}
{% trans %}
Change Password
{% endtrans %}
-{% endblock head_title %}
-{% block content %}
+{% endblock account_title %}
+{% block account_content %}
{% if token_fail %}
{% trans %}
@@ -33,4 +33,4 @@
value=" {% trans %} change password {% endtrans %}"/>
{% endif %}
-{% endblock content %}
+{% endblock account_content %}
diff --git a/sampleapp/templates/random_chart.jinja b/sampleapp/templates/random_chart.jinja
index f24019f..9bda319 100644
--- a/sampleapp/templates/random_chart.jinja
+++ b/sampleapp/templates/random_chart.jinja
@@ -40,7 +40,7 @@
{% for data in rc %}
setTimeout(function(){
labels.push({{ loop.index0 }} + 1)
- {% for j in data %} datasets[{{ loop.index0 }}].data.push({{ j }}){% endfor %}
+ {% for j in data %} datasets[{{ loop.index0 }}].data.push({{ j }});{% endfor %}
chartLine.update();
}, 750 * {{ loop.index0 }});
{% endfor %}
From 469a682817d6fc9e43e36879a55d0bc7c203f819 Mon Sep 17 00:00:00 2001
From: Aidan Gerber
Date: Tue, 17 May 2022 13:27:51 -0700
Subject: [PATCH 22/50] create account base
---
.pre-commit-config.yaml | 1 +
1 file changed, 1 insertion(+)
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index d19c859..a836166 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -43,6 +43,7 @@ repos:
entry: poetry run djlint --reformat
language: system
types_or: [html,jinja]
+ custom_blocks: [trans]
## system
- repo: https://github.com/asottile/pyupgrade
From a8262ba024961ed334b5bb35fd9f90e49dfeb2ab Mon Sep 17 00:00:00 2001
From: Aidan Gerber
Date: Tue, 17 May 2022 14:33:17 -0700
Subject: [PATCH 23/50] implement account_base
---
.pre-commit-config.yaml | 1 -
pyproject.toml | 1 +
sampleapp/config/jinja2.py | 2 +-
sampleapp/dtl/account/account_inactive.html | 14 +--
sampleapp/dtl/account/logout.html | 32 +++----
sampleapp/dtl/account/password_reset.html | 40 ++++----
.../dtl/account/password_reset_done.html | 20 ++--
.../dtl/account/password_reset_from_key.html | 44 ++++-----
.../account/password_reset_from_key_done.html | 14 +--
sampleapp/dtl/account/password_set.html | 22 ++---
sampleapp/dtl/account/welcome.html | 8 +-
.../templates/account/account_inactive.jinja | 19 ++--
sampleapp/templates/account/logout.jinja | 35 +++----
.../templates/account/password_reset.jinja | 49 +++++-----
.../account/password_reset_done.jinja | 25 ++---
.../account/password_reset_from_key.jinja | 50 +++++-----
.../password_reset_from_key_done.jinja | 25 ++---
.../templates/account/password_set.jinja | 19 ++--
sampleapp/templates/account/welcome.jinja | 94 +++++++++----------
sampleapp/templates/header/end.jinja | 5 +
sampleapp/templates/random_chart.jinja | 13 +--
21 files changed, 251 insertions(+), 281 deletions(-)
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index a836166..d19c859 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -43,7 +43,6 @@ repos:
entry: poetry run djlint --reformat
language: system
types_or: [html,jinja]
- custom_blocks: [trans]
## system
- repo: https://github.com/asottile/pyupgrade
diff --git a/pyproject.toml b/pyproject.toml
index e284418..0c4a4d6 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -144,6 +144,7 @@ pyflakes = ["+*", "-E5110"]
[tool.djlint]
profile="django"
ignore="H023"
+custom_blocks="trans"
[build-system]
diff --git a/sampleapp/config/jinja2.py b/sampleapp/config/jinja2.py
index f8b3df4..e9562ac 100644
--- a/sampleapp/config/jinja2.py
+++ b/sampleapp/config/jinja2.py
@@ -31,7 +31,7 @@ def random_chart(
previous_val = (results[-2][var] + previous_mean) / 2
results[-1].append(
random.randrange( # noqa
- floor(0.67 * previous_val), ceil(1.5 * previous_val) # noqa
+ floor(0.5 * previous_val), ceil(2 * previous_val) # noqa
) # noqa
)
return results
diff --git a/sampleapp/dtl/account/account_inactive.html b/sampleapp/dtl/account/account_inactive.html
index 047feab..79b4160 100644
--- a/sampleapp/dtl/account/account_inactive.html
+++ b/sampleapp/dtl/account/account_inactive.html
@@ -2,10 +2,10 @@
{% load i18n %}
{% block head_title %}
{% trans "Account Inactive" %}
-{% endblock head_title %}
-{% block content %}
- {% trans "Account Inactive" %}
-
- {% trans "This account is inactive." %}
-
-{% endblock content %}
+ {% endblock head_title %}
+ {% block content %}
+ {% trans "Account Inactive" %}
+
+ {% trans "This account is inactive." %}
+
+ {% endblock content %}
diff --git a/sampleapp/dtl/account/logout.html b/sampleapp/dtl/account/logout.html
index 69481ac..cdd234c 100644
--- a/sampleapp/dtl/account/logout.html
+++ b/sampleapp/dtl/account/logout.html
@@ -2,19 +2,19 @@
{% load i18n %}
{% block head_title %}
{% trans "Sign Out" %}
-{% endblock head_title %}
-{% block content %}
- {% trans "Sign Out" %}
-
- {% trans 'Are you sure you want to sign out?' %}
-
-
-{% endblock content %}
+ {% endblock head_title %}
+ {% block content %}
+ {% trans "Sign Out" %}
+
+ {% trans 'Are you sure you want to sign out?' %}
+
+
+ {% endblock content %}
diff --git a/sampleapp/dtl/account/password_reset.html b/sampleapp/dtl/account/password_reset.html
index 6515875..a3035b4 100644
--- a/sampleapp/dtl/account/password_reset.html
+++ b/sampleapp/dtl/account/password_reset.html
@@ -3,23 +3,23 @@
{% load account %}
{% block head_title %}
{% trans "Password Reset" %}
-{% endblock head_title %}
-{% block content %}
- {% trans "Password Reset" %}
- {% if user.is_authenticated %}
- {% include "account/snippets/already_logged_in.html" %}
- {% endif %}
-
- {% trans "Forgotten your password? Enter your e-mail address below, and we'll send you an e-mail allowing you to reset it." %}
-
-
-
- {% blocktrans %}Please contact us if you have any trouble resetting your password.{% endblocktrans %}
-
-{% endblock content %}
+ {% endblock head_title %}
+ {% block content %}
+ {% trans "Password Reset" %}
+ {% if user.is_authenticated %}
+ {% include "account/snippets/already_logged_in.html" %}
+ {% endif %}
+
+ {% trans "Forgotten your password? Enter your e-mail address below, and we'll send you an e-mail allowing you to reset it." %}
+
+
+
+ {% blocktrans %}Please contact us if you have any trouble resetting your password.{% endblocktrans %}
+
+ {% endblock content %}
diff --git a/sampleapp/dtl/account/password_reset_done.html b/sampleapp/dtl/account/password_reset_done.html
index a1834b5..479ab68 100644
--- a/sampleapp/dtl/account/password_reset_done.html
+++ b/sampleapp/dtl/account/password_reset_done.html
@@ -3,13 +3,13 @@
{% load account %}
{% block head_title %}
{% trans "Password Reset" %}
-{% endblock head_title %}
-{% block content %}
- {% trans "Password Reset" %}
- {% if user.is_authenticated %}
- {% include "account/snippets/already_logged_in.html" %}
- {% endif %}
-
- {% blocktrans %}We have sent you an e-mail. If you have not received it please check your spam folder. Otherwise contact us if you do not receive it in a few minutes.{% endblocktrans %}
-
-{% endblock content %}
+ {% endblock head_title %}
+ {% block content %}
+ {% trans "Password Reset" %}
+ {% if user.is_authenticated %}
+ {% include "account/snippets/already_logged_in.html" %}
+ {% endif %}
+
+ {% blocktrans %}We have sent you an e-mail. If you have not received it please check your spam folder. Otherwise contact us if you do not receive it in a few minutes.{% endblocktrans %}
+
+ {% endblock content %}
diff --git a/sampleapp/dtl/account/password_reset_from_key.html b/sampleapp/dtl/account/password_reset_from_key.html
index 5413f41..6cdc64e 100644
--- a/sampleapp/dtl/account/password_reset_from_key.html
+++ b/sampleapp/dtl/account/password_reset_from_key.html
@@ -2,25 +2,25 @@
{% load i18n %}
{% block head_title %}
{% trans "Change Password" %}
-{% endblock head_title %}
-{% block content %}
-
- {% if token_fail %}
- {% trans "Bad Token" %}
- {% else %}
- {% trans "Change Password" %}
- {% endif %}
-
- {% if token_fail %}
- {% url 'account_reset_password' as passwd_reset_url %}
-
- {% blocktrans %}The password reset link was invalid, possibly because it has already been used. Please request a new password reset .{% endblocktrans %}
-
- {% else %}
-
- {% endif %}
-{% endblock content %}
+ {% endblock head_title %}
+ {% block content %}
+
+ {% if token_fail %}
+ {% trans "Bad Token" %}
+ {% else %}
+ {% trans "Change Password" %}
+ {% endif %}
+
+ {% if token_fail %}
+ {% url 'account_reset_password' as passwd_reset_url %}
+
+ {% blocktrans %}The password reset link was invalid, possibly because it has already been used. Please request a new password reset .{% endblocktrans %}
+
+ {% else %}
+
+ {% endif %}
+ {% endblock content %}
diff --git a/sampleapp/dtl/account/password_reset_from_key_done.html b/sampleapp/dtl/account/password_reset_from_key_done.html
index 28af0f8..6f98d40 100644
--- a/sampleapp/dtl/account/password_reset_from_key_done.html
+++ b/sampleapp/dtl/account/password_reset_from_key_done.html
@@ -2,10 +2,10 @@
{% load i18n %}
{% block head_title %}
{% trans "Change Password" %}
-{% endblock head_title %}
-{% block content %}
- {% trans "Change Password" %}
-
- {% trans 'Your password is now changed.' %}
-
-{% endblock content %}
+ {% endblock head_title %}
+ {% block content %}
+ {% trans "Change Password" %}
+
+ {% trans 'Your password is now changed.' %}
+
+ {% endblock content %}
diff --git a/sampleapp/dtl/account/password_set.html b/sampleapp/dtl/account/password_set.html
index ae34235..d0a12f3 100644
--- a/sampleapp/dtl/account/password_set.html
+++ b/sampleapp/dtl/account/password_set.html
@@ -2,14 +2,14 @@
{% load i18n %}
{% block head_title %}
{% trans "Set Password" %}
-{% endblock head_title %}
-{% block content %}
- {% trans "Set Password" %}
-
-{% endblock content %}
+ {% endblock head_title %}
+ {% block content %}
+ {% trans "Set Password" %}
+
+ {% endblock content %}
diff --git a/sampleapp/dtl/account/welcome.html b/sampleapp/dtl/account/welcome.html
index 3b3ec21..f19ad41 100644
--- a/sampleapp/dtl/account/welcome.html
+++ b/sampleapp/dtl/account/welcome.html
@@ -3,7 +3,7 @@
{% load account %}
{% block head_title %}
{% trans "Sign In" %}
-{% endblock head_title %}
-{% block content %}
- {% component "welcome_box" %}
-{% endblock content %}
+ {% endblock head_title %}
+ {% block content %}
+ {% component "welcome_box" %}
+ {% endblock content %}
diff --git a/sampleapp/templates/account/account_inactive.jinja b/sampleapp/templates/account/account_inactive.jinja
index 335b5b4..79aaaaf 100644
--- a/sampleapp/templates/account/account_inactive.jinja
+++ b/sampleapp/templates/account/account_inactive.jinja
@@ -1,10 +1,13 @@
-{% extends "base.jinja" %}
-{% block head_title %}
- {% trans "Account Inactive" %}
-{% endblock head_title %}
-{% block content %}
- {% trans "Account Inactive" %}
+{% extends "account/account_base.jinja" %}
+{% block account_title %}
+ {% trans %}
+ Account Inactive
+ {% endtrans %}
+{% endblock account_title %}
+{% block account_content %}
- {% trans "This account is inactive." %}
+ {% trans %}
+ This account is inactive.
+ {% endtrans %}
-{% endblock content %}
+{% endblock account_content %}
diff --git a/sampleapp/templates/account/logout.jinja b/sampleapp/templates/account/logout.jinja
index 1625326..0c8eb0e 100644
--- a/sampleapp/templates/account/logout.jinja
+++ b/sampleapp/templates/account/logout.jinja
@@ -1,29 +1,24 @@
-{% from 'account/components/account_box.jinja' import account_box %}
{% from 'django/forms/inputgroup.jinja' import inputgroup %}
{% from 'components/button.jinja' import button %}
-{% extends "base.jinja" %}
+{% extends "account/account_base.jinja" %}
{% block head_title %}
{% trans %}
- Sign Out
-{% endtrans %}
+ Sign Out
+ {% endtrans %}
{% endblock head_title %}
{% block content %}
- {% set title="Sign Out" %}
- {% set content %}
- {% trans %}
- Are you sure you want to sign out?
+ {% trans %}
+ Are you sure you want to sign out?
+ {% endtrans %}
-{% endtrans %}
-
-{% endset %}
-{{ account_box(title, content, back='') }}
+
{% endblock content %}
diff --git a/sampleapp/templates/account/password_reset.jinja b/sampleapp/templates/account/password_reset.jinja
index dd4ce17..016280e 100644
--- a/sampleapp/templates/account/password_reset.jinja
+++ b/sampleapp/templates/account/password_reset.jinja
@@ -1,35 +1,30 @@
{% from 'django/forms/inputgroup.jinja' import inputgroup %}
-{% from 'account/components/account_box.jinja' import account_box %}
{% from 'components/button.jinja' import button %}
-{% extends "base.jinja" %}
-{% block head_title %}
+{% extends "account/account_base.jinja" %}
+{% block account_title %}
{% trans %}
- Reset Password
-{% endtrans %}
-{% endblock head_title %}
-{% block content %}
- {% set title="Reset Password" %}
- {% set content %}
+ Reset Password
+ {% endtrans %}
+{% endblock account_title %}
+{% block account_content %}
{% if request.user.is_authenticated %}
{% include "account/snippets/already_logged_in.jinja" %}
{% endif %}
{% trans %}
- Forgotten your password? Enter your e-mail address below, and we'll send you an e-mail allowing you to reset it.
- {% endtrans %}
-
-
-
- {% trans %}
- Please contact us if you have any trouble resetting your password.
-{% endtrans %}
-
-{% endset %}
-{{ account_box(title, content, back='') }}
-{% endblock content %}
+ Forgotten your password? Enter your e-mail address below, and we'll send you an e-mail allowing you to reset it.
+ {% endtrans %}
+
+
+
+ {% trans %}
+ Please contact us if you have any trouble resetting your password.
+ {% endtrans %}
+
+{% endblock account_content %}
diff --git a/sampleapp/templates/account/password_reset_done.jinja b/sampleapp/templates/account/password_reset_done.jinja
index a65c345..86ab5ed 100644
--- a/sampleapp/templates/account/password_reset_done.jinja
+++ b/sampleapp/templates/account/password_reset_done.jinja
@@ -1,21 +1,16 @@
-{% from 'account/components/account_box.jinja' import account_box %}
-{% extends "base.jinja" %}
-{% block head_title %}
+{% extends "account/account_base.jinja" %}
+{% block account_title %}
{% trans %}
- Password Reset
-{% endtrans %}
-{% endblock head_title %}
-{% block content %}
- {% set title="Password Reset" %}
- {% set content %}
+ Password Reset
+ {% endtrans %}
+{% endblock account_title %}
+{% block account_content %}
{% if request.user.is_authenticated %}
{% include "account/snippets/already_logged_in.jinja" %}
{% endif %}
{% trans %}
- We have sent you an e-mail. If you have not received it please check your spam folder. Otherwise contact us if you do not receive it in a few minutes.
- {% endtrans %}
-
-{% endset %}
-{{ account_box(title, content, back='') }}
-{% endblock content %}
+ We have sent you an e-mail. If you have not received it please check your spam folder. Otherwise contact us if you do not receive it in a few minutes.
+ {% endtrans %}
+
+{% endblock account_content %}
diff --git a/sampleapp/templates/account/password_reset_from_key.jinja b/sampleapp/templates/account/password_reset_from_key.jinja
index d4d5298..7b9db52 100644
--- a/sampleapp/templates/account/password_reset_from_key.jinja
+++ b/sampleapp/templates/account/password_reset_from_key.jinja
@@ -1,36 +1,30 @@
{% from 'django/forms/inputgroup.jinja' import inputgroup %}
+{% from 'components/button.jinja' import button %}
{% extends "account/account_base.jinja" %}
{% block account_title %}
- {% trans %}
- Change Password
-{% endtrans %}
-{% endblock account_title %}
-{% block account_content %}
-
- {% if token_fail %}
- {% trans %}
+ {% if token_fail %}
+ {% trans %}
Bad Token
{% endtrans %}
{% else %}
{% trans %}
- Change Password
- {% endtrans %}
-{% endif %}
-
-{% if token_fail %}
- {{ url('account_reset_password') }}
-
- {% trans %}
- The password reset link was invalid, possibly because it has already been used. Please request a new password reset .
- {% endtrans %}
-
-{% else %}
-
-{% endif %}
+ Change Password
+ {% endtrans %}
+ {% endif %}
+{% endblock account_title %}
+{% block account_content %}
+ {% if token_fail %}
+ {{ url('account_reset_password') }}
+
+ {% trans %}
+ The password reset link was invalid, possibly because it has already been used. Please request a new password reset .
+ {% endtrans %}
+
+ {% else %}
+
+ {% endif %}
{% endblock account_content %}
diff --git a/sampleapp/templates/account/password_reset_from_key_done.jinja b/sampleapp/templates/account/password_reset_from_key_done.jinja
index b98256d..287d343 100644
--- a/sampleapp/templates/account/password_reset_from_key_done.jinja
+++ b/sampleapp/templates/account/password_reset_from_key_done.jinja
@@ -1,18 +1,13 @@
-{% extends "base.jinja" %}
-{% block head_title %}
+{% extends "account/account_base.jinja" %}
+{% block account_title %}
{% trans %}
- Change Password
-{% endtrans %}
-{% endblock head_title %}
-{% block content %}
-
- {% trans %}
Change Password
{% endtrans %}
-
-
- {% trans %}
- Your password is now changed.
-{% endtrans %}
-
-{% endblock content %}
+{% endblock account_title %}
+{% block account_content %}
+
+ {% trans %}
+ Your password is now changed.
+ {% endtrans %}
+
+{% endblock account_content %}
diff --git a/sampleapp/templates/account/password_set.jinja b/sampleapp/templates/account/password_set.jinja
index ca02f93..cba55a7 100644
--- a/sampleapp/templates/account/password_set.jinja
+++ b/sampleapp/templates/account/password_set.jinja
@@ -1,14 +1,11 @@
-{% from 'account/components/account_box.jinja' import account_box %}
{% from 'django/forms/inputgroup.jinja' import inputgroup %}
-{% extends "base.jinja" %}
-{% block head_title %}
+{% extends "account/account_base.jinja" %}
+{% block account_title %}
{% trans %}
- Set Password
-{% endtrans %}
-{% endblock head_title %}
-{% block content %}
- {% set title="Set Password" %}
- {% set content %}
+ Set Password
+ {% endtrans %}
+{% endblock account_title %}
+{% block account_content %}
-{% endset %}
-{{ account_box(title, content, back='') }}
-{% endblock content %}
+{% endblock account_content %}
diff --git a/sampleapp/templates/account/welcome.jinja b/sampleapp/templates/account/welcome.jinja
index 2ff07ef..a046dd5 100644
--- a/sampleapp/templates/account/welcome.jinja
+++ b/sampleapp/templates/account/welcome.jinja
@@ -1,57 +1,49 @@
-{% from 'account/components/account_box.jinja' import account_box %}
{% from 'django/forms/inputgroup.jinja' import inputgroup %}
{% import 'svg/svg.jinja' as svg %}
-{% extends "base.jinja" %}
-{% block head_title %}
- {% trans %}
- Sign In
-{% endtrans %}
-{% endblock head_title %}
-{% set title %}
-Log in / Sign up
-{% endset %}
-{% set content %}
-
-
-
-
-
-
- Sign in with Facebook
- {{ svg.facebook() }}
-
+{% extends "account/account_base.jinja" %}
+{% block account_title %}
+ {% trans "Sign In" %}
+ {% endtrans %}
+{% endblock account_title %}
+{% block account_content %}
+
+
+
-
-{% endset %}
-{% block content %}
- {{ account_box(title, content, '') }}
-{% endblock content %}
+{% endblock account_content %}
diff --git a/sampleapp/templates/header/end.jinja b/sampleapp/templates/header/end.jinja
index 6adc69c..21d2a98 100644
--- a/sampleapp/templates/header/end.jinja
+++ b/sampleapp/templates/header/end.jinja
@@ -28,6 +28,11 @@
aria-labelledby="user-menu-button"
tabindex="-1">
+
-