[Mpuls-commits] r2862 - base/trunk/mpulsweb/templates/casemanagement

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Jun 3 11:28:36 CEST 2010


Author: torsten
Date: 2010-06-03 11:28:36 +0200 (Thu, 03 Jun 2010)
New Revision: 2862

Modified:
   base/trunk/mpulsweb/templates/casemanagement/caselist.mako
Log:
Ask case object for its validity and show icon.


Modified: base/trunk/mpulsweb/templates/casemanagement/caselist.mako
===================================================================
--- base/trunk/mpulsweb/templates/casemanagement/caselist.mako	2010-06-03 09:25:41 UTC (rev 2861)
+++ base/trunk/mpulsweb/templates/casemanagement/caselist.mako	2010-06-03 09:28:36 UTC (rev 2862)
@@ -105,14 +105,18 @@
   </td>
 </%def>
 
+<%def name="get_validity_icon(case)">
+  % for validity in g.mpuls_config.get('validities', 'enabled'):
+    % if validity['id'] == case.getValidity():  
+      <img src="/images/icons/${validity['icon']}" alt="${validity['name']}" title="${validity['name']} ">
+    % endif
+  % endfor
+</%def>
+
 <%def name="get_phase_icon(case)">
   <% phase = case.getState().getPhase() %>
   <% running = not phase%2 %>
-  <!-- ${case.getTags()} -->
-  <% validities = g.mpuls_config.get('validities', 'enabled') %>
-  <% max_tag = max(case.getTags()) or 1 %>
-  <img src="/images/icons/validity-${validities[max_tag]['id']}-22.png">
-  
+  ${self.get_validity_icon(case)}
   % if phase == -1:
       ${g.mpuls_config.get('phases', 'shortdescription')[0]['-1']}
   % else:



More information about the Mpuls-commits mailing list