[Mpuls-commits] r2435 - in wasko/branches/2.0/mpulsweb: model templates/phase

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Apr 20 12:59:48 CEST 2010


Author: torsten
Date: 2010-04-20 12:59:47 +0200 (Tue, 20 Apr 2010)
New Revision: 2435

Modified:
   wasko/branches/2.0/mpulsweb/model/phase.py
   wasko/branches/2.0/mpulsweb/templates/phase/phase.mako
Log:
Modified disply of phases


Modified: wasko/branches/2.0/mpulsweb/model/phase.py
===================================================================
--- wasko/branches/2.0/mpulsweb/model/phase.py	2010-04-20 10:37:08 UTC (rev 2434)
+++ wasko/branches/2.0/mpulsweb/model/phase.py	2010-04-20 10:59:47 UTC (rev 2435)
@@ -136,12 +136,19 @@
         p.phase = '-1'
         return p
 
+    def get_phase(self, id):
+        for p in self:
+            if id == p.start.id: return p.start
+            if id == p.end.id: return p.end
+
     def get_path(self, phasepart_id):
         '''Returns a list of phaseparts id from start to the given phasepart_id'''
         path = []
         for pp in self.pre.get(phasepart_id, []):
-            path.extend(self.get_path(pp))
-            path.append(pp)
+            # Only add phases which are reachable
+            if self.get_phase(pp).is_ok():
+                path.extend(self.get_path(pp))
+                path.append(pp)
         path.append(phasepart_id)
         return path
 

Modified: wasko/branches/2.0/mpulsweb/templates/phase/phase.mako
===================================================================
--- wasko/branches/2.0/mpulsweb/templates/phase/phase.mako	2010-04-20 10:37:08 UTC (rev 2434)
+++ wasko/branches/2.0/mpulsweb/templates/phase/phase.mako	2010-04-20 10:59:47 UTC (rev 2435)
@@ -47,7 +47,7 @@
           % endif
           </span>
         </td>
-        % if p1.is_ok(check_setting_phase=False) and (c.phases.is_on_path(p1.id, current_phase) or c.phases.is_on_path(current_phase, p1.id)): 
+        % if p1.is_ok() and (c.phases.is_on_path(p1.id, current_phase) or c.phases.is_on_path(current_phase, p1.id)): 
 
         <td class="ok"></td>
         % else:
@@ -66,7 +66,7 @@
         </td>
       </tr>
       <tr class="${(num%2) and 'hl' or ''}">
-        % if p2.is_ok(check_setting_phase=False) and (c.phases.is_on_path(p2.id, current_phase) or c.phases.is_on_path(current_phase, p2.id)): 
+        % if p2.is_ok() and (c.phases.is_on_path(p2.id, current_phase) or c.phases.is_on_path(current_phase, p2.id)): 
         <td class="ok"></td>
         % else:
         <td class="error"></td>



More information about the Mpuls-commits mailing list