summaryrefslogtreecommitdiff
path: root/chimere/widgets.py
diff options
context:
space:
mode:
Diffstat (limited to 'chimere/widgets.py')
-rw-r--r--chimere/widgets.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/chimere/widgets.py b/chimere/widgets.py
index 23709ac..e107237 100644
--- a/chimere/widgets.py
+++ b/chimere/widgets.py
@@ -22,10 +22,11 @@ Extra widgets and fields
"""
from django import conf
from django import forms
-from django.core.exceptions import ObjectDoesNotExist
from django.conf import settings
from django.contrib.gis.db import models
from django.contrib.gis.geos import fromstr
+from django.core.exceptions import ObjectDoesNotExist
+from django.core.urlresolvers import reverse
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext as _
@@ -252,6 +253,7 @@ class RouteChooserWidget(forms.TextInput):
tpl = getMapJS(area_name)
map_layers, default_area = get_map_layers(area_name)
js = """
+ var extra_url = "%s";
OpenLayers.ImgPath = '%schimere/img/';
var EPSG_DISPLAY_PROJECTION = epsg_display_projection = new OpenLayers.Projection('EPSG:%s');
var EPSG_PROJECTION = epsg_projection = new OpenLayers.Projection('EPSG:%s');
@@ -263,7 +265,8 @@ class RouteChooserWidget(forms.TextInput):
chimere_init_options['edition'] = true;
chimere_init_options['edition_type_is_route'] = true;
chimere_init_options["checked_categories"] = [];
- """ % (settings.STATIC_URL, settings.CHIMERE_EPSG_DISPLAY_PROJECTION,
+ """ % ( reverse("chimere:index"), settings.STATIC_URL,
+ settings.CHIMERE_EPSG_DISPLAY_PROJECTION,
settings.CHIMERE_EPSG_PROJECTION, settings.CHIMERE_DEFAULT_CENTER,
settings.CHIMERE_DEFAULT_ZOOM, ", ".join(map_layers))
if default_area: