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
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

View file

@ -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

View file

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

View file

@ -1,8 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<html lang="en">
<head>
<title>Ooops</title>
<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">
#container {
width: 400px;
@ -12,13 +15,14 @@
margin-top: 200px;
}
</style>
</head>
<body>
<div id="container">
<img alt="" src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWx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TM0LjUyODU1KSIgLz4KICA8L2c+Cjwvc3ZnPgo=" />
<p>Oops, Server error…</p>
</div>
</body>
</head>
<body>
<div id="container">
<img alt=""
width="128px"
height="128px"
src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjwhLS0gQ3JlYXRlZCB3aXRoIElua3NjYXBlIChodHRwOi8vd3d3Lmlua3NjYXBlLm9yZy8pIC0tPgoKPHN2ZwogICB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iCiAgIHhtbG5zOmNjPSJodHRwOi8vY3JlYXRpdmVjb21tb25zLm9yZy9ucyMiCiAgIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyIKICAgeG1sbnM6c3ZnPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogICB4bWxuczpzb2RpcG9kaT0iaHR0cDovL3NvZGlwb2RpLnNvdXJjZWZvcmdlLm5ldC9EVEQvc29kaXBvZGktMC5kdGQiCiAgIHhtbG5zOmlua3NjYXBlPSJodHRwOi8vd3d3Lmlua3NjYXBlLm9yZy9uYW1lc3BhY2VzL2lua3NjYXBlIgogICB3aWR0aD0iMTI4IgogICBoZWlnaHQ9IjEyOCIKICAgaWQ9InN2ZzIiCiAgIHZlcnNpb249IjEuMSIKICAgaW5rc2NhcGU6dmVyc2lvbj0iMC40OC40IHI5OTM5IgogICBzb2RpcG9kaTpkb2NuYW1lPSJsb2dvLnN2ZyIKICAgaW5rc2NhcGU6ZXhwb3J0LWZpbGVuYW1lPSIvaG9tZS95Ym9uL0NvZGUvcHJvamVjdHMvdW1hcC91bWFwL3N0YXRpYy91bWFwL2ltZy9sb2dvX2ZpbGlncmVlLnBuZyIKICA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TEyNSA1MiwxOCA1Miw4LjA1ODg3NDUgNjAuMDU4ODc1LDAgNzAsMCA3OS45NDExMjUsMCA4OCw4LjA1ODg3NDUgODgsMTggeiIKICAgICAgIHRyYW5zZm9ybT0ibWF0cml4KDEuMzE0MjY5NywwLDAsMS4zMTQyNjk3LC0yNy45OTg4NzgsOTM0LjUyODU1KSIgLz4KICA8L2c+Cjwvc3ZnPgo=" />
<h1>Oops, Server error…</h1>
</div>
</body>
</html>

View file

@ -1,20 +1,16 @@
{% extends "umap/content.html" %}
{% load i18n %}
{% block maincontent %}
<div class="col wide">
<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 class="col wide">
<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>
{% endif %}
</div>
{% endif %}
</div>
</div>
</div>
{% endblock maincontent %}

View file

@ -1,20 +1,16 @@
{% extends "umap/content.html" %}
{% load i18n %}
{% block maincontent %}
<div class="col wide">
<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 class="col wide">
<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>
{% endif %}
</div>
{% endif %}
</div>
</div>
</div>
{% endblock maincontent %}

View file

@ -1,26 +1,30 @@
{% load compress umap_tags i18n %}
<!DOCTYPE html>
<html{% if LANGUAGE_BIDI %} dir="rtl"{% endif %}>
<head>
<title>{% block head_title %}{{ SITE_NAME }}{% endblock %}</title>
<html {% if LANGUAGE_BIDI %}dir="rtl"{% endif %}>
<head>
<title>
{% block head_title %}
{{ SITE_NAME }}
{% endblock head_title %}
</title>
<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 %}
{% endblock extra_head %}
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
</head>
<body class="{% block body_class %}{% endblock %}">
<meta name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
</head>
<body class="{% block body_class %}{% endblock body_class %}">
{% block header %}
{% endblock header %}
{% block content %}
{% endblock content %}
{% block bottom_js %}
{% endblock bottom_js %}
{% block footer %}
{% include "umap/footer.html" %}
{% include "umap/footer.html" %}
{% endblock footer %}
</body>
</body>
</html>

