diff options
| -rw-r--r-- | chimere/templates/chimere/upload_file.html | 2 | ||||
| -rw-r--r-- | chimere/widgets.py | 7 | 
2 files changed, 7 insertions, 2 deletions
diff --git a/chimere/templates/chimere/upload_file.html b/chimere/templates/chimere/upload_file.html index b0fbafc..f82bad9 100644 --- a/chimere/templates/chimere/upload_file.html +++ b/chimere/templates/chimere/upload_file.html @@ -22,6 +22,7 @@  <div class="fieldWrapper">  {% if gpx_id %}  <script type="text/javascript"><!-- +jQuery(document).ready(function() {      jQuery.get("{% url chimere:process_route_file gpx_id %}", function(data) {              var data = eval(data);              var main_page = opener.document; @@ -39,6 +40,7 @@                      alert(xhr.status);                      alert(thrownError);                  }    ); +});  // --></script>  {% else %}  <form enctype="multipart/form-data" method='post' action='.'> 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:  | 
