[Mpuls-commits] r978 - in wasko/branches/2.0: . waskaweb/templates/casemanagement

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Jan 28 12:14:51 CET 2010


Author: bh
Date: 2010-01-28 12:14:41 +0100 (Thu, 28 Jan 2010)
New Revision: 978

Modified:
   wasko/branches/2.0/ChangeLog
   wasko/branches/2.0/waskaweb/templates/casemanagement/digest_body.mako
Log:
* waskaweb/templates/casemanagement/digest_body.mako: Generate the
digest from a list of fields.  This is now a more generic digest
which needs to be adapted to specific MPuls applications.


Modified: wasko/branches/2.0/ChangeLog
===================================================================
--- wasko/branches/2.0/ChangeLog	2010-01-28 11:12:38 UTC (rev 977)
+++ wasko/branches/2.0/ChangeLog	2010-01-28 11:14:41 UTC (rev 978)
@@ -1,5 +1,11 @@
 2010-01-28  Bernhard Herzog  <bh at intevation.de>
 
+	* waskaweb/templates/casemanagement/digest_body.mako: Generate the
+	digest from a list of fields.  This is now a more generic digest
+	which needs to be adapted to specific MPuls applications.
+
+2010-01-28  Bernhard Herzog  <bh at intevation.de>
+
 	* waskaweb/model/case.py (CaseDigest.getDescription)
 	(CaseDigest.getValue): New methods to return the description and
 	value of a formed field.

Modified: wasko/branches/2.0/waskaweb/templates/casemanagement/digest_body.mako
===================================================================
--- wasko/branches/2.0/waskaweb/templates/casemanagement/digest_body.mako	2010-01-28 11:12:38 UTC (rev 977)
+++ wasko/branches/2.0/waskaweb/templates/casemanagement/digest_body.mako	2010-01-28 11:14:41 UTC (rev 978)
@@ -1,5 +1,32 @@
 ## -*- coding: utf-8 -*-
-<%!  import waskaweb.lib.filters as F %>
+<%!  import waskaweb.lib.filters as F
+
+fields = [
+         "name",
+         "vorname",
+         "fn",
+         "geburtsdatum",
+         "addresse_strasse",
+         "addresse_strassenr",
+         "addresse_plz",
+         "addresse_ort",
+         "addresse_vorwahl",
+         "addresse_telefonnummer",
+         "addresse_weiteretelefonnummern",
+         "addresse_email",
+         "mutter_vn",
+         "mutter_n",
+         "mutter_vorwahl",
+         "mutter_telefonnummer",
+         "mutter_email",
+         "vater_vn",
+         "vater_n",
+         "vater_vorwahl",
+         "vater_telefonnummer",
+         "vater_email",
+         ]
+
+ %>
 <div id="content_header_small">
   <div id="content_ueberschrift">
 ${_('cm_header_digest')}
@@ -49,138 +76,17 @@
   </p>
   % endif
 % endif
+
 <h2>${_('cm_header_digest_youth')}</h2>
 <table>
-  <tr>
-    <td>
-      <table class="digest_table_left">
-              <tr>
-                      <td class="label hl">${_('cm_digest_tbl_label_lastname')}</td>
-                      <td class="hl">${c.digest.last_name | F.NA, h}</td>
-              </tr>
-              <tr>
-                      <td class="label">${_('cm_digest_tbl_label_firstname')}</td>
-                      <td class="">${c.digest.first_name | F.NA, h}</td>
-              </tr>
-              <tr>
-                      <td class="label hl">${_('cm_digest_tbl_label_caseid')}</td>
-                      <td class="hl">${c.digest.knr | F.NA, h}</td>
-              </tr>
-              <tr>
-                      <td class="label">${_('cm_digest_tbl_label_age')}</td>
-                      <td class="">${c.digest.age | F.NA, h}</td>
-              </tr>
-              <tr>
-                      <td class="label hl">${_('cm_digest_tbl_label_email')}</td>
-                      % if c.digest.email != "None":
-                        <td class="hl"><a href="mailto:${c.digest.email | F.NA, h}">${c.digest.email | F.NA, h}</a></td>
-                      % else:
-                        <td class="hl">${c.digest.email | F.NA, h}</td>
-                      % endif
-              </tr>
-      </table>
-    </td>
-    <td>
-      <table class="digest_table_right">
-              <tr>
-                      <td class="label hl">${_('cm_digest_tbl_label_street')}</td>
-                      <td class="hl">${c.digest.street | F.NA, h} / ${c.digest.streetnr | F.NA, h}</td>
-              </tr>
-              <tr>
-                      <td class="label">${_('cm_digest_tbl_label_plz')}</td>
-                      <td class="">${c.digest.plz | F.NA, h}</td>
-              </tr>
-              <tr>
-                      <td class="label hl">${_('cm_digest_tbl_label_city')}</td>
-                      <td class="hl">${c.digest.city | F.NA, h}</td>
-              </tr>
-              <tr>
-                      <td class="label">${_('cm_digest_tbl_label_telephone')}</td>
-                      <td class="">(${c.digest.telephone_1 | F.NA, h}) ${c.digest.telephone_2 | F.NA, h}</td>
-              </tr>
-              <tr>
-                      <td class="label hl">${_('cm_digest_tbl_label_telephone_more')}</td>
-                      <td class="hl">${c.digest.telephone_more | F.NA, h, F.nl_to_br}</td>
-              </tr>
-      </table>
-    </td>
-  </tr>
+  % for num, name in enumerate(fields):
+    <tr class="${num % 2 and 'hl' or ''}">
+      <td class="label">${c.digest.getDescription(name)}</td>
+      <td>${c.digest.getValue(name) | F.NA, h}</td>
+    </tr>
+  % endfor
 </table>
 