View file

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

View file

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

View file

@ -2,11 +2,21 @@
<div class="wrapper about_summary highlights">
<div class="row">
<div class="col quarter mwide">
<img class="colophon" src="{{ STATIC_URL }}umap/img/osm.svg" />
<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>
<img class="colophon"
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 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>
<li>{% trans "Choose the layers of your map" %}</li>
<li>{% trans "Add POIs: markers, lines, polygons..." %}</li>
@ -18,7 +28,11 @@
</ul>
</div>
<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">
{% blocktrans with repo_url="https://github.com/umap-project/umap" %}And it's <a href="{{ repo_url }}">open source</a>!{% endblocktrans %}
</p>
@ -28,16 +42,16 @@
<div class="wrapper">
<div class="row">
<div class="col half center mwide">
{% spaceless %}
<div class="button-bar {% if demo_map %}half{% endif %}">
{% if not UMAP_READONLY %}
<a href="{% url 'map_new' %}" class="button half">{% trans "Create a map" %}</a>
{% endif %}
{% if demo_map %}
<a href="{{ demo_map.get_absolute_url }}" class="button half neutral">{% trans "Play with the demo" %}</a>
{% endif %}
</div>
{% endspaceless %}
{% spaceless %}
<div class="button-bar {% if demo_map %}half{% endif %}">
{% if not UMAP_READONLY %}
<a href="{% url 'map_new' %}" class="button half">{% trans "Create a map" %}</a>
{% endif %}
{% if demo_map %}
<a href="{{ demo_map.get_absolute_url }}" class="button half neutral">{% trans "Play with the demo" %}</a>
{% endif %}
</div>
{% endspaceless %}
</div>
</div>
</div>

View file

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

View file

@ -1,19 +1,18 @@
{% load i18n %}
{% load i18n %}
<footer>
<a href="https://wiki.openstreetmap.org/wiki/UMap" class="branding">uMap</a>
an OpenStreetMap project
(version <a href="https://umap-project.readthedocs.io/en/latest/changelog/">{{ UMAP_VERSION }}</a>)
{% get_language_info_list for LANGUAGES as languages %}
<form action="{% url "set_language" %}" method="post" class="i18n_switch">
{% csrf_token %}
<select name="language" onchange="this.form.submit()">
{% for language in languages %}
<a href="https://wiki.openstreetmap.org/wiki/UMap" class="branding">uMap</a>
an OpenStreetMap project
(version <a href="https://umap-project.readthedocs.io/en/latest/changelog/">{{ UMAP_VERSION }}</a>)
{% get_language_info_list for LANGUAGES as languages %}
<form action="{% url "set_language" %}" method="post" class="i18n_switch">
{% csrf_token %}
<select name="language" onchange="this.form.submit()">
{% for language in languages %}
<option value="{{ language.code }}"
{% if language.code == LANGUAGE_CODE %}selected="selected"{% endif %}>
{{ language.name_local }}
{% if language.code == LANGUAGE_CODE %}selected="selected"{% endif %}>
{{ language.name_local }}
</option>
{% endfor %}
</select>
</form>
{% endfor %}
</select>
</form>
</footer>

View file

