diff --git a/dune_processes/settings/settings.py b/dune_processes/settings/settings.py index 169bace8..1c47f233 100644 --- a/dune_processes/settings/settings.py +++ b/dune_processes/settings/settings.py @@ -136,3 +136,7 @@ INSTALLED_APPS += ["django_bootstrap5"] DJANGO_TABLES2_TEMPLATE = "django_tables2/bootstrap5.html" + +INSTALLED_APPS += ["crispy_forms", "crispy_bootstrap5"] +CRISPY_ALLOWED_TEMPLATE_PACKS = "bootstrap5" +CRISPY_TEMPLATE_PACK = "bootstrap5" diff --git a/main/templates/main/boot_process.html b/main/templates/main/boot_process.html index c9a527b2..8a773728 100644 --- a/main/templates/main/boot_process.html +++ b/main/templates/main/boot_process.html @@ -1,4 +1,6 @@ {% extends "main/base.html" %} +{% load crispy_forms_tags %} +{% load django_bootstrap5 %} {% block title %}Boot Process{% endblock title %} @@ -6,8 +8,8 @@
{% csrf_token %} - {{ form }} - + {{ form|crispy }} + {% bootstrap_button button_type="submit" content="Submit" %}
{% endblock content %} diff --git a/poetry.lock b/poetry.lock index 0a8a6eef..d792e119 100644 --- a/poetry.lock +++ b/poetry.lock @@ -171,6 +171,24 @@ files = [ [package.extras] toml = ["tomli"] +[[package]] +name = "crispy-bootstrap5" +version = "2024.2" +description = "Bootstrap5 template pack for django-crispy-forms" +optional = false +python-versions = ">=3.8" +files = [ + {file = "crispy-bootstrap5-2024.2.tar.gz", hash = "sha256:7d1fa40c6faf472e30e85c72551a3d2c9eedbf0abfff920683315e4e6f670f2b"}, + {file = "crispy_bootstrap5-2024.2-py3-none-any.whl", hash = "sha256:3867e320920a6ef156e94f9e0f06a80344c453e1b3bd96cd9dc0522ae9e9afb8"}, +] + +[package.dependencies] +django = ">=4.2" +django-crispy-forms = ">=2" + +[package.extras] +test = ["pytest", "pytest-django"] + [[package]] name = "distlib" version = "0.3.8" @@ -216,6 +234,20 @@ files = [ [package.dependencies] Django = ">=4.2" +[[package]] +name = "django-crispy-forms" +version = "2.3" +description = "Best way to have Django DRY forms" +optional = false +python-versions = ">=3.8" +files = [ + {file = "django_crispy_forms-2.3-py3-none-any.whl", hash = "sha256:efc4c31e5202bbec6af70d383a35e12fc80ea769d464fb0e7fe21768bb138a20"}, + {file = "django_crispy_forms-2.3.tar.gz", hash = "sha256:2db17ae08527201be1273f0df789e5f92819e23dd28fec69cffba7f3762e1a38"}, +] + +[package.dependencies] +django = ">=4.2" + [[package]] name = "django-stubs" version = "5.0.4" @@ -1089,4 +1121,4 @@ brotli = ["brotli"] [metadata] lock-version = "2.0" python-versions = "^3.11" -content-hash = "fe31c0b3c18f9e2201d7dd942661dc7ad7f44f5a0fcb9aa4d359ff1256f6f2e4" +content-hash = "7f1bab17ac1f71ae00794b7356c8a8102b0ac92309a00d3b886191a70c704aa2" diff --git a/pyproject.toml b/pyproject.toml index 4654d470..45de6645 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,6 +16,8 @@ druncschema = { git = "https://github.com/DUNE-DAQ/druncschema.git" } django-tables2 = "^2.7.0" django-bootstrap5 = "^24.2" pytest-asyncio = "^0.24.0" +django-crispy-forms = "^2.3" +crispy-bootstrap5 = "^2024.2" [tool.poetry.group.dev.dependencies] pytest = "^8.3"