From d3b04460bbb5d1e7eb7ed28220ae305cce6ad6e2 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Fri, 9 Sep 2011 17:01:17 +0200 Subject: Association of a GPX (or KML) file to a route (closes #302) - template file for upload - js finalisation and debug - css - "artwork" - french translation --- chimere/main/widgets.py | 39 ++++++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 15 deletions(-) (limited to 'chimere/main/widgets.py') diff --git a/chimere/main/widgets.py b/chimere/main/widgets.py index caac0ea..083fbec 100644 --- a/chimere/main/widgets.py +++ b/chimere/main/widgets.py @@ -147,7 +147,7 @@ class RouteChooserWidget(forms.TextInput): js = ["%sedit_route_map.js" % settings.MEDIA_URL, "%sbase.js" % settings.MEDIA_URL,] + URL_OSM_JS - def render(self, name, value, attrs=None, area_name=''): + def render(self, name, value, attrs=None, area_name='', routefile_id=None): ''' Render a map and latitude, longitude information field ''' @@ -159,25 +159,35 @@ class RouteChooserWidget(forms.TextInput):

%s

%s

%s

-

%s

""" % (_("Creation mode"), -_("To start drawing the route click on the toggle button : \"Start drawing\"."), -_("Then click on the map to begin the drawing."), -_("You can add points by clicking again."), -_("To finish the drawing double click. When the drawing is finished you can \ +

%s

""" % (_(u"Creation mode"), +_(u"To start drawing the route click on the toggle button : \"Start drawing\"."), +_(u"Then click on the map to begin the drawing."), +_(u"You can add points by clicking again."), +_(u"To finish the drawing double click. When the drawing is finished you can \ edit it."), -_("While creating to undo a drawing click again on the toggle button \"Stop \ +_(u"While creating to undo a drawing click again on the toggle button \"Stop \ drawing\".")) help_modify = """

%s

%s

%s

-

%s

""" % (_("Modification mode"), -_("To move a point click on it and drag it to the desired position."), -_("To delete a point move the mouse cursor over it and press the \"d\" key."), -_("To add a point click in the middle of a segment and drag the new point to \ +

%s

""" % (_(u"Modification mode"), +_(u"To move a point click on it and drag it to the desired position."), +_(u"To delete a point move the mouse cursor over it and press the \"d\" or \ +\"Del\" key."), +_(u"To add a point click in the middle of a segment and drag the new point to \ the desired position")) tpl += u'\n' % \ settings.MEDIA_URL if not value: + # upload a file + tpl += u""" +""" % _(u"Give a name and set category before uploading a file.") + tpl += u'
%s
' % ( + _(u"Upload a route file (GPX or KML)")) + tpl += u"""
%s
%s
%s

-""" % (style, help_modify, name, name, value) + +""" % (style, help_modify, name, name, value, routefile_id) tpl += " """ - tpl += u'%s' % ( - settings.BASE_URL, _(u"Upload a route file (GPX or KML)")) return mark_safe(tpl) class RouteField(models.LineStringField): -- cgit v1.2.3