[Mpuls-commits] r362 - in wasko/trunk: . waskaweb/controllers waskaweb/model

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Mar 11 13:26:40 CET 2009


Author: teichmann
Date: 2009-03-11 13:26:37 +0100 (Wed, 11 Mar 2009)
New Revision: 362

Modified:
   wasko/trunk/ChangeLog.txt
   wasko/trunk/waskaweb/controllers/case.py
   wasko/trunk/waskaweb/model/navigation.py
Log:
Fixed issue86



Modified: wasko/trunk/ChangeLog.txt
===================================================================
--- wasko/trunk/ChangeLog.txt	2009-03-11 11:04:40 UTC (rev 361)
+++ wasko/trunk/ChangeLog.txt	2009-03-11 12:26:37 UTC (rev 362)
@@ -1,3 +1,13 @@
+2009-03-11	Sascha L. Teichmann	<teichmann at intevation.de>
+
+	Fixed issue86
+
+	* waskaweb/model/navigation.py: added generator function to
+	  list all headers for a tree item.
+
+	* waskaweb/controllers/case.py: Put all headers above
+	  the form data on each page.
+
 2009-03-11	Torsten Irlaender  <torsten.irlaender at intevation.de> 
 
 	New annotations

Modified: wasko/trunk/waskaweb/controllers/case.py
===================================================================
--- wasko/trunk/waskaweb/controllers/case.py	2009-03-11 11:04:40 UTC (rev 361)
+++ wasko/trunk/waskaweb/controllers/case.py	2009-03-11 12:26:37 UTC (rev 362)
@@ -39,6 +39,8 @@
 
 from pylons import config
 
+from cgi import escape
+
 from paste.httpexceptions        import HTTPNotFound
 from waskaweb.lib.base           import *
 from waskaweb.lib.search         import INCONSISTENCY_CHECK_AFTER
@@ -291,7 +293,8 @@
         formular.append('<span style="page-break-after:always"></span>')
         for ti in self.getNavigation().getAllItems():
             content, navigation, warnings = self._getRenderdFormElements(ti, id, ro_mode=True, no_data=empty)
-            formular.append("""<h1>%s</h1>""" % ti.description)
+            formular.append(u"".join(
+                [u'<h%d>%s</h%d>' % (min(i+1, 4), escape(s), min(i+1,4)) for i, s in enumerate(ti.pureHeaders())]))
             if not ti.children: #Only add leaves
                 formular.append(content)
         c.formular = "<br>".join(formular)

Modified: wasko/trunk/waskaweb/model/navigation.py
===================================================================
--- wasko/trunk/waskaweb/model/navigation.py	2009-03-11 11:04:40 UTC (rev 361)
+++ wasko/trunk/waskaweb/model/navigation.py	2009-03-11 12:26:37 UTC (rev 362)
@@ -170,6 +170,13 @@
             cur = cur.parent
         return descriptions
 
+    def pureHeaders(self):
+        if self.parent:
+            for h in self.parent.pureHeaders():
+                yield h
+        if self.description:
+            yield self.description
+        
     def renderHeader(self, form_data):
         descriptions = self.get_description_chain(form_data)
         if not descriptions: return u""



More information about the Mpuls-commits mailing list