@ -1,13 +1,23 @@
<link rel="stylesheet" href="{{ STATIC_URL }}umap/vendors/leaflet/leaflet.css" />
<link rel="stylesheet" href="{{ STATIC_URL }}umap/vendors/markercluster/MarkerCluster.css" />
<link rel="stylesheet" href="{{ STATIC_URL }}umap/vendors/markercluster/MarkerCluster.Default.css" />
<link rel="stylesheet" href="{{ STATIC_URL }}umap/vendors/editinosm/Leaflet.EditInOSM.css" />
<link rel="stylesheet" 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/vendors/leaflet/leaflet.css" />
<link rel="stylesheet"
href="{{ STATIC_URL }}umap/vendors/markercluster/MarkerCluster.css" />
<link rel="stylesheet"
href="{{ STATIC_URL }}umap/vendors/markercluster/MarkerCluster.Default.css" />
<link rel="stylesheet"
href="{{ STATIC_URL }}umap/vendors/editinosm/Leaflet.EditInOSM.css" />
<link rel="stylesheet"
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/base.css">
<link rel="stylesheet" href="{{ STATIC_URL }}umap/content.css">

View file

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

View file

@ -1,46 +1,44 @@
{% load compress %}
{% compress js %}
<script src="{{ STATIC_URL }}umap/vendors/leaflet/leaflet-src.js"></script>
<script src="{{ STATIC_URL }}umap/vendors/editable/Path.Drag.js"></script>
<script src="{{ STATIC_URL }}umap/vendors/editable/Leaflet.Editable.js"></script>
<script src="{{ STATIC_URL }}umap/vendors/hash/leaflet-hash.js"></script>
<script src="{{ STATIC_URL }}umap/vendors/i18n/Leaflet.i18n.js"></script>
<script src="{{ STATIC_URL }}umap/vendors/editinosm/Leaflet.EditInOSM.js"></script>
<script src="{{ STATIC_URL }}umap/vendors/minimap/Control.MiniMap.js"></script>
<script src="{{ STATIC_URL }}umap/vendors/csv2geojson/csv2geojson.js"></script>
<script src="{{ STATIC_URL }}umap/vendors/togeojson/togeojson.js"></script>
<script src="{{ STATIC_URL }}umap/vendors/osmtogeojson/osmtogeojson.js"></script>
<script src="{{ STATIC_URL }}umap/vendors/loading/Control.Loading.js"></script>
<script src="{{ STATIC_URL }}umap/vendors/markercluster/leaflet.markercluster-src.js"></script>
<script src="{{ STATIC_URL }}umap/vendors/contextmenu/leaflet.contextmenu.js"></script>
<script src="{{ STATIC_URL }}umap/vendors/photon/leaflet.photon.js"></script>
<script src="{{ STATIC_URL }}umap/vendors/georsstogeojson/GeoRSSToGeoJSON.js"></script>
<script src="{{ STATIC_URL }}umap/vendors/heat/leaflet-heat.js"></script>
<script src="{{ STATIC_URL }}umap/vendors/fullscreen/Leaflet.fullscreen.js"></script>
<script src="{{ STATIC_URL }}umap/vendors/toolbar/leaflet.toolbar-src.js"></script>
<script src="{{ STATIC_URL }}umap/vendors/formbuilder/Leaflet.FormBuilder.js"></script>
<script src="{{ STATIC_URL }}umap/vendors/measurable/Leaflet.Measurable.js"></script>
<script src="{{ STATIC_URL }}umap/vendors/togpx/togpx.js"></script>
<script src="{{ STATIC_URL }}umap/vendors/tokml/tokml.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/leaflet/leaflet-src.js"></script>
<script src="{{ STATIC_URL }}umap/vendors/editable/Path.Drag.js"></script>
<script src="{{ STATIC_URL }}umap/vendors/editable/Leaflet.Editable.js"></script>
<script src="{{ STATIC_URL }}umap/vendors/hash/leaflet-hash.js"></script>
<script src="{{ STATIC_URL }}umap/vendors/i18n/Leaflet.i18n.js"></script>
<script src="{{ STATIC_URL }}umap/vendors/editinosm/Leaflet.EditInOSM.js"></script>
<script src="{{ STATIC_URL }}umap/vendors/minimap/Control.MiniMap.js"></script>
<script src="{{ STATIC_URL }}umap/vendors/csv2geojson/csv2geojson.js"></script>
<script src="{{ STATIC_URL }}umap/vendors/togeojson/togeojson.js"></script>
<script src="{{ STATIC_URL }}umap/vendors/osmtogeojson/osmtogeojson.js"></script>
<script src="{{ STATIC_URL }}umap/vendors/loading/Control.Loading.js"></script>
<script src="{{ STATIC_URL }}umap/vendors/markercluster/leaflet.markercluster-src.js"></script>
<script src="{{ STATIC_URL }}umap/vendors/contextmenu/leaflet.contextmenu.js"></script>
<script src="{{ STATIC_URL }}umap/vendors/photon/leaflet.photon.js"></script>
<script src="{{ STATIC_URL }}umap/vendors/georsstogeojson/GeoRSSToGeoJSON.js"></script>
<script src="{{ STATIC_URL }}umap/vendors/heat/leaflet-heat.js"></script>
<script src="{{ STATIC_URL }}umap/vendors/fullscreen/Leaflet.fullscreen.js"></script>
<script src="{{ STATIC_URL }}umap/vendors/toolbar/leaflet.toolbar-src.js"></script>
<script src="{{ STATIC_URL }}umap/vendors/formbuilder/Leaflet.FormBuilder.js"></script>
<script src="{{ STATIC_URL }}umap/vendors/measurable/Leaflet.Measurable.js"></script>
<script src="{{ STATIC_URL }}umap/vendors/togpx/togpx.js"></script>
<script src="{{ STATIC_URL }}umap/vendors/tokml/tokml.js"></script>
<script src="{{ STATIC_URL }}umap/vendors/locatecontrol/L.Control.Locate.js"></script>
<script src="{{ STATIC_URL }}umap/vendors/dompurify/purify.js"></script>
{% endcompress %}
{% if locale %}
<script src="{{ STATIC_URL }}umap/locale/{{ locale }}.js"></script>
{% endif %}
{% if locale %}<script src="{{ STATIC_URL }}umap/locale/{{ locale }}.js"></script>{% endif %}
{% compress js %}
<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.popup.js"></script>
<script src="{{ STATIC_URL }}umap/js/umap.xhr.js"></script>
<script src="{{ STATIC_URL }}umap/js/umap.forms.js"></script>
<script src="{{ STATIC_URL }}umap/js/umap.icon.js"></script>
<script src="{{ STATIC_URL }}umap/js/umap.features.js"></script>
<script src="{{ STATIC_URL }}umap/js/umap.layer.js"></script>
<script src="{{ STATIC_URL }}umap/js/umap.controls.js"></script>
<script src="{{ STATIC_URL }}umap/js/umap.slideshow.js"></script>
<script src="{{ STATIC_URL }}umap/js/umap.tableeditor.js"></script>
<script src="{{ STATIC_URL }}umap/js/umap.permissions.js"></script>
<script src="{{ STATIC_URL }}umap/js/umap.js"></script>
<script src="{{ STATIC_URL }}umap/js/umap.ui.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.popup.js"></script>
<script src="{{ STATIC_URL }}umap/js/umap.xhr.js"></script>
<script src="{{ STATIC_URL }}umap/js/umap.forms.js"></script>
<script src="{{ STATIC_URL }}umap/js/umap.icon.js"></script>
<script src="{{ STATIC_URL }}umap/js/umap.features.js"></script>
<script src="{{ STATIC_URL }}umap/js/umap.layer.js"></script>
<script src="{{ STATIC_URL }}umap/js/umap.controls.js"></script>
<script src="{{ STATIC_URL }}umap/js/umap.slideshow.js"></script>
<script src="{{ STATIC_URL }}umap/js/umap.tableeditor.js"></script>
<script src="{{ STATIC_URL }}umap/js/umap.permissions.js"></script>
<script src="{{ STATIC_URL }}umap/js/umap.js"></script>
<script src="{{ STATIC_URL }}umap/js/umap.ui.js"></script>
{% endcompress %}

