[Mpuls-commits] r3034 - in base/trunk: . mpulsweb/lib
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Fri Jun 18 15:46:40 CEST 2010
Author: bh
Date: 2010-06-18 15:46:39 +0200 (Fri, 18 Jun 2010)
New Revision: 3034
Modified:
base/trunk/ChangeLog
base/trunk/mpulsweb/lib/helpers.py
Log:
* mpulsweb/lib/helpers.py (getHelp): Use tag to generate HTML tags
with proper escaping and generate URLs with url_for.
(get_export_selector): Escape HTML properly and use tag to
generate URLs
Modified: base/trunk/ChangeLog
===================================================================
--- base/trunk/ChangeLog 2010-06-18 13:31:36 UTC (rev 3033)
+++ base/trunk/ChangeLog 2010-06-18 13:46:39 UTC (rev 3034)
@@ -1,5 +1,12 @@
2010-06-18 Bernhard Herzog <bh at intevation.de>
+ * mpulsweb/lib/helpers.py (getHelp): Use tag to generate HTML tags
+ with proper escaping and generate URLs with url_for.
+ (get_export_selector): Escape HTML properly and use tag to
+ generate URLs
+
+2010-06-18 Bernhard Herzog <bh at intevation.de>
+
* mpulsweb/templates/usersettings/change_password.mako: Generate
correct URL for "Mein Konto" in buildNavipath
Modified: base/trunk/mpulsweb/lib/helpers.py
===================================================================
--- base/trunk/mpulsweb/lib/helpers.py 2010-06-18 13:31:36 UTC (rev 3033)
+++ base/trunk/mpulsweb/lib/helpers.py 2010-06-18 13:46:39 UTC (rev 3034)
@@ -153,8 +153,11 @@
out = []
help = g.helpData.getHelp(help_id)
if help:
- out.append('<a href="/annotations/help/%s" target="_blank">' % help_id)
- out.append('<img src="/images/icons/formular/help.png" alt="help">')
+ out.append(tag("a", href=url_for(controller='/annotations',
+ action='help', id=help_id),
+ target="_blank"))
+ out.append(tag("img", src=url_for('/images/icons/formular/help.png'),
+ alt="help"))
out.append('</a>')
return "".join(out)
@@ -165,10 +168,14 @@
out = []
out.append('<ul>')
for i in g.formedTree.findAllByClass(PageNode):
- if i.getName() == 'ee': continue
+ if i.getName() == 'ee':
+ continue
out.append('<li>')
- out.append('<input type="checkbox" name="exportselection" value="%s" id="%s">' % (i.getName(), i.getName()))
- out.append(' <label for="%s">%s</label>' % (i.getName(), i.getDescription()))
+ out.append(tag("input", type="checkbox", name="exportselection",
+ value=i.getName(), id=i.getName()))
+ out.append(tag("label", for_=i.getName()))
+ out.append(escape(i.getDescription()))
+ out.append("</label>")
out.append('</li>')
out.append('</ul>')
return "".join(out)
More information about the Mpuls-commits
mailing list