[Mpuls-commits] r3063 - in jmd/trunk: . jmdstrukturweb/templates jmdstrukturweb/templates/phase

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Jun 22 15:41:37 CEST 2010


Author: torsten
Date: 2010-06-22 15:41:36 +0200 (Tue, 22 Jun 2010)
New Revision: 3063

Added:
   jmd/trunk/jmdstrukturweb/templates/phase/
   jmd/trunk/jmdstrukturweb/templates/phase/phase.mako
Modified:
   jmd/trunk/ChangeLog
Log:
Added specific template for phases in jmdstruktur (without duration)


Modified: jmd/trunk/ChangeLog
===================================================================
--- jmd/trunk/ChangeLog	2010-06-22 13:40:29 UTC (rev 3062)
+++ jmd/trunk/ChangeLog	2010-06-22 13:41:36 UTC (rev 3063)
@@ -5,6 +5,7 @@
 	* jmdstrukturweb/i18n/de/LC_MESSAGES/mpulsweb.po, 
 	  jmdstrukturweb/i18n/de/LC_MESSAGES/mpulsweb.mo: Changed some labels
 	  (not all) "case-management" -> "strukturdaten". "phase" -> "status"
+	* development-combined.ini: Fixed default config file.
 
 2010-06-21 Roland Geider <roland.geider at intevation.de>
 	

Added: jmd/trunk/jmdstrukturweb/templates/phase/phase.mako
===================================================================
--- jmd/trunk/jmdstrukturweb/templates/phase/phase.mako	2010-06-22 13:40:29 UTC (rev 3062)
+++ jmd/trunk/jmdstrukturweb/templates/phase/phase.mako	2010-06-22 13:41:36 UTC (rev 3063)
@@ -0,0 +1,117 @@
+## -*- coding: utf-8 -*-
+<%inherit file="../casemanagement/main.mako" />
+<%def name="buildNavipath()">
+  ${parent.buildNavipath()}
+  <li><a href="${h.url_for(controller='/case')}">${_('cm_np_root')}</a></li>
+  <li><a href="${h.url_for(controller='/case', action='select', id=session.get('case').id)}">${_('cm_np_select')}</a></li>
+  <li><a href="#">${_('case_cm_phase')}</a></li>
+</%def>
+
+% if c.global_warnings:
+<div class="form_errors">${c.global_warnings}</div>
+% endif
+
+<h2>${_('case_cm_phase')}</h2>
+<div class="widget container">
+  <form method="POST" action="${h.url_for(controller='/phase', action='editAction')}">
+    <input type="hidden" name="case_id" value="${session.get('case').id}">
+    <table id="cmphases">
+      <% is_allowed = h.hasRole(('cm_ka',)) %>
+      <tr>
+        <th>${_('cm_info_phase')}</th>
+        <th width="15px">&nbsp;</th>
+        <th width="50%">${_('case_cm_phase_required_fields')}</th>
+        <th>${_('case_cm_phase_time')}</th>
+        <th class="actions">
+        % if is_allowed:
+        ${_('Actions')}
+        % 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 ''}">
+        <td rowspan="2" class="bold center middle">
+          ${phase.getDescription()}<br>
+          <span class="note">
+          % if p1.is_active():
+            ${_('Running')}
+          % elif p2.is_active():
+            ${_('Finished')}
+          % 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')}
+          % endif
+          </span>
+        </td>
+        % if p1.is_ok() and (c.phases.is_on_path(p1.id, current_phase,True) or c.phases.is_on_path(current_phase, p1.id, True)): 
+
+        <td class="ok"></td>
+        % else:
+        <td class="error"></td>
+        % endif
+        <td class="note" style="border-bottom: 1pt dotted; border-color: #000;">${h.literal(p1.getLinks())}</td>
+        <td class="note center middle" style="border-bottom: 1pt dotted; border-color: #000;">
+          ${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 p1.is_neighbor(current_phase):
+            <input type="submit" name="${p1.id}" value="${_('Start')}">
+          % else:
+            <input type="submit" name="${p1.id}" value="${_('Start')}" disabled="disabled">
+          % endif
+        </td>
+      </tr>
+      <tr class="${(num%2) and 'hl' or ''}">
+        % if p2.is_ok() and (c.phases.is_on_path(p2.id, current_phase, True) or c.phases.is_on_path(current_phase, p2.id, True)): 
+        <td class="ok"></td>
+        % else:
+        <td class="error"></td>
+        % endif
+        <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 p2.is_neighbor(current_phase):
+            <input type="submit" name="${p2.id}" value="${_('Finish')}">
+          % else:
+            <input type="submit" name="${p2.id}" value="${_('Finish')}" disabled="disabled">
+          % endif
+        </td>
+      </tr>
+      % endfor
+    </table>
+  </form>
+</div>
+
+####
+#### DAUER DER PHASEN
+####
+##<h2>${_('Duration of phases')}</h2>
+##<div class="widget container">
+##  <% total = None %>
+##  <table>
+##    <tr>
+##      <th>${_('Phase')}</th>
+##      <th class="actions">${_('Duration in weeks')}</th>
+##    </tr>
+##    % for num, phase in enumerate(c.phases): 
+##      <% 
+##        t = phase.getDuration() 
+##        if t: total = total and (total + t) or t
+##      %>
+##      <tr class="${num%2 and 'hl' or ''}">
+##        <td>${phase.getDescription()}</td>
+##        <td class="actions">${h.NA(h.timedelta_in_weeks(t))}</td>
+##      </tr>
+##    % endfor
+##    <tr>
+##      <td style="border-top:1px solid"><strong>Gesamt</strong></td>
+##      <td style="border-top:1px solid; text-align:right">
+##        <strong>${h.timedelta_in_weeks(total, '-/-')}</strong>
+##      </td>
+##    </tr>
+##      </table>
+##</div>



More information about the Mpuls-commits mailing list