summaryrefslogtreecommitdiff
path: root/chimere/widgets.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2018-07-19 19:20:30 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2018-07-19 19:20:30 +0200
commit5a125c7b742130fb8dd87543fb42e8ffb9203762 (patch)
tree9411bd0657c9d483a838903f1c0e6539f979dede /chimere/widgets.py
parent8205946e5dc30242ea085237c10fdddd197499c3 (diff)
downloadChimère-5a125c7b742130fb8dd87543fb42e8ffb9203762.tar.bz2
Chimère-5a125c7b742130fb8dd87543fb42e8ffb9203762.zip
Use overpass API for OSM imports
Diffstat (limited to 'chimere/widgets.py')
-rw-r--r--chimere/widgets.py35
1 files changed, 6 insertions, 29 deletions
diff --git a/chimere/widgets.py b/chimere/widgets.py
index 1ab5e44..346e3cf 100644
--- a/chimere/widgets.py
+++ b/chimere/widgets.py
@@ -557,9 +557,6 @@ class AreaWidget(forms.TextInput):
" value='%f'/>\n" % (
upper_left_lat, upper_left_lon, lower_right_lat,
lower_right_lon)
- help_msg = _("Click to begin selecting area on the map and click again "
- "to close the rectangle. To modify, move the nodes of the rectangle.")
- tpl += "<p class='help-osm'>%s</p>\n" % help_msg
tpl += "<script type='text/javascript'>\n"
tpl += "function init_map_form (){\ninit('map_edit_area');\n"
if value:
@@ -663,29 +660,14 @@ class ImportFiltrWidget(AreaWidget):
"""
tpl = super(ImportFiltrWidget, self).render(name, value, attrs,
initialized=False)
- tpl += "</div><hr class='spacer'/>"
- vals = {'lbl': _("Type:"), 'name': name, 'node': _("Node"),
- 'way': _("Way")}
+ vals = {
+ 'lbl': _("Type:"), 'name': name, 'node': _("Node"),
+ 'way': _("Way")
+ }
vals['way_selected'] = ' checked="checked"'\
if self.xapi_type == 'way' else ''
vals['node_selected'] = ' checked="checked"'\
if self.xapi_type == 'node' else ''
- tpl += "<div class='input-osm'><label>%(lbl)s</label>"\
- "<input type='radio' name='id_%(name)s_type' "\
- "id='id_%(name)s_node' value='node'%(node_selected)s/> "\
- "<label for='id_%(name)s_node'>"\
- "%(node)s</label> <input type='radio' name='id_%(name)s_type' "\
- "id='id_%(name)s_way' value='way'%(way_selected)s/> <label "\
- "for='id_%(name)s_way'>%(way)s</label></div>" % vals
- help_msg = _(
- "Enter an OSM \"tag=value\" string such as "
- "\"amenity=pub\". A list of common tag is available "
- "<a href='https://wiki.openstreetmap.org/wiki/Map_Features' "
- " target='_blank'>here</a>.")
- tpl += "<p class='help-osm'>%s</p>\n" % help_msg
- tpl += "<div class='input-osm'><label for='id_%s_tag'>%s</label>"\
- "<input type='text' id='id_%s_tag' value=\"%s\"/></div>" % (
- name, _("Tag:"), name, self.xapi_tag)
tpl += "<script type='text/javascript'>\n"
tpl += "var default_xapi='%s';" % settings.CHIMERE_XAPI_URL
tpl += 'var msg_missing_area = "%s";' % \
@@ -695,18 +677,13 @@ class ImportFiltrWidget(AreaWidget):
tpl += 'var msg_missing_filtr = "%s";' % \
_("You have to insert a filter tag.")
tpl += "</script>\n"
- help_msg = _("If you change the above form don't forget to refresh "
- "before submit!")
- tpl += "<p class='help-osm errornote'>%s</p>\n" % help_msg
help_msg = _("You can put a Folder name of the KML file to filter on "
"it.")
tpl += "<p class='help-kml'>%s</p>\n" % help_msg
if not value:
value = ''
- tpl += "<div><textarea id='id_%s' name='id_%s' "\
- ">%s</textarea> <input type='button' id='id_refresh_%s' "\
- "value='%s' class='input-osm'/>" % (name, name, value, name,
- _("Refresh"))
+ tpl += "<textarea id='id_%s' name='id_%s'>%s</textarea>" % (
+ name, name, value)
return mark_safe(tpl)
def value_from_datadict(self, data, files, name):