diff --git a/Makefile b/Makefile index 8371fba9..3e2af6c2 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,14 @@ install: ## Install the dependencies develop: ## Install the test and dev dependencies python3 -m pip install -e .[test,dev] +.PHONY: pretty-templates +pretty-templates: ## Prettify template files + djlint umap/templates --reformat + +.PHONY: lint-templates +lint-templates: ## Lint template files + djlint umap/templates --lint + .PHONY: version version: ## Display the current version @hatch version diff --git a/pyproject.toml b/pyproject.toml index 318b4ee1..c2807567 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,6 +47,7 @@ dependencies = [ dev = [ "hatch==1.7.0", "black==21.10b0", + "djlint==1.31.0", "mkdocs==1.2.3", ] test = [ @@ -75,3 +76,8 @@ path = "umap/__init__.py" [tool.flake8] # Black crazyness. max-line-length = 88 + +[tool.djlint] +profile="django" +indent=2 +format_css=true diff --git a/umap/templates/404.html b/umap/templates/404.html index de61d244..1fd8b057 100644 --- a/umap/templates/404.html +++ b/umap/templates/404.html @@ -1,12 +1,15 @@ {% extends "base.html" %} - {% load i18n static %} - {% block content %} -
-{% endblock %} \ No newline at end of file + +{% endblock content %} diff --git a/umap/templates/500.html b/umap/templates/500.html index 91b60c1c..5f94dfd5 100644 --- a/umap/templates/500.html +++ b/umap/templates/500.html @@ -1,8 +1,11 @@ - - + +Oops, Server error…
-{% blocktrans with osm_url="http://osm.org" %}uMap lets you create maps with OpenStreetMap layers in a minute and embed them in your site.{% endblocktrans %}
++ {% blocktrans with osm_url="http://osm.org" %}uMap lets you create maps with OpenStreetMap layers in a minute and embed them in your site.{% endblocktrans %} +
{% blocktrans with repo_url="https://github.com/umap-project/umap" %}And it's open source!{% endblocktrans %}
@@ -28,16 +42,16 @@{% trans "Please enter your old password, for security's sake, and then enter your new password twice so we can verify you typed it in correctly." %}
- - {% endblock content %} diff --git a/umap/templates/umap/password_change_done.html b/umap/templates/umap/password_change_done.html index 9fb67450..5203b737 100644 --- a/umap/templates/umap/password_change_done.html +++ b/umap/templates/umap/password_change_done.html @@ -1,9 +1,9 @@ {% extends "umap/content.html" %} - {% load i18n %} - {% block content %}{% trans "Your password was changed." %}
- ++ Home +
{% endblock content %} diff --git a/umap/templates/umap/search.html b/umap/templates/umap/search.html index 98af8429..3f3e3ae4 100644 --- a/umap/templates/umap/search.html +++ b/umap/templates/umap/search.html @@ -1,25 +1,23 @@ {% extends "umap/content.html" %} - {% load i18n %} - {% block maincontent %} -{% include "umap/search_bar.html" %} -{% if q %} -