-<h2>${_('cm_header_digest_parent')}</h2>
-<h3>Mutter</h3>
-<table>
-  <tr>
-    <td>
-      <table class="digest_table_left">
-        <tr>
-          <td class="label hl">${_('cm_digest_tbl_label_lastname')}</td>
-          <td class="hl">${c.digest.mother_last_name | F.NA, h}</td>
-        </tr>
-        <tr>
-          <td class="label">${_('cm_digest_tbl_label_firstname')}</td>
-          <td class="">${c.digest.mother_first_name | F.NA, h}</td>
-        </tr>
-      </table>
-    </td>
-    <td>
-      <table class="digest_table_right"> 
-        <tr>
-          <td class="label hl">${_('cm_digest_tbl_label_telephone')}</td>
-          <td class="hl">(${c.digest.mother_telephone_1 | F.NA, h}) ${c.digest.mother_telephone_2| F.NA, h}</td>
-        </tr>
-        <tr>
-          <td class="label">${_('cm_digest_tbl_label_email')}</td>
-          % if c.digest.mother_email != "None":
-            <td class=""><a href="mailto:${c.digest.mother_email | F.NA, h}">${c.digest.mother_email | F.NA, h}</a></td>
-          % else:
-            <td class="">${c.digest.mother_email | F.NA, h}</td>
-          % endif
-        </tr>
-        <tr>
-          <td colspan="2">&nbsp;</td>
-        </tr>
-      </table>
-    </td>
-  </tr>
-</table>
-<h3>Vater</h3>
-<table>
-  <tr>
-    <td>
-      <table class="digest_table_left">
-        <tr>
-          <td class="label hl">${_('cm_digest_tbl_label_lastname')}</td>
-          <td class="hl">${c.digest.father_last_name | F.NA, h}</td>
-        </tr>
-        <tr>
-          <td class="label">${_('cm_digest_tbl_label_firstname')}</td>
-          <td class="">${c.digest.father_first_name | F.NA, h}</td>
-        </tr>
-      </table>
-    </td>
-    <td>
-      <table class="digest_table_right"> 
-        <tr>
-          <td class="label hl">${_('Telefon')}</td>
-          <td class="hl">(${c.digest.father_telephone_1 | F.NA, h}) ${c.digest.father_telephone_2 | F.NA, h}</td>
-        </tr>
-        <tr>
-          <td class="label">${_('cm_digest_tbl_label_email')}</td>
-          % if c.digest.father_email != "None":
-            <td class=""><a href="mailto:${c.digest.father_email | F.NA, h}">${c.digest.father_email | F.NA, h}</a></td>
-          % else:
-            <td class="">${c.digest.father_email | F.NA, h}</td>
-          % endif
-        </tr>
-        <tr>
-          <td colspan="2">&nbsp;</td>
-        </tr>
-      </table>
-    </td>
-  </tr>
-</table>
-
 <%def name="buildModusfield()">
   <div id="modusfield">
     <div class="actions">



More information about the Mpuls-commits mailing list