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

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Sun Feb 22 17:12:44 CET 2009


Author: teichmann
Date: 2009-02-22 17:12:40 +0100 (Sun, 22 Feb 2009)
New Revision: 279

Modified:
   wasko/trunk/ChangeLog.txt
   wasko/trunk/formed/formedtree_web.xml
   wasko/trunk/waskaweb/model/data.py
   wasko/trunk/waskaweb/model/navigation.py
Log:
Support invisible pages


Modified: wasko/trunk/ChangeLog.txt
===================================================================
--- wasko/trunk/ChangeLog.txt	2009-02-22 15:54:58 UTC (rev 278)
+++ wasko/trunk/ChangeLog.txt	2009-02-22 16:12:40 UTC (rev 279)
@@ -1,5 +1,19 @@
 2009-02-22	Sascha L. Teichmann <teichmann at intevation.de>
 
+	Support invisible pages.
+
+	* waskaweb/model/data.py: PageNode object now support
+	  the attribiute "invisible".
+
+	* waskaweb/model/navigation.py: Leave out pages in tree 
+	  buildung which are invisible.
+
+	* waskaweb/model/data.py: Mark first page invisible.
+	  TODO: This feature has to be ported back to the
+	  FormEd editor or this change is lost!
+	
+2009-02-22	Sascha L. Teichmann <teichmann at intevation.de>
+
 	More changes backported from offline client.
 
 	* waskaweb/model/navigation.py: Behavior should now be nearly

Modified: wasko/trunk/formed/formedtree_web.xml
===================================================================
--- wasko/trunk/formed/formedtree_web.xml	2009-02-22 15:54:58 UTC (rev 278)
+++ wasko/trunk/formed/formedtree_web.xml	2009-02-22 16:12:40 UTC (rev 279)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <document>
   <case>
-    <page description="Einwilligungserklärung" name="ee">
+    <page description="Einwilligungserklärung"  invisible="1" name="ee">
       <group description="Angaben zur Einwilligungserklärung">
         <choice description="Unterschriebene Einwilligungserklärung" flags="required:phase_a_end" name="einwilligung" size="1">
           <bool description="liegt vor" name="bool-406" value="1"/>

Modified: wasko/trunk/waskaweb/model/data.py
===================================================================
--- wasko/trunk/waskaweb/model/data.py	2009-02-22 15:54:58 UTC (rev 278)
+++ wasko/trunk/waskaweb/model/data.py	2009-02-22 16:12:40 UTC (rev 279)
@@ -80,7 +80,14 @@
 class PageNode(Node):
     def __init__(self):
         Node.__init__(self)
+        self.attributes["invisible"] = ""
 
+    def setInvisible(self, flag):
+        self.setAttribute("invisible", flag and "true" or "")
+
+    def isInvisible(self):
+        return self.getAttribute("invisible") and True or False
+
     def allWidgets(self):
         collector = WidgetCollector()
         self.visit(collector.visitor)

Modified: wasko/trunk/waskaweb/model/navigation.py
===================================================================
--- wasko/trunk/waskaweb/model/navigation.py	2009-02-22 15:54:58 UTC (rev 278)
+++ wasko/trunk/waskaweb/model/navigation.py	2009-02-22 16:12:40 UTC (rev 279)
@@ -106,7 +106,7 @@
                     u' border="0"'
                     u' title="Ordner%s"'
                     u' alt="%s"' % (
-                        not has_error and "schliessen" or "",
+                        not has_error and " schliessen" or "",
                         has_error and u"offener" or u"geschlossener")))
 
                 out.append(has_error and u' ' or u'</a>')
@@ -202,6 +202,8 @@
     def build(self, nc, parent):
 
         if isinstance(nc, PageNode):
+            if nc.isInvisible():
+                return None
             ti = TreeItem(nc.getName(), nc.getDescription(), parent = parent)
             ti.key = self.key
             self.key += 1
@@ -215,7 +217,8 @@
                 children,
                 parent)
             for child in nc.children:
-                children.append(self.build(child, n))
+                c = self.build(child, n)
+                if c: children.append(c)
             n.key = self.key
             self.key += 1
             return n



More information about the Mpuls-commits mailing list