Prettify template files with djlint

This commit is contained in:
David Larlet 2023-06-20 09:40:32 -04:00
parent 247efc5345
commit 70e3852c0c
No known key found for this signature in database
GPG key ID: 3E2953A359E7E7BD
28 changed files with 336 additions and 322 deletions

View file

@ -9,6 +9,10 @@ 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: 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,11 +1,13 @@
{% 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="/" title="{% trans 'Take me to the home page' %}">
<h1>4<img src="{% static 'umap/img/logo.svg' %}">4</h1> <h1>
4
<img src="{% static 'umap/img/logo.svg' %}">
4
</h1>
<h2>Not Found</h2> <h2>Not Found</h2>
</a> </a>
</div> </div>

View file

@ -1,6 +1,6 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>Ooops</title> <title>Ooops</title>
<meta charset="utf-8"> <meta charset="utf-8">
<style type="text/css"> <style type="text/css">
@ -12,13 +12,12 @@
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,PD94bWwgdmVyc2lvbj0iMS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A1ODg3NDUgNjAuMDU4ODc1LDAgNzAsMCA3OS45NDExMjUsMCA4OCw4LjA1ODg3NDUgODgsMTggeiIKICAgICAgIHRyYW5zZm9ybT0ibWF0cml4KDEuMzE0MjY5NywwLDAsMS4zMTQyNjk3LC0yNy45OTg4NzgsOTM0LjUyODU1KSIgLz4KICA8L2c+Cjwvc3ZnPgo=" />
<p>Oops, Server error…</p> <p>Oops, Server error…</p>
</div> </div>
</body>
</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,25 @@
{% 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 %}
</title>
<meta charset="utf-8"> <meta charset="utf-8">
{% 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 %}">
{% 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

@ -3,7 +3,9 @@
<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" 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> <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" />

View file

@ -1,23 +1,18 @@
{% extends "base.html" %} {% extends "base.html" %}
{% load umap_tags compress i18n %} {% load umap_tags compress i18n %}
{% block body_class %}content{% endblock %} {% block body_class %}content{% endblock %}
{% block extra_head %} {% block extra_head %}
{% compress css %} {% compress css %}
{% umap_css %} {% umap_css %}
{% endcompress css %} {% endcompress css %}
{% umap_js %} {% umap_js %}
{% endblock %} {% endblock %}
{% 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 %}
{% block content %} {% block content %}
{% if UMAP_READONLY %} {% if UMAP_READONLY %}
<div class="wrapper demo-instance-warning"> <div class="wrapper demo-instance-warning">
@ -38,7 +33,6 @@
{% 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">
@ -88,7 +82,6 @@
})(this); })(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,6 +1,5 @@
{% 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()
@ -13,7 +12,7 @@
} }
} }
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

@ -2,17 +2,13 @@
{% load umap_tags compress i18n %} {% load umap_tags compress i18n %}
{% block head_title %}{{ map.name }} - {{ SITE_NAME }}{% endblock %} {% block head_title %}{{ map.name }} - {{ SITE_NAME }}{% endblock %}
{% block body_class %}map_detail{% endblock %} {% block body_class %}map_detail{% endblock %}
{% 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">
{% endif %}
{% endblock %} {% endblock %}
{% block content %} {% block content %}
{% block map_init %} {% block map_init %}
{% include "umap/map_init.html" %} {% include "umap/map_init.html" %}

View file

@ -1,5 +1,3 @@
{% 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"> <script type="text/javascript">new L.U.Map("{{ unique_id }}", {{ map_settings|notag|safe }});</script>
new L.U.Map("{{ unique_id }}", {{ map_settings|notag|safe }});
</script>

View file

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

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

@ -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,28 +1,42 @@
{% load i18n %} {% load i18n %}
<nav class="umap-nav"> <nav class="umap-nav">
<section> <section>
<h1><a href="/">{{ title }}</a></h1> <h1>
<a href="/">{{ 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>

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." %}
</p>
<form action="{% url 'password_change' %}" method="POST"> <form action="{% url 'password_change' %}" method="POST">
{% 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'
placeholder='{% trans "New password confirmation" %}' />
<input type='submit' value='{% trans "Change my password" %}' /> <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 %}
@ -21,5 +19,5 @@
{% endif %} {% endif %}
</div> </div>
</div> </div>
{% endif %} {% endif %}
{% endblock maincontent %} {% endblock maincontent %}

View file

@ -3,7 +3,10 @@
<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" />