Merge pull request #1154 from umap-project/djlint

Linting and prettifying templates with djLint for consistency
This commit is contained in:
David Larlet 2023-06-20 11:31:44 -04:00 committed by GitHub
commit 5ec7b3e49a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
28 changed files with 411 additions and 356 deletions

View file

@ -9,6 +9,14 @@ install: ## Install the dependencies
develop: ## Install the test and dev dependencies develop: ## Install the test and dev dependencies
python3 -m pip install -e .[test,dev] 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 .PHONY: version
version: ## Display the current version version: ## Display the current version
@hatch version @hatch version

View file

@ -47,6 +47,7 @@ dependencies = [
dev = [ dev = [
"hatch==1.7.0", "hatch==1.7.0",
"black==21.10b0", "black==21.10b0",
"djlint==1.31.0",
"mkdocs==1.2.3", "mkdocs==1.2.3",
] ]
test = [ test = [
@ -75,3 +76,8 @@ path = "umap/__init__.py"
[tool.flake8] [tool.flake8]
# Black crazyness. # Black crazyness.
max-line-length = 88 max-line-length = 88
[tool.djlint]
profile="django"
indent=2
format_css=true

View file

@ -1,12 +1,15 @@
{% extends "base.html" %} {% extends "base.html" %}
{% load i18n static %} {% load i18n static %}
{% block content %} {% block content %}
<div class="content404"> <div class="content404">
<a href="/" title="{% trans 'Take me to the home page' %}"> <a href="{% url "home" %}"
<h1>4<img src="{% static 'umap/img/logo.svg' %}">4</h1> title="{% trans "Take me to the home page" %}">
<h1>
4
<img alt="0" width="128px" height="128px" src="{% static "umap/img/logo.svg" %}">
4
</h1>
<h2>Not Found</h2> <h2>Not Found</h2>
</a> </a>
</div> </div>
{% endblock %} {% endblock content %}

View file

@ -1,8 +1,11 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html lang="en">
<head> <head>
<title>Ooops</title> <title>Ooops</title>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="description"
content="uMap lets you create maps with OpenStreetMap layers in a minute and embed them in your site.">
<meta name="keywords" content="map, umap">
<style type="text/css"> <style type="text/css">
#container { #container {
width: 400px; width: 400px;
@ -12,13 +15,14 @@
margin-top: 200px; margin-top: 200px;
} }
</style> </style>
</head> </head>
<body> <body>
<div id="container">
<div id="container"> <img alt=""
<img alt="" src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjwhLS0gQ3JlYXRlZCB3aXRoIElua3NjYXBlIChodHRwOi8vd3d3Lmlua3NjYXBlLm9yZy8pIC0tPgoKPHN2ZwogICB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iCiAgIHhtbG5zOmNjPSJodHRwOi8vY3JlYXRpdmVjb21tb25zLm9yZy9ucyMiCiAgIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyIKICAgeG1sbnM6c3ZnPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogICB4bWxuczpzb2RpcG9kaT0iaHR0cDovL3NvZGlwb2RpLnNvdXJjZWZvcmdlLm5ldC9EVEQvc29kaXBvZGktMC5kdGQiCiAgIHhtbG5zOmlua3NjYXBlPSJodHRwOi8vd3d3Lmlua3NjYXBlLm9yZy9uYW1lc3BhY2VzL2lua3NjYXBlIgogICB3aWR0aD0iMTI4IgogICBoZWlnaHQ9IjEyOCIKICAgaWQ9InN2ZzIiCiAgIHZlcnNpb249IjEuMSIKICAgaW5rc2NhcGU6dmVyc2lvbj0iMC40OC40IHI5OTM5IgogICBzb2RpcG9kaTpkb2NuYW1lPSJsb2dvLnN2ZyIKICAgaW5rc2NhcGU6ZXhwb3J0LWZpbGVuYW1lPSIvaG9tZS95Ym9uL0NvZGUvcHJvamVjdHMvdW1hc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XBvZGk6Y3g9IjcwIgogICAgICAgc29kaXBvZGk6Y3k9IjE4IgogICAgICAgc29kaXBvZGk6cng9IjE4IgogICAgICAgc29kaXBvZGk6cnk9IjE4IgogICAgICAgZD0iTSA4OCwxOCBDIDg4LDI3Ljk0MTEyNSA3OS45NDExMjUsMzYgNzAsMzYgNjAuMDU4ODc1LDM2IDUyLDI3Ljk0MTEyNSA1MiwxOCA1Miw4LjA1ODg3NDUgNjAuMDU4ODc1LDAgNzAsMCA3OS45NDExMjUsMCA4OCw4LjA1ODg3NDUgODgsMTggeiIKICAgICAgIHRyYW5zZm9ybT0ibWF0cml4KDEuMzE0MjY5NywwLDAsMS4zMTQyNjk3LC0yNy45OTg4NzgsOTM0LjUyODU1KSIgLz4KICA8L2c+Cjwvc3ZnPgo=" />
<h1>Oops, Server error…</h1>
</body> </div>
</body>
</html> </html>

View file

@ -1,20 +1,16 @@
{% extends "umap/content.html" %} {% extends "umap/content.html" %}
{% load i18n %} {% load i18n %}
{% block maincontent %} {% block maincontent %}
<div class="col wide"> <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>
<div class="wrapper"> <div class="wrapper">
<div class="map_list row"> <div class="map_list row">
{% if maps %} {% if maps %}
{% include "umap/map_list.html" %} {% include "umap/map_list.html" %}
{% else %} {% else %}
<div> <div>{% blocktrans %}{{ current_user }} has no maps.{% endblocktrans %}</div>
{% blocktrans %}{{ current_user }} has no maps.{% endblocktrans %}
</div>
{% endif %} {% endif %}
</div> </div>
</div> </div>
{% endblock maincontent %} {% endblock maincontent %}

View file

@ -1,20 +1,16 @@
{% extends "umap/content.html" %} {% extends "umap/content.html" %}
{% load i18n %} {% load i18n %}
{% block maincontent %} {% block maincontent %}
<div class="col wide"> <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>
<div class="wrapper"> <div class="wrapper">
<div class="map_list row"> <div class="map_list row">
{% if maps %} {% if maps %}
{% include "umap/map_list.html" %} {% include "umap/map_list.html" %}
{% else %} {% else %}
<div> <div>{% blocktrans %}{{ current_user }} has no starred maps yet.{% endblocktrans %}</div>
{% blocktrans %}{{ current_user }} has no starred maps yet.{% endblocktrans %}
</div>
{% endif %} {% endif %}
</div> </div>
</div> </div>
{% endblock maincontent %} {% endblock maincontent %}

View file

@ -1,26 +1,30 @@
{% load compress umap_tags i18n %} {% load compress umap_tags i18n %}
<!DOCTYPE html> <!DOCTYPE html>
<html{% if LANGUAGE_BIDI %} dir="rtl"{% endif %}> <html {% if LANGUAGE_BIDI %}dir="rtl"{% endif %}>
<head> <head>
<title>{% block head_title %}{{ SITE_NAME }}{% endblock %}</title> <title>
{% block head_title %}
{{ SITE_NAME }}
{% endblock head_title %}
</title>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="description"
content="{% trans "uMap lets you create maps with OpenStreetMap layers in a minute and embed them in your site." %}">
<meta name="keywords" content="map, umap">
{% block extra_head %} {% block extra_head %}
{% endblock extra_head %} {% endblock extra_head %}
<meta name="viewport"
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
</head> </head>
<body class="{% block body_class %}{% endblock %}"> <body class="{% block body_class %}{% endblock body_class %}">
{% block header %} {% block header %}
{% endblock header %} {% endblock header %}
{% block content %} {% block content %}
{% endblock content %} {% endblock content %}
{% block bottom_js %} {% block bottom_js %}
{% endblock bottom_js %} {% endblock bottom_js %}
{% block footer %} {% block footer %}
{% include "umap/footer.html" %} {% include "umap/footer.html" %}
{% endblock footer %} {% endblock footer %}
</body> </body>
</html> </html>

View file

@ -1,37 +1,37 @@
{% load i18n %} {% load i18n %}
{% if ENABLE_ACCOUNT_LOGIN %} {% if ENABLE_ACCOUNT_LOGIN %}
<h5>{% trans "Please log in with your account" %}</h5> <h5>{% trans "Please log in with your account" %}</h5>
<div>
<div>
{% if form.non_field_errors %} {% if form.non_field_errors %}
<ul class='form-errors'> <ul class="form-errors">
{% for error in form.non_field_errors %} {% for error in form.non_field_errors %}<li>{{ error }}</li>{% endfor %}
<li>{{ error }}</li>
{% endfor %}
</ul> </ul>
{% endif %} {% endif %}
<form id="login_form" action="{% url "login" %}" method="post">
<form id='login_form' action="{% url 'login' %}" method="POST">
{% csrf_token %} {% csrf_token %}
{{ form.username.errors }} {{ form.username.errors }}
<input type="text" name="username" placeholder="{% trans 'Username' %}" autofocus /> <input type="text"
name="username"
placeholder="{% trans "Username" %}"
autofocus />
{{ form.password.errors }} {{ form.password.errors }}
<input type="password" name="password" placeholder="{% trans 'Password' %}" /> <input type="password" name="password" placeholder="{% trans "Password" %}" />
<input type="submit" value="{% trans 'Login' %}" /> <input type="submit" value="{% trans "Login" %}" />
</form> </form>
</div> </div>
{% endif %} {% endif %}
{% if backends.backends|length %} {% if backends.backends|length %}
<h5>{% trans "Please choose a provider" %}</h5> <h5>{% trans "Please choose a provider" %}</h5>
<div> <div>
<ul class="login-grid block-grid"> <ul class="login-grid block-grid">
{% for name in backends.backends %} {% for name in backends.backends %}
<li> <li>
<a rel="nofollow" href="{% url "social:begin" name %}" class="umap-login-popup login-{{ name }}" title="{{ name|title }}"></a> <a rel="nofollow"
href="{% url "social:begin" name %}"
class="umap-login-popup login-{{ name }}"
title="{{ name|title }}"></a>
</li> </li>
{% endfor %} {% endfor %}
</ul> </ul>
</div> </div>
{% endif %} {% endif %}

View file

@ -1,5 +1,4 @@
{% extends "umap/content.html" %} {% extends "umap/content.html" %}
{% block maincontent %} {% block maincontent %}
{% include "umap/about_summary.html" %} {% include "umap/about_summary.html" %}
{% endblock maincontent %} {% endblock maincontent %}

View file

@ -2,11 +2,21 @@
<div class="wrapper about_summary highlights"> <div class="wrapper about_summary highlights">
<div class="row"> <div class="row">
<div class="col quarter mwide"> <div class="col quarter mwide">
<img class="colophon" src="{{ STATIC_URL }}umap/img/osm.svg" /> <img class="colophon"
<p>{% blocktrans with osm_url="http://osm.org" %}uMap lets you create maps with <a href="{{ osm_url }}" />OpenStreetMap</a> layers in a minute and embed them in your site.{% endblocktrans %}</p> src="{{ STATIC_URL }}umap/img/osm.svg"
alt=""
width="128px"
height="128px" />
<p>
{% blocktrans with osm_url="http://osm.org" %}uMap lets you create maps with <a href="{{ osm_url }}" />OpenStreetMap</a> layers in a minute and embed them in your site.{% endblocktrans %}
</p>
</div> </div>
<div class="col umap-features-list half mwide"> <div class="col umap-features-list half mwide">
<img class="colophon" src="{{ STATIC_URL }}umap/img/edit.svg" /> <img class="colophon"
src="{{ STATIC_URL }}umap/img/edit.svg"
alt=""
width="128px"
height="128px" />
<ul> <ul>
<li>{% trans "Choose the layers of your map" %}</li> <li>{% trans "Choose the layers of your map" %}</li>
<li>{% trans "Add POIs: markers, lines, polygons..." %}</li> <li>{% trans "Add POIs: markers, lines, polygons..." %}</li>
@ -18,7 +28,11 @@
</ul> </ul>
</div> </div>
<div class="col quarter mwide"> <div class="col quarter mwide">
<img class="colophon" src="{{ STATIC_URL }}umap/img/opensource.svg" /> <img class="colophon"
src="{{ STATIC_URL }}umap/img/opensource.svg"
alt=""
width="128px"
height="128px" />
<p class="note"> <p class="note">
{% blocktrans with repo_url="https://github.com/umap-project/umap" %}And it's <a href="{{ repo_url }}">open source</a>!{% endblocktrans %} {% blocktrans with repo_url="https://github.com/umap-project/umap" %}And it's <a href="{{ repo_url }}">open source</a>!{% endblocktrans %}
</p> </p>

View file

@ -1,23 +1,20 @@
{% extends "base.html" %} {% extends "base.html" %}
{% load umap_tags compress i18n %} {% load umap_tags compress i18n %}
{% block body_class %}
{% block body_class %}content{% endblock %} content
{% endblock body_class %}
{% block extra_head %} {% block extra_head %}
{% compress css %} {% compress css %}
{% umap_css %} {% umap_css %}
{% endcompress css %} {% endcompress css %}
{% umap_js %} {% umap_js %}
{% endblock %} {% endblock extra_head %}
{% block header %} {% block header %}
<header class="wrapper row"> <header class="wrapper row">
{% include 'umap/navigation.html' with title=SITE_NAME %} {% include "umap/navigation.html" with title=SITE_NAME %}
</header> </header>
{% include 'umap/messages.html' with title=SITE_NAME %} {% include "umap/messages.html" with title=SITE_NAME %}
{% endblock %} {% endblock header %}
{% block content %} {% block content %}
{% if UMAP_READONLY %} {% if UMAP_READONLY %}
<div class="wrapper demo-instance-warning"> <div class="wrapper demo-instance-warning">
@ -38,57 +35,58 @@
{% block maincontent %} {% block maincontent %}
{% endblock maincontent %} {% endblock maincontent %}
{% endblock content %} {% endblock content %}
{% block bottom_js %} {% block bottom_js %}
{{ block.super }} {{ block.super }}
<script type="text/javascript"> <script type="text/javascript">
!(function() { !(function () {
var ui = new L.U.UI(document.querySelector('header')); const ui = new L.U.UI(document.querySelector('header'))
var xhr = new L.U.Xhr(ui); const xhr = new L.U.Xhr(ui)
var login = document.querySelector('a.login'); const login = document.querySelector('a.login')
if (login) { if (login) {
L.DomEvent.on(login, 'click', function (e) { L.DomEvent.on(login, 'click', function (e) {
L.DomEvent.stop(e); L.DomEvent.stop(e)
xhr.login({ xhr.login({
"login_required": this.getAttribute('href'), login_required: this.getAttribute('href'),
"redirect": "/" redirect: '/',
}); })
}); })
} }
var logout = document.querySelector('a.logout'); const logout = document.querySelector('a.logout')
if (logout) { if (logout) {
L.DomEvent.on(logout, 'click', function (e) { L.DomEvent.on(logout, 'click', function (e) {
L.DomEvent.stop(e); L.DomEvent.stop(e)
xhr.logout(this.getAttribute('href')); xhr.logout(this.getAttribute('href'))
}); })
} }
var getMore = function (e) { const getMore = function (e) {
L.DomEvent.stop(e); L.DomEvent.stop(e)
xhr._ajax({ xhr._ajax({
uri: this.href, uri: this.href,
verb: 'GET', verb: 'GET',
callback: function (data) { callback: function (data) {
var container = this.parentNode; const container = this.parentNode
container.innerHTML = data; container.innerHTML = data
Array.prototype.forEach.call(container.querySelectorAll('script'), function (item) { Array.prototype.forEach.call(
eval(item.firstChild.textContent); container.querySelectorAll('script'),
}); function (item) {
var more = document.querySelector('.more_button'); eval(item.firstChild.textContent)
}
)
const more = document.querySelector('.more_button')
if (more) { if (more) {
L.DomEvent.on(more, 'click', getMore, more); L.DomEvent.on(more, 'click', getMore, more)
} }
}, },
context: this context: this,
}); })
};
var more = document.querySelector('.more_button');
if (more) {
L.DomEvent.on(more, 'click', getMore, more);
} }
})(this); const more = document.querySelector('.more_button')
if (more) {
L.DomEvent.on(more, 'click', getMore, more)
}
})(this)
</script> </script>
{% endblock bottom_js %} {% endblock bottom_js %}
{% block footer %} {% block footer %}
{{ block.super }} {{ block.super }}
{% include "umap/content_footer.html" %} {% include "umap/content_footer.html" %}

View file

@ -1,5 +1,4 @@
{% load i18n %} {% load i18n %}
<footer> <footer>
<a href="https://wiki.openstreetmap.org/wiki/UMap" class="branding">uMap</a> <a href="https://wiki.openstreetmap.org/wiki/UMap" class="branding">uMap</a>
an OpenStreetMap project an OpenStreetMap project

View file

@ -1,13 +1,23 @@
<link rel="stylesheet" href="{{ STATIC_URL }}umap/vendors/leaflet/leaflet.css" /> <link rel="stylesheet"
<link rel="stylesheet" href="{{ STATIC_URL }}umap/vendors/markercluster/MarkerCluster.css" /> href="{{ STATIC_URL }}umap/vendors/leaflet/leaflet.css" />
<link rel="stylesheet" href="{{ STATIC_URL }}umap/vendors/markercluster/MarkerCluster.Default.css" /> <link rel="stylesheet"
<link rel="stylesheet" href="{{ STATIC_URL }}umap/vendors/editinosm/Leaflet.EditInOSM.css" /> href="{{ STATIC_URL }}umap/vendors/markercluster/MarkerCluster.css" />
<link rel="stylesheet" href="{{ STATIC_URL }}umap/vendors/minimap/Control.MiniMap.css" /> <link rel="stylesheet"
<link rel="stylesheet" href="{{ STATIC_URL }}umap/vendors/contextmenu/leaflet.contextmenu.css" /> href="{{ STATIC_URL }}umap/vendors/markercluster/MarkerCluster.Default.css" />
<link rel="stylesheet" href="{{ STATIC_URL }}umap/vendors/toolbar/leaflet.toolbar.css" /> <link rel="stylesheet"
<link rel="stylesheet" href="{{ STATIC_URL }}umap/vendors/measurable/Leaflet.Measurable.css" /> href="{{ STATIC_URL }}umap/vendors/editinosm/Leaflet.EditInOSM.css" />
<link rel="stylesheet" href="{{ STATIC_URL }}umap/vendors/fullscreen/leaflet.fullscreen.css" /> <link rel="stylesheet"
<link rel="stylesheet" href="{{ STATIC_URL }}umap/vendors/locatecontrol/L.Control.Locate.css" /> href="{{ STATIC_URL }}umap/vendors/minimap/Control.MiniMap.css" />
<link rel="stylesheet"
href="{{ STATIC_URL }}umap/vendors/contextmenu/leaflet.contextmenu.css" />
<link rel="stylesheet"
href="{{ STATIC_URL }}umap/vendors/toolbar/leaflet.toolbar.css" />
<link rel="stylesheet"
href="{{ STATIC_URL }}umap/vendors/measurable/Leaflet.Measurable.css" />
<link rel="stylesheet"
href="{{ STATIC_URL }}umap/vendors/fullscreen/leaflet.fullscreen.css" />
<link rel="stylesheet"
href="{{ STATIC_URL }}umap/vendors/locatecontrol/L.Control.Locate.css" />
<link rel="stylesheet" href="{{ STATIC_URL }}umap/font.css"> <link rel="stylesheet" href="{{ STATIC_URL }}umap/font.css">
<link rel="stylesheet" href="{{ STATIC_URL }}umap/base.css"> <link rel="stylesheet" href="{{ STATIC_URL }}umap/base.css">
<link rel="stylesheet" href="{{ STATIC_URL }}umap/content.css"> <link rel="stylesheet" href="{{ STATIC_URL }}umap/content.css">

View file

@ -1,23 +1,16 @@
{% extends "umap/content.html" %} {% extends "umap/content.html" %}
{% load umap_tags i18n %} {% load umap_tags i18n %}
{% block maincontent %} {% block maincontent %}
{% include "umap/search_bar.html" %} {% include "umap/search_bar.html" %}
{% include "umap/about_summary.html" %} {% include "umap/about_summary.html" %}
{% if showcase_map %} {% if showcase_map %}
<div class="wrapper showcase-map"> <div class="wrapper showcase-map">
<h2 class="section">{% blocktrans %}Map of the uMaps{% endblocktrans %}</h2> <h2 class="section">{% blocktrans %}Map of the uMaps{% endblocktrans %}</h2>
<div class="row"> <div class="row">{% map_fragment showcase_map zoomControl=1 %}</div>
{% map_fragment showcase_map zoomControl=1 %}
</div> </div>
</div> {% endif %}
{% endif %} <div class="wrapper">
<div class="wrapper">
<h2 class="section">{% blocktrans %}Get inspired, browse maps{% endblocktrans %}</h2> <h2 class="section">{% blocktrans %}Get inspired, browse maps{% endblocktrans %}</h2>
<div class="map_list row"> <div class="map_list row">{% include "umap/map_list.html" %}</div>
{% include "umap/map_list.html" %}
</div> </div>
</div>
{% endblock maincontent %} {% endblock maincontent %}

View file

@ -25,9 +25,7 @@
<script src="{{ STATIC_URL }}umap/vendors/locatecontrol/L.Control.Locate.js"></script> <script src="{{ STATIC_URL }}umap/vendors/locatecontrol/L.Control.Locate.js"></script>
<script src="{{ STATIC_URL }}umap/vendors/dompurify/purify.js"></script> <script src="{{ STATIC_URL }}umap/vendors/dompurify/purify.js"></script>
{% endcompress %} {% endcompress %}
{% if locale %} {% if locale %}<script src="{{ STATIC_URL }}umap/locale/{{ locale }}.js"></script>{% endif %}
<script src="{{ STATIC_URL }}umap/locale/{{ locale }}.js"></script>
{% endif %}
{% compress js %} {% compress js %}
<script src="{{ STATIC_URL }}umap/js/umap.core.js"></script> <script src="{{ STATIC_URL }}umap/js/umap.core.js"></script>
<script src="{{ STATIC_URL }}umap/js/umap.autocomplete.js"></script> <script src="{{ STATIC_URL }}umap/js/umap.autocomplete.js"></script>

View file

@ -1,20 +1,16 @@
{% load i18n %} {% load i18n %}
<h3>{% trans "You are logged in. Continuing..." %}</h3> <h3>{% trans "You are logged in. Continuing..." %}</h3>
<script type="text/javascript"> <script type="text/javascript">
function proceed() {
function proceed()
{
if (window.opener && window.opener.umap_proceed) { if (window.opener && window.opener.umap_proceed) {
window.opener.umap_proceed(); window.opener.umap_proceed()
} else { } else {
// Trade off as Twitter does not allow us to access window.opener // Trade off as Twitter does not allow us to access window.opener
window.location.href = '{{ request.user.get_url }}' window.location.href = '{{ request.user.get_url }}'
} }
} }
proceed(); proceed()
// To handle errors, this template should be integrated into your authentication error message page // To handle errors, this template should be integrated into your authentication error message page
// Note that you can call any window.opener function like window.opener.func // Note that you can call any window.opener function like window.opener.func

View file

@ -1,21 +1,21 @@
{% extends "base.html" %} {% extends "base.html" %}
{% load umap_tags compress i18n %} {% load umap_tags compress i18n %}
{% block head_title %}{{ map.name }} - {{ SITE_NAME }}{% endblock %} {% block head_title %}
{% block body_class %}map_detail{% endblock %} {{ map.name }} - {{ SITE_NAME }}
{% endblock head_title %}
{% block body_class %}
map_detail
{% endblock body_class %}
{% block extra_head %} {% block extra_head %}
{% compress css %} {% compress css %}
{% umap_css %} {% umap_css %}
{% endcompress %} {% endcompress %}
{% umap_js locale=locale %} {% umap_js locale=locale %}
{% if object.share_status != object.PUBLIC %} {% if object.share_status != object.PUBLIC %}<meta name="robots" content="noindex">{% endif %}
<meta name="robots" content="noindex"> {% endblock extra_head %}
{% endif %}
{% endblock %}
{% block content %} {% block content %}
{% block map_init %} {% block map_init %}
{% include "umap/map_init.html" %} {% include "umap/map_init.html" %}
{% endblock %} {% endblock map_init %}
{% include "umap/map_messages.html" %} {% include "umap/map_messages.html" %}
{% endblock %} {% endblock content %}

View file

@ -1,5 +1,7 @@
{% load umap_tags %} {% load umap_tags %}
<div id="{{ unique_id }}" class="map_fragment"></div> <div id="{{ unique_id }}" class="map_fragment"></div>
<script type="text/javascript"> <!-- djlint:off -->
new L.U.Map("{{ unique_id }}", {{ map_settings|notag|safe }}); <script type="text/javascript">
</script> new L.U.Map("{{ unique_id }}", {{ map_settings|notag|safe }})
</script>
<!-- djlint:on -->

View file

@ -1,5 +1,7 @@
{% load umap_tags %} {% load umap_tags %}
<div id="map"></div> <div id="map"></div>
<script type="text/javascript"> <!-- djlint:off -->
var MAP = new L.U.Map("map", {{ map_settings|notag|safe }}); <script type="text/javascript">
</script> let MAP = new L.U.Map("map", {{ map_settings|notag|safe }})
</script>
<!-- djlint:on -->

View file

@ -1,12 +1,19 @@
{% load umap_tags umap_tags i18n %} {% load umap_tags umap_tags i18n %}
{% for map_inst in maps %} {% for map_inst in maps %}
<hr /> <hr />
<div class="col wide"> <div class="col wide">
{% map_fragment map_inst prefix=prefix page=request.GET.p %} {% map_fragment map_inst prefix=prefix page=request.GET.p %}
<div class="legend"><a href="{{ map_inst.get_absolute_url }}">{{ map_inst.name }}</a>{% if map_inst.owner %} <em>{% trans "by" %} <a href="{{ map_inst.owner.get_url }}">{{ map_inst.owner }}</a></em>{% endif %}</div> <div class="legend">
</div> <a href="{{ map_inst.get_absolute_url }}">{{ map_inst.name }}</a>
{% if map_inst.owner %}
<em>{% trans "by" %} <a href="{{ map_inst.owner.get_url }}">{{ map_inst.owner }}</a></em>
{% endif %}
</div>
</div>
{% endfor %} {% endfor %}
{% if maps.has_next %} {% if maps.has_next %}
<div class="col wide"><a href="?{% paginate_querystring maps.next_page_number %}" class="button more_button neutral">{% trans "More" %}</a></div> <div class="col wide">
<a href="?{% paginate_querystring maps.next_page_number %}"
class="button more_button neutral">{% trans "More" %}</a>
</div>
{% endif %} {% endif %}

View file

@ -5,6 +5,6 @@
content: "{{ m }}", content: "{{ m }}",
level: "{{ m.tags }}", level: "{{ m.tags }}",
duration: 100000 duration: 100000
}); })
{% endfor %} {% endfor %}
</script> </script>

