diff --git a/poetry.lock b/poetry.lock index 55945d1..dd368fa 100644 --- a/poetry.lock +++ b/poetry.lock @@ -331,6 +331,24 @@ files = [ [package.extras] toml = ["tomli"] +[[package]] +name = "crispy-bootstrap5" +version = "2023.10" +description = "Bootstrap5 template pack for django-crispy-forms" +optional = false +python-versions = ">=3.8" +files = [ + {file = "crispy-bootstrap5-2023.10.tar.gz", hash = "sha256:f16c44f1997310e5a89c0cf230402e7111cc1f942f64fb7e44603958b89b06a1"}, + {file = "crispy_bootstrap5-2023.10-py3-none-any.whl", hash = "sha256:9b5a6c9880f37cd32aa678c0d7576ae60b3e502c444c8712e582f8bd91659afb"}, +] + +[package.dependencies] +django = ">=4.2" +django-crispy-forms = ">=2" + +[package.extras] +test = ["pytest", "pytest-django"] + [[package]] name = "decli" version = "0.6.1" @@ -391,6 +409,20 @@ django = ">=2.2,<5.0" [package.extras] docs = ["m2r2 (>=0.2.5,<0.3.0)", "sphinx (>=4.4,<5.0)", "sphinx_rtd_theme (>=1.0,<2.0)"] +[[package]] +name = "django-crispy-forms" +version = "2.1" +description = "Best way to have Django DRY forms" +optional = false +python-versions = ">=3.8" +files = [ + {file = "django-crispy-forms-2.1.tar.gz", hash = "sha256:4d7ec431933ad4d4b5c5a6de4a584d24613c347db9ac168723c9aaf63af4bb96"}, + {file = "django_crispy_forms-2.1-py3-none-any.whl", hash = "sha256:d592044771412ae1bd539cc377203aa61d4eebe77fcbc07fbc8f12d3746d4f6b"}, +] + +[package.dependencies] +django = ">=4.2" + [[package]] name = "django-environ" version = "0.11.2" @@ -1310,4 +1342,4 @@ testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "p [metadata] lock-version = "2.0" python-versions = "^3.11" -content-hash = "d901e40c2a11996fcb56bee04219ee99c58261a9d9944173dcbccc0c7541df76" +content-hash = "0245fa06fc392f70e6e790d909f0c7fcbe72b91c39cbb5576d89707f1d66a8c7" diff --git a/pyproject.toml b/pyproject.toml index 31228dd..4f96f4a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,6 +13,8 @@ psycopg2 = "^2.9.7" django-environ = "^0.11.2" django-guardian = "^2.4.0" django-bootstrap-v5 = "^1.0.11" +django-crispy-forms = "^2.1" +crispy-bootstrap5 = "^2023.10" [tool.poetry.group.dev.dependencies] pre-commit = "^3.4.0" diff --git a/server/settings/base.py b/server/settings/base.py index b9f04be..7400bfd 100644 --- a/server/settings/base.py +++ b/server/settings/base.py @@ -74,6 +74,8 @@ THIRD_PARTY_APPS = [ "guardian", "bootstrap5", + "crispy_forms", + "crispy_bootstrap5", ] LOCAL_APPS = [ @@ -153,3 +155,11 @@ ##################### ANONYMOUS_USER_NAME = None + +################## +# Crispy Forms # +################## + +CRISPY_ALLOWED_TEMPLATE_PACKS = "bootstrap5" + +CRISPY_TEMPLATE_PACK = "bootstrap5" diff --git a/templates/registration/login.html b/templates/registration/login.html index ba22941..7c0382a 100644 --- a/templates/registration/login.html +++ b/templates/registration/login.html @@ -3,38 +3,36 @@ {% block title %}Login{% endblock title %} {% block content %} -{% if form.errors %} -
Your username and password didn't match. Please try again.
-{% endif %} {% if next %} - {% if user.is_authenticated %} -Your account doesn't have access to this page. To proceed, - please login with an account that has access.
- {% else %} -Please login to see this page.
- {% endif %} + {% if user.is_authenticated %} ++ Your account doesn't have access to this page. To proceed, please login + with an account that has access. +
+ {% else %} ++ Please login to see this page. +
+ {% endif %} {% endif %} +{% load crispy_forms_tags %} +