[Mpuls-commits] r143 - in waska/trunk: . waskaweb/model waskaweb/templates/casemanagement

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Mon Sep 8 17:51:46 CEST 2008


Author: teichmann
Date: 2008-09-08 17:51:44 +0200 (Mon, 08 Sep 2008)
New Revision: 143

Modified:
   waska/trunk/ChangeLog.txt
   waska/trunk/waskaweb/model/phases.py
   waska/trunk/waskaweb/templates/casemanagement/phase.mako
Log:
Only allow adanvacing forward in phase tree.



Modified: waska/trunk/ChangeLog.txt
===================================================================
--- waska/trunk/ChangeLog.txt	2008-09-08 15:45:45 UTC (rev 142)
+++ waska/trunk/ChangeLog.txt	2008-09-08 15:51:44 UTC (rev 143)
@@ -1,5 +1,12 @@
 2008-09-08  Sascha L. Teichmann <sascha.teichmann at intevation.de>
 
+	* waskaweb/model/phases.py: add a method phase.isPredecessor()
+
+	* waskaweb/templates/casemanagement/phase.mako: Only allow adanvacing forward in
+	  phase tree.
+
+2008-09-08  Sascha L. Teichmann <sascha.teichmann at intevation.de>
+
 	* waskaweb/model/phases_factory.py: Build a list of preds for each phase
 
 	* waskaweb/model/phases.py: track preds, too

Modified: waska/trunk/waskaweb/model/phases.py
===================================================================
--- waska/trunk/waskaweb/model/phases.py	2008-09-08 15:45:45 UTC (rev 142)
+++ waska/trunk/waskaweb/model/phases.py	2008-09-08 15:51:44 UTC (rev 143)
@@ -69,6 +69,12 @@
 
         return True
 
+    def isPredecessor(self, other):
+        for p in self.preds:
+            if p.phase == other.phase:
+                return True
+        return False
+
     def getTime(self):
         return self.time
 

Modified: waska/trunk/waskaweb/templates/casemanagement/phase.mako
===================================================================
--- waska/trunk/waskaweb/templates/casemanagement/phase.mako	2008-09-08 15:45:45 UTC (rev 142)
+++ waska/trunk/waskaweb/templates/casemanagement/phase.mako	2008-09-08 15:51:44 UTC (rev 143)
@@ -37,7 +37,7 @@
       </td>
       <td>${h.dd_mm_YYYY(p1.getTime(), '-/-')}</td>
       <td style="text-align:right">
-        % if p1.isRecursiveComplete() and not p1.isRunning() and p1.isNeighbor(c.current_phase):
+        % if p1.isRecursiveComplete() and not p1.isRunning() and p1.isNeighbor(c.current_phase) and not p1.isPredecessor(c.current_phase):
             <input type="submit" value="Start ${phase_pair.getDescription()|h}" name="${p1.getLabel()|h}">
         % else:
             <input type="submit" value="Start ${phase_pair.getDescription()|h}" name="${p1.getLabel()|h}"
@@ -56,7 +56,7 @@
       </td>
       <td class="table_row_h">${h.dd_mm_YYYY(p2.getTime(), '-/-')}</td>
       <td style="text-align:right" class="table_row_h">
-        % if p2.isRecursiveComplete() and p2.isNeighbor(c.current_phase):
+        % if p2.isRecursiveComplete() and p2.isNeighbor(c.current_phase) and not p2.isPredecessor(c.current_phase):
             <input type="submit" value="Ende ${p2.getDescription()|h}" name="${p2.getLabel()|h}">
         % else:
             <input type="submit" value="Ende ${p2.getDescription()|h}" name="${p2.getLabel()|h}" 



More information about the Mpuls-commits mailing list