From 6d4cf0337e09e67bb454c2116cce13846aa0d22d Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 27 Feb 2012 16:07:25 +0100 Subject: Formatting --- chimere/widgets.py | 124 ++++++++++++++++++++++++++--------------------------- 1 file changed, 62 insertions(+), 62 deletions(-) diff --git a/chimere/widgets.py b/chimere/widgets.py index fcf3c60..d648835 100644 --- a/chimere/widgets.py +++ b/chimere/widgets.py @@ -193,46 +193,47 @@ class RouteChooserWidget(forms.TextInput): settings.STATIC_URL if not value: # upload a file - tpl += u""" -""" % _(u"Give a name and set category before uploading 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"""\n

%s

\n""" % _(u"or") - tpl += u"""
-%s
-
-
""" % (_(u"Start \"hand\" drawing")) + tpl += u"\n

%s

\n" % _(u"or") + tpl += u"
\n"\ + u"%s
"\ + u"
\n"\ + u"
" % (_(u"Start \"hand\" drawing")) if value: - tpl += """ -
""" + tpl += u"\n
" else: - tpl += """ -
-
- %s - %s
-
""" % (_(u"Move on the map"), _(u"Draw")) - tpl += ''' -
%s
''' % help_create + tpl += u"\n
\n"\ + u"
\n"\ + u" %s"\ + u"\n"\ + u""\ + u"%s
\n"\ + u"
" % (_(u"Move on the map"), _(u"Draw")) + tpl += "\n
%s
"\ + % help_create style = '' if value: style = " style='display:block'" - tpl += """ -
%s
-
- - -""" % (style, help_modify, name, name, value, routefile_id) - tpl += " -""" + tpl += u"\nvar geometry='%s';\n"\ + u"initFeature(geometry);" % val.json + tpl += u"\n// -->\n" return mark_safe(tpl) class RouteField(models.LineStringField): @@ -284,22 +282,23 @@ class AreaWidget(forms.TextInput): lower_right_lon, lower_right_lat = lower_right.x, \ lower_right.y tpl = getMapJS() - tpl += u"""
- - - - -""" % (upper_left_lat, upper_left_lon, lower_right_lat, lower_right_lon) - tpl += """ -
-""" + tpl += u"var extent = new OpenLayers.Bounds(%f, %f, %f, %f);\n"\ + u"extent.transform(epsg_display_projection, epsg_projection);\n"\ + u"map.zoomToExtent(extent, true);""" % (upper_left_lon, + upper_left_lat, lower_right_lon, lower_right_lat) + tpl += u"// -->\n
\n" return mark_safe(tpl) def value_from_datadict(self, data, files, name): @@ -343,17 +342,18 @@ class MultiSelectWidget(forms.SelectMultiple): def render(self, name, value, attrs=None): rendered = super(MultiSelectWidget, self).render(name, value, attrs) - return mark_safe(rendered + u'''
''' % {'name':name, 'title':_("Select...")}) + rendered += u"
\n" % {'name':name, 'title':_("Select...")} + return mark_safe(rendered) class SelectMultipleField(models.ManyToManyField): ''' -- cgit v1.2.3