Skip to content

Commit

Permalink
chore: reformat templates with djlint
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbgk committed Jul 29, 2024
1 parent 8fc0614 commit 5ba1c28
Show file tree
Hide file tree
Showing 29 changed files with 225 additions and 69 deletions.
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,6 @@ max-line-length = 88
profile="django"
indent=2
format_css=true
blank_line_after_tag="load,extends"
line_break_after_multiline_tag=true

6 changes: 5 additions & 1 deletion umap/templates/404.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{% extends "base.html" %}

{% load i18n static %}

{% block content %}
<div class="content404">
<a href="{% url "home" %}"
Expand All @@ -9,7 +11,9 @@ <h1>
<img alt="0" width="128px" height="128px" src="{% static "umap/img/logo.svg" %}">
4
</h1>
<h2>Not Found</h2>
<h2>
Not Found
</h2>
</a>
</div>
{% endblock content %}
4 changes: 3 additions & 1 deletion umap/templates/500.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
width="128px"
height="128px"
src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjwhLS0gQ3JlYXRlZCB3aXRoIElua3NjYXBlIChodHRwOi8vd3d3Lmlua3NjYXBlLm9yZy8pIC0tPgoKPHN2ZwogICB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iCiAgIHhtbG5zOmNjPSJodHRwOi8vY3JlYXRpdmVjb21tb25zLm9yZy9ucyMiCiAgIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyIKICAgeG1sbnM6c3ZnPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogICB4bWxuczpzb2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E4MS4xMiwtMTM2Ny43NjUpIgogICAgICAgc3R5bGU9ImZpbGw6I2ZmZmZmZjtzdHJva2U6bm9uZSIgLz4KICAgIDxwYXRoCiAgICAgICBzb2RpcG9kaTp0eXBlPSJhcmMiCiAgICAgICBzdHlsZT0iZmlsbDojMzIzZTU2O2ZpbGwtb3BhY2l0eToxO2ZpbGwtcnVsZTpub256ZXJvO3N0cm9rZTpub25lIgogICAgICAgaWQ9InBhdGg1MjYzIgogICAgICAgc29kaXBvZGk6Y3g9IjcwIgogICAgICAgc29kaXBvZGk6Y3k9IjE4IgogICAgICAgc29kaXBvZGk6cng9IjE4IgogICAgICAgc29kaXBvZGk6cnk9IjE4IgogICAgICAgZD0iTSA4OCwxOCBDIDg4LDI3Ljk0MTEyNSA3OS45NDExMjUsMzYgNzAsMzYgNjAuMDU4ODc1LDM2IDUyLDI3Ljk0MTEyNSA1MiwxOCA1Miw4LjA1ODg3NDUgNjAuMDU4ODc1LDAgNzAsMCA3OS45NDExMjUsMCA4OCw4LjA1ODg3NDUgODgsMTggeiIKICAgICAgIHRyYW5zZm9ybT0ibWF0cml4KDEuMzE0MjY5NywwLDAsMS4zMTQyNjk3LC0yNy45OTg4NzgsOTM0LjUyODU1KSIgLz4KICA8L2c+Cjwvc3ZnPgo=" />
<h1>Oops, Server error…</h1>
<h1>
Oops, Server error…
</h1>
</div>
</body>
</html>
10 changes: 8 additions & 2 deletions umap/templates/auth/user_detail.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
{% extends "umap/content.html" %}

{% load i18n %}

{% block maincontent %}
<div class="col wide">
<h2 class="section">{% blocktrans %}Browse {{ current_user }}'s maps{% endblocktrans %}</h2>
<h2 class="section">
{% blocktrans %}Browse {{ current_user }}'s maps{% endblocktrans %}
</h2>
</div>
<div class="wrapper">
<div class="map_list row">
{% if maps %}
{% include "umap/map_list.html" %}
{% else %}
<div>{% blocktrans %}{{ current_user }} has no maps.{% endblocktrans %}</div>
<div>
{% blocktrans %}{{ current_user }} has no maps.{% endblocktrans %}
</div>
{% endif %}
</div>
</div>
Expand Down
22 changes: 18 additions & 4 deletions umap/templates/auth/user_form.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{% extends "umap/content.html" %}

{% load i18n %}

