[Mpuls-commits] r873 - wasko/branches/2.0/waskaweb/lib

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Jan 26 12:36:34 CET 2010


Author: torsten
Date: 2010-01-26 12:36:32 +0100 (Tue, 26 Jan 2010)
New Revision: 873

Modified:
   wasko/branches/2.0/waskaweb/lib/helpers.py
Log:
* waskaweb/lib/helpers.py (getHelp): Implemented helpHelp function
again. TODO: Put rendering of link and icon into lib renderer, as is
is used there too.


Modified: wasko/branches/2.0/waskaweb/lib/helpers.py
===================================================================
--- wasko/branches/2.0/waskaweb/lib/helpers.py	2010-01-26 11:22:06 UTC (rev 872)
+++ wasko/branches/2.0/waskaweb/lib/helpers.py	2010-01-26 11:36:32 UTC (rev 873)
@@ -273,11 +273,19 @@
     return False
 
 def getHelp(help_id):
-    return "My Help"
-    #from waskaweb.lib.renderer import FormData
-    #formdata = FormData(g.helpData)
-    #return formdata.getHelp(help_id)
+    '''
+    Returns a HTML link with a help icon if help is present for help_id. Else
+    return empty string 
+    '''
+    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('</a>')
+    return "".join(out)
 
+
 def getFormularName(page_id):
     navigation = session.get('navigation.tree')
     try:



More information about the Mpuls-commits mailing list