View file

@ -3,7 +3,7 @@
{% if messages %} {% if messages %}
<ul class="messages"> <ul class="messages">
{% for message in messages %} {% for message in messages %}
<li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li> <li {% if message.tags %}class="{{ message.tags }}"{% endif %}>{{ message }}</li>
{% endfor %} {% endfor %}
</ul> </ul>
{% endif %} {% endif %}

View file

@ -1,31 +1,45 @@
{% load i18n %} {% load i18n %}
<nav class="umap-nav"> <nav class="umap-nav">
<section> <section>
<h1><a href="/">{{ title }}</a></h1> <h1>
<a href="{% url "home" %}">{{ title }}</a>
</h1>
</section> </section>
<section> <section>
<ul> <ul>
{% if user.is_authenticated %} {% if user.is_authenticated %}
<li><a href="{{ user.get_url }}">{% trans "My maps" %} ({{ user }})</a></li> <li>
<li><a href="{{ user.get_stars_url }}">{% trans "Starred maps" %}</a></li> <a href="{{ user.get_url }}">{% trans "My maps" %} ({{ user }})</a>
</li>
<li>
<a href="{{ user.get_stars_url }}">{% trans "Starred maps" %}</a>
</li>
{% else %} {% else %}
<li><a href="{% url 'login' %}" class="login">{% trans "Log in" %} / {% trans "Sign in" %}</a></li> <li>
<a href="{% url "login" %}" class="login">{% trans "Log in" %} / {% trans "Sign in" %}</a>
</li>
{% endif %} {% endif %}
<li><a href="{% url 'about' %}">{% trans "About" %}</a></li> <li>
<li><a href="{{ UMAP_FEEDBACK_LINK }}">{% trans "Help" %}</a></li> <a href="{% url "about" %}">{% trans "About" %}</a>
</li>
<li>
<a href="{{ UMAP_FEEDBACK_LINK }}">{% trans "Help" %}</a>
</li>
{% if user.is_authenticated %} {% if user.is_authenticated %}
{% if user.has_usable_password %} {% if user.has_usable_password %}
<li><a href="{% url 'password_change' %}" >{% trans "Change password" %}</a></li> <li>
<a href="{% url "password_change" %}">{% trans "Change password" %}</a>
</li>
{% endif %} {% endif %}
<li><a href="{% url 'logout' %}" class="logout">{% trans "Log out" %}</a></li> <li>
<a href="{% url "logout" %}" class="logout">{% trans "Log out" %}</a>
</li>
{% endif %} {% endif %}
</ul> </ul>
</section> </section>
<section> <section>
{% if not UMAP_READONLY %} {% if not UMAP_READONLY %}
<a href="{% url 'map_new' %}" class="button">{% trans "Create a map" %}</a> <a href="{% url "map_new" %}" class="button">{% trans "Create a map" %}</a>
{% endif %} {% endif %}
</section> </section>
</nav> </nav>

