[Mpuls-commits] r2327 - wasko/branches/2.0/mpulsweb/templates/phase

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Apr 14 09:09:44 CEST 2010


Author: torsten
Date: 2010-04-14 09:09:41 +0200 (Wed, 14 Apr 2010)
New Revision: 2327

Modified:
   wasko/branches/2.0/mpulsweb/templates/phase/phase.mako
Log:
* mpulsweb/templates/phase/phase.mako: Display state of a phase
correctly.


Modified: wasko/branches/2.0/mpulsweb/templates/phase/phase.mako
===================================================================
--- wasko/branches/2.0/mpulsweb/templates/phase/phase.mako	2010-04-13 14:59:07 UTC (rev 2326)
+++ wasko/branches/2.0/mpulsweb/templates/phase/phase.mako	2010-04-14 07:09:41 UTC (rev 2327)
@@ -40,7 +40,7 @@
             ${_('Running')}
           % elif p2.is_active():
             ${_('Finished')}
-          % elif (c.phases.get_current_phase_id() > p2.id) or (c.phases.get_current_phase_id() > p1.id):
+          % elif (p2.id in c.phases.get_path(current_phase)) or (p1.id in c.phases.get_path(current_phase)):
             ${_('Finished')}
           % else:
             ${_('Not yet started')}
@@ -57,7 +57,7 @@
           ${h.NA(h.format_date(p1.getTime()))}
         </td>
         <td class="actions middle" style="border-bottom: 1pt dotted; border-color: #000;">
-          % if p1.is_ok() and phases_are_valid and abs(int(p1.id) - int(current_phase)) == 1:
+          % if p1.is_ok() and phases_are_valid and p1.is_neighbor(current_phase):
             <input type="submit" name="${p1.id}" value="${_('Start')}">
           % else:
             <input type="submit" name="${p1.id}" value="${_('Start')}" disabled="disabled">
@@ -73,7 +73,7 @@
         <td class="note">${h.literal(p2.getLinks())}</td>
         <td class="note center middle">${h.NA(h.format_date(p2.getTime()))}</td>
         <td class="actions">
-          % if p2.is_ok() and phases_are_valid and abs(int(p2.id) - int(current_phase)) == 1:
+          % if p2.is_ok() and phases_are_valid and p2.is_neighbor(current_phase):
             <input type="submit" name="${p2.id}" value="${_('Finish')}">
           % else:
             <input type="submit" name="${p2.id}" value="${_('Finish')}" disabled="disabled">



More information about the Mpuls-commits mailing list