{% block maincontent %}
<div class="row">
<h2 class="section tabs">
Expand All @@ -11,7 +13,11 @@ <h2 class="section tabs">
<div class="row">
{% if form.non_field_errors %}
<ul class="form-errors">
{% for error in form.non_field_errors %}<li>{{ error }}</li>{% endfor %}
{% for error in form.non_field_errors %}
<li>
{{ error }}
</li>
{% endfor %}
</ul>
{% endif %}
<form id="user_form" method="post">
Expand All @@ -22,13 +28,21 @@ <h2 class="section tabs">
</div>
{% if backends.backends|length %}
<div class="row">
<h3>{% trans "Your current providers" %}</h3>
<h3>
{% trans "Your current providers" %}
</h3>
<ul>
{% for name in providers %}<li>{{ name|title }}</li>{% endfor %}
{% for name in providers %}
<li>
{{ name|title }}
</li>
{% endfor %}
</ul>
</div>
<div class="row">
<h3>{% trans "Connect to another provider" %}</h3>
<h3>
{% trans "Connect to another provider" %}
</h3>
<p>
{% blocktrans %}It's a good habit to connect your account to more than one provider, in case one provider becomes unavailable, temporarily or even permanently.{% endblocktrans %}
</p>
Expand Down
10 changes: 8 additions & 2 deletions umap/templates/auth/user_stars.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
{% extends "umap/content.html" %}

{% load i18n %}

{% block maincontent %}
<div class="col wide">
<h2 class="section">{% blocktrans %}Browse {{ current_user }}'s starred maps{% endblocktrans %}</h2>
<h2 class="section">
{% blocktrans %}Browse {{ current_user }}'s starred maps{% endblocktrans %}
</h2>
</div>
<div class="wrapper">
<div class="map_list row">
{% if maps %}
{% include "umap/map_list.html" %}
{% else %}
<div>{% blocktrans %}{{ current_user }} has no starred maps yet.{% endblocktrans %}</div>
<div>
{% blocktrans %}{{ current_user }} has no starred maps yet.{% endblocktrans %}
</div>
{% endif %}
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions umap/templates/base.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% load umap_tags i18n static %}

<!DOCTYPE html>
<html {% if LANGUAGE_BIDI %}dir="rtl"{% endif %}>
<head>
Expand Down
16 changes: 13 additions & 3 deletions umap/templates/registration/login.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{% extends "base.html" %}

{% load umap_tags i18n %}

{% block extra_head %}
{% umap_css %}
{{ block.super }}
Expand All @@ -13,11 +15,17 @@
{% include "umap/branding.html" %}
</header>
{% if ENABLE_ACCOUNT_LOGIN %}
<h2>{% trans "Please log in with your account" %}</h2>
<h2>
{% trans "Please log in with your account" %}
</h2>
<div>
{% if form.non_field_errors %}
<ul class="form-errors">
{% for error in form.non_field_errors %}<li>{{ error }}</li>{% endfor %}
{% for error in form.non_field_errors %}
<li>
{{ error }}
</li>
{% endfor %}
</ul>
{% endif %}
<form id="login_form" action="{% url "login" %}" method="post">
Expand All @@ -34,7 +42,9 @@ <h2>{% trans "Please log in with your account" %}</h2>
</div>
{% endif %}
{% if backends.backends|length %}
<h2>{% trans "Please choose a provider" %}</h2>
<h2>
{% trans "Please choose a provider" %}
</h2>
<div>
<ul class="login-grid block-grid">
{% for name in backends.backends %}
Expand Down
1 change: 1 addition & 0 deletions umap/templates/umap/about.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% extends "umap/content.html" %}

{% block maincontent %}
{% include "umap/about_summary.html" %}
{% endblock maincontent %}
29 changes: 22 additions & 7 deletions umap/templates/umap/about_summary.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% load i18n static %}

<div class="wrapper about_summary highlights">
<div class="row">
<div class="col quarter mwide">
Expand All @@ -18,13 +19,27 @@
width="128px"
height="128px" />
<ul>
<li>{% trans "Choose the layers of your map" %}</li>
<li>{% trans "Add POIs: markers, lines, polygons..." %}</li>
<li>{% trans "Manage POIs colours and icons" %}</li>
<li>{% trans "Manage map options: display a minimap, locate user on load…" %}</li>
<li>{% trans "Batch import geostructured data (geojson, gpx, kml, osm...)" %}</li>
<li>{% trans "Choose the license for your data" %}</li>
<li>{% trans "Embed and share your map" %}</li>
<li>
{% trans "Choose the layers of your map" %}
</li>
<li>
{% trans "Add POIs: markers, lines, polygons..." %}
</li>
<li>
{% trans "Manage POIs colours and icons" %}
</li>
<li>
{% trans "Manage map options: display a minimap, locate user on load…" %}
</li>
<li>
{% trans "Batch import geostructured data (geojson, gpx, kml, osm...)" %}
</li>
<li>
{% trans "Choose the license for your data" %}
</li>
<li>
{% trans "Embed and share your map" %}
</li>
</ul>
</div>
<div class="col quarter mwide">
Expand Down
63 changes: 42 additions & 21 deletions umap/templates/umap/components/alerts/alert.html
Original file line number Diff line number Diff line change
@@ -1,33 +1,39 @@
{% load i18n static %}