View file

@ -1,20 +1,16 @@
{% load i18n %}
<h3>{% trans "You are logged in. Continuing..." %}</h3>
<script type="text/javascript">
function proceed()
{
if (window.opener && window.opener.umap_proceed) {
window.opener.umap_proceed();
} else {
// Trade off as Twitter does not allow us to access window.opener
window.location.href = '{{ request.user.get_url }}'
}
function proceed() {
if (window.opener && window.opener.umap_proceed) {
window.opener.umap_proceed()
} else {
// Trade off as Twitter does not allow us to access window.opener
window.location.href = '{{ request.user.get_url }}'
}
}
proceed();
proceed()
// 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

View file

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

View file

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

View file

@ -1,5 +1,7 @@
{% load umap_tags %}
<div id="map"></div>
<script type="text/javascript">
var MAP = new L.U.Map("map", {{ map_settings|notag|safe }});
</script>
<div id="map"></div>
<!-- djlint:off -->
<script type="text/javascript">
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 %}
{% for map_inst in maps %}
<hr />
<div class="col wide">
<hr />
<div class="col wide">
{% 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>
<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>
{% endfor %}
{% 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 %}

View file

@ -1,10 +1,10 @@
<script type="text/javascript">
{% for m in messages %}
{# We have just one, but we need to loop, as for messages API #}
L.U.fire('ui:alert', {
content: "{{ m }}",
level: "{{ m.tags }}",
duration: 100000
});
{% endfor %}
{% for m in messages %}
{# We have just one, but we need to loop, as for messages API #}
L.U.fire('ui:alert', {
content: "{{ m }}",
level: "{{ m.tags }}",
duration: 100000
})
{% endfor %}
</script>

View file

@ -1,11 +1,11 @@
<div class="wrapper">
<div class="row">
{% if messages %}
<ul class="messages">
{% for message in messages %}
<li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
{% endfor %}
</ul>
{% endif %}
</div>
<div class="row">
{% if messages %}
<ul class="messages">
{% for message in messages %}
<li {% if message.tags %}class="{{ message.tags }}"{% endif %}>{{ message }}</li>
{% endfor %}
</ul>
{% endif %}
</div>
</div>

View file

@ -1,31 +1,45 @@
{% load i18n %}
<nav class="umap-nav">
<section>
<h1><a href="/">{{ title }}</a></h1>
<h1>
<a href="{% url "home" %}">{{ title }}</a>
</h1>
</section>
<section>
<ul>
{% if user.is_authenticated %}
<li><a href="{{ user.get_url }}">{% trans "My maps" %} ({{ user }})</a></li>
<li><a href="{{ user.get_stars_url }}">{% trans "Starred maps" %}</a></li>
<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 %}
<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 %}
<li><a href="{% url 'about' %}">{% trans "About" %}</a></li>
<li><a href="{{ UMAP_FEEDBACK_LINK }}">{% trans "Help" %}</a></li>
<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.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 %}
<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 %}
</ul>
</section>
<section>
{% 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 %}
</section>
</nav>

View file

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

View file

@ -1,9 +1,9 @@
{% extends "umap/content.html" %}
{% load i18n %}
{% block content %}
<h2 class="section">{% trans "Password change successful" %}</h2>
<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 %}

View file

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

View file

@ -1,13 +1,16 @@
{% load i18n %}
<div class="wrapper search_wrapper">
<div class="row">
<form action="{% url 'search' %}" method="GET">
<div class="row">
<form action="{% url "search" %}" method="get">
<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 class="col third mwide">
<input type="submit" value="{% trans 'Search' %}" class="neutral" />
<input type="submit" value="{% trans "Search" %}" class="neutral" />
</div>
</form>
</div>
</form>
</div>
</div>

View file

@ -1 +1 @@
ok
ok