[Mpuls-commits] r2588 - wasko/branches/2.0/mpulsweb/templates/casemanagement
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Mon May 3 12:49:21 CEST 2010
Author: torsten
Date: 2010-05-03 12:49:20 +0200 (Mon, 03 May 2010)
New Revision: 2588
Modified:
wasko/branches/2.0/mpulsweb/templates/casemanagement/caselist.mako
Log:
* mpulsweb/templates/casemanagement/caselist.mako: Display current
phase of each case in overview. Added legend to explain phase
shortdescriptions.
Modified: wasko/branches/2.0/mpulsweb/templates/casemanagement/caselist.mako
===================================================================
--- wasko/branches/2.0/mpulsweb/templates/casemanagement/caselist.mako 2010-05-03 10:47:55 UTC (rev 2587)
+++ wasko/branches/2.0/mpulsweb/templates/casemanagement/caselist.mako 2010-05-03 10:49:20 UTC (rev 2588)
@@ -86,6 +86,9 @@
% endif
% endfor
<th class="table_status table_header_h">
+ ${_('Phase')}
+ </th>
+ <th class="table_status table_header_h">
${_('cm_overview_tbl_header_status')}
</th>
<th class="table_action table_header_h">
@@ -103,6 +106,9 @@
% endif
% endfor
<td>
+ ${get_phase_icon(case)}
+ </td>
+ <td>
${get_state_icon(case)}
</td>
<td>
@@ -110,6 +116,37 @@
</td>
</%def>
+<%def name="get_phase_icon(case)">
+ <% phase = case.getState().getPhase() %>
+ <% running = not phase%2 %>
+ % if phase == -1:
+ ${g.mpuls_config.get('phases', 'shortdescription')[0]['-1']}
+ % else:
+ % for k,p in g.mpuls_config.get('phases', 'pairs')[0].iteritems():
+ % if str(phase) in p:
+ % if running:
+ ${g.mpuls_config.get('phases', 'shortdescription')[0][k]} (L)
+ % else:
+ ${g.mpuls_config.get('phases', 'shortdescription')[0][k]} (B)
+ % endif
+ % endif
+ % endfor
+ % endif
+</%def>
+
+<%def name="render_phase_legend()">
+<% legend = [] %>
+<div class="container widget info">
+ <strong>${_('Legend')}: </strong>
+ % for p in g.mpuls_config.get('phases', 'phases'):
+ ${legend.append("%s: %s" % (g.mpuls_config.get('phases', 'shortdescription')[0][p], g.mpuls_config.get('phases', 'description')[0][p]))}
+ % endfor
+ ${", ".join(legend)}
+ | (L): Laufend, (B): Beendet
+</div>
+<br>
+</%def>
+
<%def name="get_state_icon(case)">
% if h.hasRole(['cm_ka']):
% if str(case.getEditor().id) == str(session.get('USER_AUTHORIZED').id):
@@ -196,3 +233,4 @@
</tr>
% endif
</table>
+${render_phase_legend()}
More information about the Mpuls-commits
mailing list