[Mpuls-commits] r3986 - jmd/trunk/jmdstrukturweb/templates/phase

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


Author: torsten
Date: 2010-10-20 11:09:36 +0200 (Wed, 20 Oct 2010)
New Revision: 3986

Modified:
   jmd/trunk/jmdstrukturweb/templates/phase/phase.mako
Log:
* jmdstrukturweb/templates/phase/phase.mako: Updated Layout of the
	phase overview page. Took over display of icons instead of colors for
	indicating that something is wrong with the phases.


Modified: jmd/trunk/jmdstrukturweb/templates/phase/phase.mako
===================================================================
--- jmd/trunk/jmdstrukturweb/templates/phase/phase.mako	2010-10-20 09:03:09 UTC (rev 3985)
+++ jmd/trunk/jmdstrukturweb/templates/phase/phase.mako	2010-10-20 09:09:36 UTC (rev 3986)
@@ -19,18 +19,21 @@
       <% is_allowed = h.hasRole(('cm_ka',)) %>
       <tr>
         <th>${_('cm_info_phase')}</th>
-        <th width="15px">&nbsp;</th>
+        <th width="25px">&nbsp;</th>
         <th width="50%">${_('case_cm_phase_required_fields')}</th>
         <th>${_('case_cm_phase_time')}</th>
-        <th class="actions">
-        % if is_allowed:
-        ${_('Actions')}
+        % if c.show_actions:
+          <th class="actions">
+            % if is_allowed:
+              ${_('Actions')}
+            % endif
+          </th>
         % 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): 
+      <% if phase.id == "-1" and g.mpuls_config.is_enabled('phases', 'hideunknown'): continue  %>
 
       <% p1, p2 = phase.getStart(), phase.getEnd()  %>
       ## Only show phases which are are on the path of the current phase, or
@@ -42,7 +45,7 @@
         or current_phase == '-1':
         <tr class="${(num%2) and 'hl' or ''}">
           <td rowspan="2" class="bold center middle">
-            ${phase.getDescription()}<br>
+            ${h.literal(phase.getDescription())}<br>
             <span class="note">
             % if p1.is_active():
               ${_('Running')}
@@ -55,59 +58,74 @@
             % endif
             </span>
           </td>
+          <td class="middle">
           % 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>
+            <img src="${h.url_for('/images/icons/info/ok_22.png')}" alt="Ok">
           % else:
-          <td class="error"></td>
+            <img src="${h.url_for('/images/icons/info/failure_22.png')}" alt="Error">
           % endif
+          </td>
           <td class="note" style="border-bottom: 1pt dotted; border-color: #000;">
             <% pages, order = p1.getLinks() %>
-            % for key in order:
-              <% fields = pages.get(key, []) %>
-              % if len(fields) > 0:
-                <strong>${key}</strong>:
-                ${h.literal(", ".join([f.get_link() for f in fields]))}
-              % endif
-              <br>
-            % endfor
+            % if len(pages) > 0:
+              % for key in order:
+                <% fields = pages.get(key, []) %>
+                % if len(fields) > 0:
+                  <strong>${key}</strong>:
+                  ${h.literal(", ".join([f.get_link() for f in fields]))}
+                % endif
+                <br>
+              % endfor
+            % else:
+              ${_('No required fields found')} 
+            % endif
           </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) and h.hasRole(['cm']) and session.get('case').getState().getState() == 1:
-              <input type="submit" name="${p1.id}" value="${_('Start')}">
-            % else:
-              <input type="submit" name="${p1.id}" value="${_('Start')}" disabled="disabled">
-            % endif
+          % if c.show_actions:
+            <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) and h.hasRole(['cm']) and session.get('case').getState().getState() == 1:
+                <input type="submit" name="${p1.id}" value="${_('Start')}">
+              % else:
+                <input type="submit" name="${p1.id}" value="${_('Start')}" disabled="disabled">
+              % endif
           </td>
+          % endif
         </tr>
         <tr class="${(num%2) and 'hl' or ''}">
+          <td class="middle">
           % 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>
+            <img src="${h.url_for('/images/icons/info/ok_22.png')}" alt="Ok">
           % else:
-          <td class="error"></td>
+            <img src="${h.url_for('/images/icons/info/failure_22.png')}" alt="Error">
           % endif
+          </td>
           <td class="note">
             <% pages, order = p2.getLinks() %>
-            % for key in order:
-              <% fields = pages.get(key) %>
-              % if len(fields) > 0:
-                <strong>${key}</strong>:
-                ${h.literal(", ".join([f.get_link() for f in fields]))}
-              % endif
-              <br>
-            % endfor
-          </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) and h.hasRole(['cm']) and session.get('case').getState().getState() == 1:
-              <input type="submit" name="${p2.id}" value="${_('Finish')}">
+            % if len(pages) > 0:
+              % for key in order:
+                <% fields = pages.get(key) %>
+                % if len(fields) > 0:
+                  <strong>${key}</strong>:
+                  ${h.literal(", ".join([f.get_link() for f in fields]))}
+                % endif
+                <br>
+              % endfor
             % else:
-              <input type="submit" name="${p2.id}" value="${_('Finish')}" disabled="disabled">
+              ${_('No required fields found')}
             % endif
           </td>
+          <td class="note center middle">${h.NA(h.format_date(p2.getTime()))}</td>
+          % if c.show_actions:
+            <td class="actions">
+              % if p2.is_ok() and phases_are_valid and p2.is_neighbor(current_phase) and h.hasRole(['cm']) and session.get('case').getState().getState() == 1:
+                <input type="submit" name="${p2.id}" value="${_('Finish')}">
+              % else:
+                <input type="submit" name="${p2.id}" value="${_('Finish')}" disabled="disabled">
+              % endif
+            </td>
+          % endif
         </tr>
       % endif
       % endfor



More information about the Mpuls-commits mailing list