From a4245ff0997077337d0eccea5317a57454a89845 Mon Sep 17 00:00:00 2001 From: Hartmut Holzgraefe Date: Fri, 16 Aug 2019 17:38:20 +0000 Subject: [PATCH 1/4] only return hits for places that actually exist in the osm2pgsql import --- www/maposmatic/views.py | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/www/maposmatic/views.py b/www/maposmatic/views.py index e5aeab68..97216fdd 100644 --- a/www/maposmatic/views.py +++ b/www/maposmatic/views.py @@ -370,17 +370,23 @@ def api_geosearch(request): exclude = request.GET.get('exclude', '') squery = request.GET.get('q', '') + squery = squery.lower() contents = { "entries": [] } cursor = None - query = """SELECT name, display_name, class, type - , osm_type, osm_id - , lat, lon, west, east, north, south - , place_rank, importance, country_code - FROM place - WHERE LOWER(name) = LOWER('%s') - ORDER BY place_rank, importance DESC""" % squery + query = """SELECT p.name, p.display_name, p.class, p.type + , p.osm_type, p.osm_id + , p.lat, p.lon, p.west, p.east, p.north, p.south + , p.place_rank, p.importance, p.country_code + FROM place p + LEFT JOIN planet_osm_hstore_point pt + ON p.osm_id = pt.osm_id + LEFT JOIN planet_osm_hstore_polygon poly + ON - p.osm_id = poly.osm_id + WHERE LOWER(p.name) = '%s' + AND ( pt.osm_id IS NOT NULL OR poly.osm_id IS NOT NULL) + ORDER BY p.place_rank, p.importance DESC""" % squery try: cursor = connections['osm'].cursor() From 04b3e87702b1c726b88e2ed34a272aa845786ad2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andre=20Luis=20Louren=C3=A7o=20Raposo?= Date: Thu, 15 Aug 2019 20:05:26 +0000 Subject: [PATCH 2/4] Translated using Weblate (Portuguese (Brazil)) Currently translated at 77.3% (191 of 247 strings) Translation: MapOSMatic/maposmatic.maposmatic Translate-URL: http://translate.get-map.org/projects/maposmatic/maposmatic/pt_BR/ --- www/locale/pt_BR/LC_MESSAGES/django.po | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/www/locale/pt_BR/LC_MESSAGES/django.po b/www/locale/pt_BR/LC_MESSAGES/django.po index 26389c8e..b1e3491d 100644 --- a/www/locale/pt_BR/LC_MESSAGES/django.po +++ b/www/locale/pt_BR/LC_MESSAGES/django.po @@ -7,14 +7,15 @@ # Rodrigo de Avila , 2013,2015 # Thiago Vieira , 2014 # André Marcelo Alvarenga , 2019. +# Andre Luis Lourenço Raposo , 2019. #: www/maposmatic/feeds.py:46 www/maposmatic/feeds.py:103 msgid "" msgstr "" "Project-Id-Version: MapOSMatic\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2019-04-10 22:23+0200\n" -"PO-Revision-Date: 2019-04-13 10:21+0000\n" -"Last-Translator: André Marcelo Alvarenga \n" +"PO-Revision-Date: 2019-08-16 17:41+0000\n" +"Last-Translator: Andre Luis Lourenço Raposo \n" "Language-Team: Portuguese (Brazil) \n" "Language: pt_BR\n" @@ -29,7 +30,6 @@ msgid "maps" msgstr "mapas" #: www/maposmatic/feeds.py:46 www/maposmatic/feeds.py:103 -#, fuzzy msgid "[DEV]" msgstr "[DEV]" @@ -771,9 +771,9 @@ msgstr "" "MapOSMatic quando se realizam as hackfests (reuniões de \n" "desenvolvedores). Você pode ler nosso blog para \n" -"saber mais sobre o que nós fazemos durante as hackfests. Nós " -"normalmente implementamos um número grande de melhorias, novas " -"funcionalidades e correções de bugs nessas reuniões. \n" +"saber mais sobre o que nós fazemos durante as hackfests. Nós normalmente " +"implementamos um número grande de melhorias, novas funcionalidades e " +"correções de bugs nessas reuniões. \n" "Elas acontecem durante os feriados dos desenvolvedores, e nós gostaríamos " "de, pelo menos, \n" "compensar seus gastos de viagem." From 2ed37bcbb6b721f2739809039e36078928ba1db9 Mon Sep 17 00:00:00 2001 From: Hartmut Holzgraefe Date: Wed, 16 Mar 2242 12:56:33 -2575833 Subject: [PATCH 3/4] another overlooked papersize API call --- www/maposmatic/apis.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/www/maposmatic/apis.py b/www/maposmatic/apis.py index 8d53d713..3d746c52 100644 --- a/www/maposmatic/apis.py +++ b/www/maposmatic/apis.py @@ -232,7 +232,8 @@ def _jobs_post(request): if 'paper_size' in input: try: - p = ocitysmap.OCitySMap.get_paper_size_by_name(input['paper_size']) + _ocitysmap = ocitysmap.OCitySMap(www.settings.OCITYSMAP_CFG_PATH) + p = _ocitysmap.get_paper_size_by_name(input['paper_size']) if 'orientation' in input: if input['orientation'] == 'landscape': p[1], p[0] = p[0], p[1] From 03abb52df548bc18c7883e0e1e53e2a4823e792e Mon Sep 17 00:00:00 2001 From: Hartmut Holzgraefe Date: Wed, 21 Aug 2019 21:44:09 +0000 Subject: [PATCH 4/4] enable full localization, so that date formats are correctly localized, too --- www/maposmatic/templates/maposmatic/about.html | 1 + www/maposmatic/templates/maposmatic/base-parts/navbar.html | 1 + www/maposmatic/templates/maposmatic/base.html | 1 + www/maposmatic/templates/maposmatic/documentation-api.html | 1 + .../templates/maposmatic/documentation-user-guide.html | 1 + www/maposmatic/templates/maposmatic/donate-thanks.html | 1 + www/maposmatic/templates/maposmatic/donate.html | 1 + www/maposmatic/templates/maposmatic/index-parts/status.html | 1 + www/maposmatic/templates/maposmatic/index.html | 1 + www/maposmatic/templates/maposmatic/map-feed.html | 1 + .../templates/maposmatic/map-full-parts/rendering-status.html | 1 + www/maposmatic/templates/maposmatic/map-full.html | 1 + www/maposmatic/templates/maposmatic/maps.html | 1 + www/maposmatic/templates/maposmatic/new.html | 1 + www/maposmatic/templates/maposmatic/pagination.html | 1 + www/settings.py | 1 + www/templates/404.html | 1 + www/templates/500.html | 1 + www/templates/503.html | 1 + 19 files changed, 19 insertions(+) diff --git a/www/maposmatic/templates/maposmatic/about.html b/www/maposmatic/templates/maposmatic/about.html index 90ebf5fa..ce259165 100644 --- a/www/maposmatic/templates/maposmatic/about.html +++ b/www/maposmatic/templates/maposmatic/about.html @@ -27,6 +27,7 @@ along with this program. If not, see . {% endcomment %} {% load i18n %} +{% load l10n %} {% load extratags %} {% block body-class %}about{% endblock %} diff --git a/www/maposmatic/templates/maposmatic/base-parts/navbar.html b/www/maposmatic/templates/maposmatic/base-parts/navbar.html index 57506e5d..01135df3 100644 --- a/www/maposmatic/templates/maposmatic/base-parts/navbar.html +++ b/www/maposmatic/templates/maposmatic/base-parts/navbar.html @@ -1,4 +1,5 @@ {% load i18n %} +{% load l10n %} {% load extratags %}