[Mpuls-commits] r85 - in waska/trunk: . waskaweb/controllers waskaweb/public/styles waskaweb/templates/logbook

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Aug 21 12:18:56 CEST 2008


Author: torsten
Date: 2008-08-21 12:18:56 +0200 (Thu, 21 Aug 2008)
New Revision: 85

Added:
   waska/trunk/waskaweb/templates/logbook/overview_print.mako
Modified:
   waska/trunk/ChangeLog.txt
   waska/trunk/waskaweb/controllers/case.py
   waska/trunk/waskaweb/public/styles/all.css
   waska/trunk/waskaweb/templates/logbook/overview.mako
Log:
Implemented printing of logbook


Modified: waska/trunk/ChangeLog.txt
===================================================================
--- waska/trunk/ChangeLog.txt	2008-08-21 10:13:05 UTC (rev 84)
+++ waska/trunk/ChangeLog.txt	2008-08-21 10:18:56 UTC (rev 85)
@@ -23,6 +23,14 @@
 	* formed/waska-hilfetexte.xhtml: New helptext
 	* formed/formedtree_web.xml: Added fixed formedtree
 
+	Implemented print version of logbook
+
+	* waskaweb/controllers/case.py: New controller for printing
+	* waskaweb/public/styles/all.css: New class to remove border
+	* waskaweb/templates/logbook/overview_print.mako,
+	  waskaweb/templates/logbook/overview.mako,
+	  ChangeLog.txt: New template and linked printing
+
 2008-08-20  Sascha L. Teichmann <sascha.teichmann at intevation.de>
 
 	* waskaweb/public/images/icons/required_12x12.png,

Modified: waska/trunk/waskaweb/controllers/case.py
===================================================================
--- waska/trunk/waskaweb/controllers/case.py	2008-08-21 10:13:05 UTC (rev 84)
+++ waska/trunk/waskaweb/controllers/case.py	2008-08-21 10:18:56 UTC (rev 85)
@@ -644,6 +644,21 @@
         return render('/casemanagement/appointments.mako')
 
     @checkRole(('admin_ka', 'cm_ka'))
+    def printLogbook(self, id):
+        id                 = self._checkInt(id)
+        case               = self._loadCase(id)
+        c.ds_id            = id
+        c.form_navigation  = self._getFormNavigation()
+        c.print_version = 1 
+        logbook = Logbook()
+        logbook.loadById(id)
+        c.logbook = logbook
+
+        # Evaluation
+        # c.eval_effort = logbook.getEvaluation()
+        return render('/logbook/overview_print.mako')
+
+    @checkRole(('admin_ka', 'cm_ka'))
     def logbook(self, id, sort_field='datum', sort_order='desc'):
         id                 = self._checkInt(id)
         case               = self._loadCase(id)

Modified: waska/trunk/waskaweb/public/styles/all.css
===================================================================
--- waska/trunk/waskaweb/public/styles/all.css	2008-08-21 10:13:05 UTC (rev 84)
+++ waska/trunk/waskaweb/public/styles/all.css	2008-08-21 10:18:56 UTC (rev 85)
@@ -10,11 +10,16 @@
 /*------------------------------*/
 
 
+.noborder {
+	border:none;
+}
+
 /*------------------*/
 /* 1. Table Formats */
 /*------------------*/
 
 /*label a, label input, select {
+ *
 	margin-bottom:0.2em;
 }*/
 
@@ -46,6 +51,7 @@
 }
 
 table td.label {
+	vertical-align: top; 
 	font-weight: bold; 
 }
 

Modified: waska/trunk/waskaweb/templates/logbook/overview.mako
===================================================================
--- waska/trunk/waskaweb/templates/logbook/overview.mako	2008-08-21 10:13:05 UTC (rev 84)
+++ waska/trunk/waskaweb/templates/logbook/overview.mako	2008-08-21 10:18:56 UTC (rev 85)
@@ -16,6 +16,7 @@
     <div class="actions">
       <ul>
         <li><a href="${h.url_for(controller='/case', action='newLogbookEntry', id=session.get('case').id)}">Eintrag vornehmen</a></li>
+        <li><a href="${h.url_for(controller='/case', action='printLogbook', id=session.get('case').id)}" target="_blank">Druckansicht</a></li>
       </ul>
     </div>
   </div>

Added: waska/trunk/waskaweb/templates/logbook/overview_print.mako
===================================================================
--- waska/trunk/waskaweb/templates/logbook/overview_print.mako	2008-08-21 10:13:05 UTC (rev 84)
+++ waska/trunk/waskaweb/templates/logbook/overview_print.mako	2008-08-21 10:18:56 UTC (rev 85)
@@ -0,0 +1,51 @@
+## -*- coding: utf-8 -*-
+<%inherit file="/casemanagement/main.mako" />
+<%!  import waskaweb.lib.filters as F %>
+<%def name="buildNavipath()">
+  ${parent.buildNavipath()}
+  <li><a href="/case/select/${session.get('case').id}/1">${_('cm_np_select')}</a></li>
+  <li><a href="/case/logbook/${session.get('case').id}">Tagebuch</a></li>
+  <li><a href="#"></a>Einträge</a></li>
+</%def>
+<div id="content_header_small">
+  <div id="content_ueberschrift">
+    Tagebuch 
+  </div>
+  <div id="modusfield">
+    <div class="actions">
+      <ul>
+        <li>
+          <a href="/case/logbook/${session.get('case').id}">Zur&uuml;ck zu: Tagebuch</a>
+        </li>
+      </ul>
+    </div>
+  </div>
+</div>
+% for entry in c.logbook.getEntries():
+  <table>
+      <tbody>
+          <tr>
+              <td class="noborder label table_header_v table_width_long">Datum</td>
+              <td class="noborder table_row_v">${entry.getDate() | h} ${entry.getTime() | h}</td>
+          </tr>
+          <tr>
+              <td class="noborder label">Bearbeiter</td>
+              <td class="noborder table_row_v_2">${entry.getEditor() | h}</td>
+          </tr>
+          <tr>
+              <td class="noborder label table_header_v">Art</td>
+              <td class="noborder table_row_v">${entry.getKind() | h}</td>
+          </tr>
+          <tr>
+              <td class="noborder label">Dauer in Minuten</td>
+              <td class="noborder table_row_v_2">${entry.getDuration('-/-') | h}</td>
+          </tr>
+          <tr>
+              <td class="noborder label table_header_v">Notiz</td>
+              <% description = F.H(F.no_none(entry.notiz)).replace('\n', '<br>') %>
+              <td class="noborder table_row_v">${description | F.NA}</td>
+          </tr>
+      </tbody>
+  </table>
+  <hr>
+% endfor



More information about the Mpuls-commits mailing list