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

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Mar 18 21:56:36 CET 2009


Author: teichmann
Date: 2009-03-18 21:56:34 +0100 (Wed, 18 Mar 2009)
New Revision: 410

Modified:
   wasko/trunk/ChangeLog.txt
   wasko/trunk/waskaweb/model/phases_factory.py
Log:
Fixed bug with required fields on invisible pages.


Modified: wasko/trunk/ChangeLog.txt
===================================================================
--- wasko/trunk/ChangeLog.txt	2009-03-18 18:07:50 UTC (rev 409)
+++ wasko/trunk/ChangeLog.txt	2009-03-18 20:56:34 UTC (rev 410)
@@ -1,3 +1,10 @@
+2009-03-18	Sascha L. Teichmann <teichmann at intevation.de>
+
+	* waskaweb/model/phases_factory.py: required fields that are
+	  on invisible pages (like einwilligung) are rendered on
+	  top of the phase link list with full description but with
+	  no link.
+
 2009-03-18	Torsten Irlaender  <torsten.irlaender at intevation.de> 
 
 	Added basic workflow for "wiederaufnahme"/"neuaufnahme" when creating

Modified: wasko/trunk/waskaweb/model/phases_factory.py
===================================================================
--- wasko/trunk/waskaweb/model/phases_factory.py	2009-03-18 18:07:50 UTC (rev 409)
+++ wasko/trunk/waskaweb/model/phases_factory.py	2009-03-18 20:56:34 UTC (rev 410)
@@ -182,8 +182,13 @@
 
         pages, used_pages = [], {}
 
+        on_invisible_page = []
+
         for var in all_vars:
             p = page(var)
+            if p.isInvisible():
+                on_invisible_page.append(var)
+                continue
             p_name = p.getName()
             try:
                 t = used_pages[p_name]
@@ -198,9 +203,18 @@
             if var.getName() in missing_set:
                 t[1].append(var)
 
-        if not pages: return u""
+        if not pages and not on_invisible_page: return u""
 
         out = [u"<ul>"]
+
+        for var in on_invisible_page:
+            out.append(u"<li>")
+            missing = var.getName() in missing_set
+            if missing: out.append(u'<span class="required_missing">')
+            out.append(escape(var.getDescription()))
+            if missing: out.append(u"</span>")
+            out.append(u"</li>")
+
         for tree_item, warn in pages:
             out.append(u"<li>")
             if not warn:



More information about the Mpuls-commits mailing list