From d5b1821117854a45344596df7f33f809bcadb033 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexis=20M=C3=A9taireau?= Date: Thu, 22 Feb 2024 15:31:32 +0100 Subject: [PATCH] chore: format templates --- umap/templates/registration/login.html | 80 ++++++++++++------------- umap/templates/umap/css.html | 1 - umap/templates/umap/js.html | 41 ++++++++----- umap/templates/umap/map_detail.html | 11 ++-- umap/templates/umap/map_fragment.html | 2 +- umap/templates/umap/map_table.html | 35 +++++------ umap/templates/umap/user_dashboard.html | 15 +++-- umap/tests/test_map_views.py | 6 +- 8 files changed, 100 insertions(+), 91 deletions(-) diff --git a/umap/templates/registration/login.html b/umap/templates/registration/login.html index a5b850b8..1429ff5a 100644 --- a/umap/templates/registration/login.html +++ b/umap/templates/registration/login.html @@ -8,45 +8,45 @@ login {% endblock body_class %} {% block content %} -
-
- {% include "umap/branding.html" %} -
- {% if ENABLE_ACCOUNT_LOGIN %} -

{% trans "Please log in with your account" %}

-
- {% if form.non_field_errors %} -
    - {% for error in form.non_field_errors %}
  • {{ error }}
  • {% endfor %} +
    +
    + {% include "umap/branding.html" %} +
    + {% if ENABLE_ACCOUNT_LOGIN %} +

    {% trans "Please log in with your account" %}

    +
    + {% if form.non_field_errors %} +
      + {% for error in form.non_field_errors %}
    • {{ error }}
    • {% endfor %} +
    + {% endif %} +
    + {% csrf_token %} + {{ form.username.errors }} + + {{ form.password.errors }} + + +
    +
    + {% endif %} + {% if backends.backends|length %} +

    {% trans "Please choose a provider" %}

    +
    + - {% endif %} -
    - {% csrf_token %} - {{ form.username.errors }} - - {{ form.password.errors }} - - -
    -
    - {% endif %} - {% if backends.backends|length %} -

    {% trans "Please choose a provider" %}

    -
    - -
    - {% endif %} -
    +
+ {% endif %} +
{% endblock content %} diff --git a/umap/templates/umap/css.html b/umap/templates/umap/css.html index 186b1dfa..df51e526 100644 --- a/umap/templates/umap/css.html +++ b/umap/templates/umap/css.html @@ -1,5 +1,4 @@ {% load static %} - + - - + + - - + + - + - + - - + + - + - + {% if locale %} - {% with "umap/locale/"|add:locale|add:".js" as path %} - - {% endwith %} + {% with "umap/locale/"|add:locale|add:".js" as path %} + + {% endwith %} {% endif %} diff --git a/umap/templates/umap/map_detail.html b/umap/templates/umap/map_detail.html index 4252ca60..356a65cf 100644 --- a/umap/templates/umap/map_detail.html +++ b/umap/templates/umap/map_detail.html @@ -8,17 +8,16 @@ {% endblock body_class %} {% block extra_head %} {% if preconnect_domains %} - {% for domain in preconnect_domains %} - - {% endfor %} + {% for domain in preconnect_domains %}{% endfor %} {% endif %} {% umap_css %} {{ block.super }} {% umap_js locale=locale %} {% if object.share_status != object.PUBLIC %}{% endif %} - + {% endblock extra_head %} {% block content %} {% block map_init %} diff --git a/umap/templates/umap/map_fragment.html b/umap/templates/umap/map_fragment.html index 63b07521..6bd17562 100644 --- a/umap/templates/umap/map_fragment.html +++ b/umap/templates/umap/map_fragment.html @@ -1,4 +1,4 @@ {% load umap_tags %} -
+
diff --git a/umap/templates/umap/map_table.html b/umap/templates/umap/map_table.html index 56309a4c..51d01543 100644 --- a/umap/templates/umap/map_table.html +++ b/umap/templates/umap/map_table.html @@ -21,8 +21,9 @@ {{ map_inst.preview_settings|json_script:unique_id }} - @@ -42,35 +43,37 @@ {{ map_inst.owner }} - + {% translate "Share" %} - + {% translate "Edit" %} - + {% translate "Download" %}
{% csrf_token %} -
+ method="post" + class="map-delete"> {% csrf_token %} - @@ -93,13 +96,11 @@ {# djlint:on #} {% endif %} - {% blocktranslate with maps_number=maps.number num_pages=maps.paginator.num_pages trimmed %} Page {{ maps_number }} of {{ num_pages }} {% endblocktranslate %} - {% if maps.has_next %} {% translate "next" %} › {% translate "last" %} » @@ -111,12 +112,12 @@ {% endif %} {% blocktranslate with per_page=maps.paginator.per_page trimmed %} - Lines per page: {{ per_page }} + Lines per page: {{ per_page }} {% endblocktranslate %} {% blocktranslate with count=maps.paginator.count trimmed %} - {{ count }} maps + {{ count }} maps {% endblocktranslate %} {% endif %} diff --git a/umap/templates/umap/user_dashboard.html b/umap/templates/umap/user_dashboard.html index 9e4f5d10..855a79be 100644 --- a/umap/templates/umap/user_dashboard.html +++ b/umap/templates/umap/user_dashboard.html @@ -7,8 +7,7 @@ {% trans "Search my maps" as placeholder %}
{% endblock maincontent %} - {% block bottom_js %} {{ block.super }}