View file

@ -1,20 +1,25 @@
{% extends "umap/content.html" %} {% extends "umap/content.html" %}
{% load i18n %} {% load i18n %}
{% block content %} {% block content %}
<h2 class="section">{% trans "Password change" %}</h2> <h2 class="section">{% trans "Password change" %}</h2>
<p>{% 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." %}</p> <p>
{% 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." %}
<form action="{% url 'password_change' %}" method="POST"> </p>
<form action="{% url "password_change" %}" method="get">
{% csrf_token %} {% csrf_token %}
{{ form.old_password.errors }} {{ form.old_password.errors }}
<input type='password' name='old_password' placeholder='{% trans "Old password" %}' autofocus /> <input type="password"
name="old_password"
placeholder="{% trans "Old password" %}"
autofocus />
{{ form.new_password1.errors }} {{ form.new_password1.errors }}
<input type='password' name='new_password1' placeholder='{% trans "New password" %}' /> <input type="password"
name="new_password1"
placeholder="{% trans "New password" %}" />
{{ form.new_password2.errors }} {{ form.new_password2.errors }}
<input type='password' name='new_password2' placeholder='{% trans "New password confirmation" %}' /> <input type="password"
name="new_password2"
<input type='submit' value='{% trans "Change my password" %}' /> placeholder="{% trans "New password confirmation" %}" />
<input type="submit" value="{% trans "Change my password" %}" />
</form> </form>
{% endblock content %} {% endblock content %}

View file

@ -1,9 +1,9 @@
{% extends "umap/content.html" %} {% extends "umap/content.html" %}
{% load i18n %} {% load i18n %}
{% block content %} {% block content %}
<h2 class="section">{% trans "Password change successful" %}</h2> <h2 class="section">{% trans "Password change successful" %}</h2>
<p>{% trans "Your password was changed." %}</p> <p>{% trans "Your password was changed." %}</p>
<p><a href="{% url 'home' %}">Home</a></p> <p>
<a href="{% url 'home' %}">Home</a>
</p>
{% endblock content %} {% endblock content %}

View file

@ -1,10 +1,8 @@
{% extends "umap/content.html" %} {% extends "umap/content.html" %}
{% load i18n %} {% load i18n %}
{% block maincontent %} {% block maincontent %}
{% include "umap/search_bar.html" %} {% include "umap/search_bar.html" %}
{% if q %} {% if q %}
<div class="wrapper"> <div class="wrapper">
<div class="map_list row"> <div class="map_list row">
{% if maps %} {% if maps %}
@ -15,11 +13,11 @@
{{ count }} maps found: {{ count }} maps found:
{% endblocktranslate %} {% endblocktranslate %}
</h2> </h2>
{% include "umap/map_list.html" with prefix='search_map' %} {% include "umap/map_list.html" with prefix="search_map" %}
{% else %} {% else %}
<h2>{% trans "No map found." %}</h2> <h2>{% trans "No map found." %}</h2>
{% endif %} {% endif %}
</div> </div>
</div> </div>
{% endif %} {% endif %}
{% endblock maincontent %} {% endblock maincontent %}

View file

@ -1,12 +1,15 @@
{% load i18n %} {% load i18n %}
<div class="wrapper search_wrapper"> <div class="wrapper search_wrapper">
<div class="row"> <div class="row">
<form action="{% url 'search' %}" method="GET"> <form action="{% url "search" %}" method="get">
<div class="col two-third mwide"> <div class="col two-third mwide">
<input name="q" type="search" placeholder="{% trans 'Search maps' %}" value="{{ q|default:"" }}" /> <input name="q"
type="search"
placeholder="{% trans "Search maps" %}"
value="{{ q|default:"" }}" />
</div> </div>
<div class="col third mwide"> <div class="col third mwide">
<input type="submit" value="{% trans 'Search' %}" class="neutral" /> <input type="submit" value="{% trans "Search" %}" class="neutral" />
</div> </div>
</form> </form>
</div> </div>