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

scm-commit at wald.intevation.org scm-commit at wald.intevation.org
Tue Aug 21 12:25:44 CEST 2012


Author: torsten
Date: 2012-08-21 12:25:44 +0200 (Tue, 21 Aug 2012)
New Revision: 6035

Modified:
   base/trunk/mpulsweb/templates/casemanagement/caselist.mako
Log:
Render status of linkage of a case with the Meta-Server in the status column
and not as datacolumn.


Modified: base/trunk/mpulsweb/templates/casemanagement/caselist.mako
===================================================================
--- base/trunk/mpulsweb/templates/casemanagement/caselist.mako	2012-08-21 10:24:50 UTC (rev 6034)
+++ base/trunk/mpulsweb/templates/casemanagement/caselist.mako	2012-08-21 10:25:44 UTC (rev 6035)
@@ -37,17 +37,6 @@
     (_('Updated'), "zugriff", "table_name", ["cm"],
      lambda case: h.format_date(case.state.getAccessTime())),
   ])
-if g.mpuls_config.is_enabled('case-module', 'meta-server'):
-    ## TODO Improve the performance of this solution.
-    ## For every case a meta object is loaded from the db.
-    def yes_no(b):
-    	if b:
-	    return _('Yes')
-	else:
-	    return _('No')
-
-    fields.append((_('Sync'), 'linked', 'table_name', ["cm", "admin"],
-                    lambda case: yes_no(case.getMeta().is_linked())))
 %>
 
 <%def name="build_list_headers()">
@@ -129,6 +118,7 @@
         ${get_validity_icon(case)}
     % endif
     ${get_state_icon(case)}
+    ${get_sync_icon(case)}
   </td>
   <td>
     ${get_actions(case)}
@@ -177,6 +167,22 @@
 <br>
 </%def>
 
+<%def name="get_sync_icon(case)">
+  % if g.mpuls_config.is_enabled('case-module', 'meta-server'):
+    % if case.getMeta().is_linked():
+      <img src    = "${h.url('/images/icons/air-link-ok.png')}"
+           border = "0"
+           alt    = "${_('Case is linked with AiR-Server')}"
+           title  = "${_('Case is linked with AiR-Server')}">
+    % else:
+      <img src    = "${h.url('/images/icons/air-link-notok.png')}"
+           border = "0"
+           alt    = "${_('Case is not linked with AiR-Server')}"
+           title  = "${_('Case is not linked with AiR-Server')}">
+    % endif
+  % endif
+</%def>
+
 <%def name="get_state_icon(case)">
   % if h.hasRole(['cm']) and g.mpuls_config.is_enabled('case-module', 'organisation'):
     % if case.user_is_editor(session.get('USER_AUTHORIZED').id):



More information about the Mpuls-commits mailing list