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

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Feb 24 16:43:13 CET 2010


Author: torsten
Date: 2010-02-24 16:43:13 +0100 (Wed, 24 Feb 2010)
New Revision: 1758

Modified:
   wasko/branches/2.0/mpulsweb/templates/phase/phase.mako
Log:
* mpulsweb/templates/phase/phase.mako: Only show the submitbuttons if
the phaselist is valid and the phasepart is the direct neighbour of
the current phasepart.


Modified: wasko/branches/2.0/mpulsweb/templates/phase/phase.mako
===================================================================
--- wasko/branches/2.0/mpulsweb/templates/phase/phase.mako	2010-02-24 15:41:57 UTC (rev 1757)
+++ wasko/branches/2.0/mpulsweb/templates/phase/phase.mako	2010-02-24 15:43:13 UTC (rev 1758)
@@ -28,6 +28,8 @@
         % endif
         </th>
       </tr>
+      <% phases_are_valid = c.phases.is_valid() %>
+      <% current_phase = c.phases.get_current_phase_id() %>
       % for num, phase in enumerate(c.phases): 
       <% p1, p2 = phase.getStart(), phase.getEnd()  %>
       <tr class="${(num%2) and 'hl' or ''}">
@@ -55,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():
+          % if p1.is_ok() and phases_are_valid and abs(int(p1.id) - int(current_phase)) == 1:
             <input type="submit" name="phase_${p1.id}" value="${_('Start')}">
           % else:
             <input type="submit" name="phase_${p1.id}" value="${_('Start')}" disabled="disabled">
@@ -71,7 +73,7 @@
         <td class="note">${p2.getLinks()}</td>
         <td class="note center middle">${h.NA(h.format_date(p2.getTime()))}</td>
         <td class="actions">
-          % if p2.is_ok():
+          % if p2.is_ok() and phases_are_valid and abs(int(p2.id) - int(current_phase)) == 1:
             <input type="submit" name="phase_${p2.id}" value="${_('Finish')}">
           % else:
             <input type="submit" name="phase_${p2.id}" value="${_('Finish')}" disabled="disabled">



More information about the Mpuls-commits mailing list