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

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Oct 20 11:51:40 CEST 2010


Author: torsten
Date: 2010-10-20 11:51:40 +0200 (Wed, 20 Oct 2010)
New Revision: 3991

Modified:
   base/trunk/mpulsweb/templates/casemanagement/caselist.mako
Log:
* mpulsweb/templates/casemanagement/caselist.mako: Issue1253: Do not escape phase descriptions. Simplified rendering of phase icons.


Modified: base/trunk/mpulsweb/templates/casemanagement/caselist.mako
===================================================================
--- base/trunk/mpulsweb/templates/casemanagement/caselist.mako	2010-10-20 09:50:02 UTC (rev 3990)
+++ base/trunk/mpulsweb/templates/casemanagement/caselist.mako	2010-10-20 09:51:40 UTC (rev 3991)
@@ -122,49 +122,20 @@
 <%def name="get_phase_icon(case)">
   <% phase = case.getState().getPhase() %>
   <% running = not phase%2 %>
-  % if phase == -1:
-      <span title="${g.mpuls_config.get('phases', 'description')[0]['-1']}">
-            <img src="${h.url_for('/images/icons/validity-background.png')}" alt="">
-      </span>
-       
-      <span style="margin-left:-16px;" title="${g.mpuls_config.get('phases', 'description')[0]['-1']}">
-           <img src="${h.url_for('/images/icons/phase-stop-22.png')}" alt="">
-      </span>
-
-      <span style="color:#2e3436;font-size:large;margin-left:-27px;padding-right:9px;" title="${g.mpuls_config.get('phases', 'description')[0]['-1']}">
-           ${g.mpuls_config.get('phases', 'shortdescription')[0]['-1'][0]}
-      </span>
-  % else:
-    % for k,p in g.mpuls_config.get('phases', 'pairs')[0].iteritems():
-      % if str(phase) in p:
-        % if running:
-          <span title="${g.mpuls_config.get('phases', 'description')[0][k]}">
-            <img src="${h.url_for('/images/icons/validity-background.png')}" alt="">
-          </span>
-          
-          <span style="margin-left:-16px;" title="${g.mpuls_config.get('phases', 'description')[0][k]}">
-            <img src="${h.url_for('/images/icons/phase-running-22.png')}" alt="">
-          </span>
-          
-          <span style="color:#2e3436;font-size:large;margin-left:-27px;padding-right:9px;" title="${g.mpuls_config.get('phases', 'description')[0][k]}">
-            ${g.mpuls_config.get('phases', 'shortdescription')[0][k][0]}
-          </span>
-        % else:
-          <span title="${g.mpuls_config.get('phases', 'description')[0][k]}">
-            <img src="${h.url_for('/images/icons/validity-background.png')}" alt="">
-          </span>
-          
-          <span style="margin-left:-16px;" title="${g.mpuls_config.get('phases', 'description')[0][k]}">
-            <img src="${h.url_for('/images/icons/phase-stop-22.png')}" alt="">
-          </span>
-          
-          <span style="color:#2e3436;font-size:large;margin-left:-27px;padding-right:9px;" title="${g.mpuls_config.get('phases', 'description')[0][k]}">
-            ${g.mpuls_config.get('phases', 'shortdescription')[0][k][0]}
-          </span>
-        % endif
-      % endif
-    % endfor
-  % endif
+  <% description = h.literal(c.phases.get_phase(str(phase)).getDescription())%>
+  <span title="${c.phases.get_phase(str(phase)).getDescription()}">
+    <img src="${h.url_for('/images/icons/validity-background.png')}" alt="">
+  </span>
+  <span style="margin-left:-16px;" title="${description}">
+    % if running:
+      <img src="${h.url_for('/images/icons/phase-running-22.png')}" alt="${description}">
+    % else:
+      <img src="${h.url_for('/images/icons/phase-stop-22.png')}" alt="${description}">
+    %endif
+  </span>
+  <span style="color:#2e3436;font-size:large;margin-left:-27px;padding-right:9px;" title="${description}">
+       ${description[0]}
+  </span>
 </%def>
 
 <%def name="render_phase_legend()">



More information about the Mpuls-commits mailing list