diff options
Diffstat (limited to 'chimere/widgets.py')
| -rw-r--r-- | chimere/widgets.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/chimere/widgets.py b/chimere/widgets.py index ab827d8..da2bc54 100644 --- a/chimere/widgets.py +++ b/chimere/widgets.py @@ -292,9 +292,20 @@ class RouteChooserWidget(forms.TextInput): u"<a href='#' onclick='return false;'>%s</a></div>"\ u"</div>\n"\ u"<hr class='spacer'/>" % (_(u"Start \"hand\" drawing")) + style = '' + if value: + style = " style='display:block'" + tpl += u"\n<div class='help-route' id='help-route-modify'%s>%s</div>"\ + u"\n<hr class='spacer'/>\n"\ + u"<input type='hidden' name='%s' id='id_%s' value=\"%s\"/>\n"\ + u"<input type='hidden' name='associated_file_id' "\ + u"id='id_associated_file_id' value=\"%s\"/>\n" % ( + style, help_modify, name, name, value, routefile_id) if value: tpl += u"\n<div id='map_edit'></div>" else: + tpl += "\n<div class='help-route' id='help-route-create'>%s</div>"\ + % help_create tpl += u"\n<div id='map_edit'>\n"\ u" <div class='map_button'>\n"\ u" <a href='#' id='button-move-map' class='toggle-button "\ @@ -304,17 +315,6 @@ class RouteChooserWidget(forms.TextInput): u"toggle-button-inactive' onclick='toggleDrawOn();return false;'>"\ u"%s</a></div>\n"\ u" </div>" % (_(u"Move on the map"), _(u"Draw")) - tpl += "\n<div class='help-route' id='help-route-create'>%s</div>"\ - % help_create - style = '' - if value: - style = " style='display:block'" - tpl += u"\n<div class='help-route' id='help-route-modify'%s>%s</div>"\ - u"\n<hr class='spacer'/>\n"\ - u"<input type='hidden' name='%s' id='id_%s' value=\"%s\"/>\n"\ - u"<input type='hidden' name='associated_file_id' "\ - u"id='id_associated_file_id' value=\"%s\"/>\n" % ( - style, help_modify, name, name, value, routefile_id) tpl += u"<script type='text/javascript'><!--\n" if not value: tpl += u"jQuery('#map_edit').hide();" |