<style type="text/css">
@import "{% static 'umap/js/components/alerts/alert.css' %}";
@import "{% static 'umap/js/components/alerts/alert.css' %}";
</style>

<template id="umap-alert-template">
<div role="dialog" class="dark window umap-alert">
<div>
<p role="alert"></p>
<p role="alert">
</p>
</div>
<ul class="buttons">
<li>
<button class="icon icon-16 icon-close" aria-label="{% translate "Close" %}" data-close></button>
<button class="icon icon-16 icon-close"
aria-label="{% translate "Close" %}"
data-close>
</button>
</li>
</ul>
</div>
</template>

<umap-alert></umap-alert>

<template id="umap-alert-creation-template">
<div role="dialog" class="dark window umap-alert">
<div>
<h3 role="alert"></h3>
<h3 role="alert">
</h3>
{% url "login" as login_url %}
<p><em>{% blocktranslate %}Pro-tip: to easily find back your maps, <a href="{{ login_url }}" target="_blank">create an account</a> or <a href="{{ login_url }}" target="_blank">log in</a>.{% endblocktranslate %}</em></p>
<p>
<em>{% blocktranslate %}Pro-tip: to easily find back your maps, <a href="{{ login_url }}" target="_blank">create an account</a> or <a href="{{ login_url }}" target="_blank">log in</a>.{% endblocktranslate %}</em>
</p>
<div id="link-wrapper">
<form>
<label for="url">{% translate "Here is your secret link to edit the map, please keep it safe:" %}</label>
<label for="url">
{% translate "Here is your secret link to edit the map, please keep it safe:" %}
</label>
<fieldset role="group">
<input type="url" name="url" id="url">
<input type="button" value="{% translate "Copy link" %}">
Expand All @@ -36,46 +42,61 @@ <h3 role="alert"></h3>
</div>
<div id="form-wrapper" hidden>
<form>
<label for="email">{% translate "Enter your email address to receive the secret link:" %}</label>
<label for="email">
{% translate "Enter your email address to receive the secret link:" %}
</label>
<fieldset role="group">
<input type="email" name="email" id="email" placeholder="{% translate "Email" %}" required>
<input type="submit" value="{% translate "Send me the link" %}" class="umap-action">
<input type="email"
name="email"
id="email"
placeholder="{% translate "Email" %}"
required>
<input type="submit"
value="{% translate "Send me the link" %}"
class="umap-action">
</fieldset>
</form>
</div>
</div>
<ul class="buttons">
<li>
<button class="icon icon-16 icon-close" aria-label="{% translate "Close" %}" data-close></button>
<button class="icon icon-16 icon-close"
aria-label="{% translate "Close" %}"
data-close>
</button>
</li>
</ul>
</div>
</template>

<umap-alert-creation></umap-alert-creation>

<template id="umap-alert-conflict-template">
<div role="dialog" class="dark window umap-alert">
<div>
<p role="alert"></p>
<p role="alert">
</p>
<div id="conflict-wrapper">
<form>
<a href="#" onclick="document.url" target="_blank">{% translate "See their edits in another tab" %}</a>
<input id="your-changes" type="submit" value="{% translate "Keep your changes and loose theirs" %}">
<input id="their-changes" type="submit" value="{% translate "Keep their changes and loose yours" %}">
<input id="your-changes"
type="submit"
value="{% translate "Keep your changes and loose theirs" %}">
<input id="their-changes"
type="submit"
value="{% translate "Keep their changes and loose yours" %}">
</form>
</div>
</div>
<ul class="buttons">
<li>
<button class="icon icon-16 icon-close" aria-label="{% translate "Close" %}" data-close></button>
<button class="icon icon-16 icon-close"
aria-label="{% translate "Close" %}"
data-close>
</button>
</li>
</ul>
</div>
</template>

<umap-alert-conflict></umap-alert-conflict>

<script type="module">
import { register } from '{% static 'umap/js/components/base.js' %}'
import {
Expand Down
2 changes: 2 additions & 0 deletions umap/templates/umap/content.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{% extends "base.html" %}

{% load umap_tags i18n %}

{% block body_class %}
content
{% endblock body_class %}
Expand Down
1 change: 1 addition & 0 deletions umap/templates/umap/content_footer.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% load i18n %}

<footer>
<a href="https://wiki.openstreetmap.org/wiki/UMap" class="branding">uMap</a>
an OpenStreetMap project
Expand Down
1 change: 1 addition & 0 deletions umap/templates/umap/css.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% load static %}

<link rel="stylesheet"
href="{% static 'umap/vendors/leaflet/leaflet.css' %}" />
<link rel="stylesheet"
Expand Down
Loading

0 comments on commit 5ba1c28

Please sign in to comment.