[Mpuls-commits] r5330 - in base/trunk/mpulsweb: controllers templates/formularpage

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Sep 14 15:52:21 CEST 2011


Author: ludwig
Date: 2011-09-14 15:52:21 +0200 (Wed, 14 Sep 2011)
New Revision: 5330

Added:
   base/trunk/mpulsweb/templates/formularpage/formular_print.mako
Modified:
   base/trunk/mpulsweb/controllers/case.py
Log:
Issue 1258: Created a new formular_print.mako for the print.


Modified: base/trunk/mpulsweb/controllers/case.py
===================================================================
--- base/trunk/mpulsweb/controllers/case.py	2011-09-14 11:52:25 UTC (rev 5329)
+++ base/trunk/mpulsweb/controllers/case.py	2011-09-14 13:52:21 UTC (rev 5330)
@@ -336,8 +336,8 @@
         render_mode = session['render_mode']
         session['render_mode'] = 'ro'
         session.save()
-        digest = render('/casemanagement/digest_body.mako')
-        out.append(digest)
+        #digest = render('/casemanagement/digest_body.mako')
+        #out.append(digest)
         printed_headings = set()
         navigation = session.get('navigation.tree')
         if navigation:
@@ -364,7 +364,7 @@
         c.formular = "".join(out)
         session['render_mode'] = render_mode
         session.save()
-        return render('/formularpage/formular.mako')
+        return render('/formularpage/formular_print.mako')
 
     #
     # Create new case

Added: base/trunk/mpulsweb/templates/formularpage/formular_print.mako
===================================================================
--- base/trunk/mpulsweb/templates/formularpage/formular_print.mako	2011-09-14 11:52:25 UTC (rev 5329)
+++ base/trunk/mpulsweb/templates/formularpage/formular_print.mako	2011-09-14 13:52:21 UTC (rev 5330)
@@ -0,0 +1,70 @@
+## -*- coding: utf-8 -*-
+<%inherit file="/casemanagement/main.mako"/>
+<%!
+   from mpulsweb.lib.navigation import get_pagename, render_navigation
+%>
+
+<%inherit file="/casemanagement/digest.mako" />
+<%!  import mpulsweb.lib.helper.filters as F %>
+
+${self.renderMaxSavetimeInfo(c.case)}
+${self.renderCaseStateInfo(c.case)}
+${self.renderCaseInfo(c.case)}
+
+${h.literal(c.formular)}
+
+<%def name="buildNavipath()">
+      	${parent.buildNavipath()}
+	<li><a href="${h.url_for(controller='/case', action='select',
+                                 id=session.get('case').id, confirmed=1)}"
+               onclick="return checkModification();">${_('Selected case documents')}</a></li>
+        % if session.get('render_mode') == 'ro':
+	<li><a href="${h.url_for(controller='/formularpage', action='show',
+                                 id=c.page_id)}"
+               onclick="return checkModification();">${get_pagename(c.page_id)}</a></li>
+        % else:
+	<li><a href="${h.url_for(controller='/formularpage', action='edit',
+                                 id=c.page_id)}" 
+               onclick="return checkModification();">${get_pagename(c.page_id)}</a></li>
+        % endif
+</%def>
+
+<%def name="buildModusfield()">
+  <div id="modusfield">
+    <div id="modusinfo">
+    % if session.get('render_mode') == 'ro':
+      <h5>Ansichtsmodus</h5>
+    % else:
+      <h5>Bearbeitungsmodus</h5>
+    % endif
+    </div>
+    <div class="actions">
+      <ul>
+        % if h.hasRole(['cm_ka']) and session.get('case').getState().state not in (3,4,5):
+          % if session.get('render_mode') == 'ro':
+            <li><a href="${h.url_for(controller='/formularpage', action='edit',
+                                     id=c.page_id)}" 
+                   onclick="return checkModification();"> ${_('Edit')}</a></li>
+          % else:
+            <li><a href="${h.url_for(controller='/formularpage', action='show',
+                                     id=c.page_id)}" 
+                   onclick="return checkModification();"> ${_('Close editing')}</a></li>
+          % endif
+        % endif
+        <li><a href="${h.url_for(controller='/formularpage', action='printout',
+                                 id=c.page_id)}" 
+               target="_blank" onclick="return checkModification();"> ${_('Printout')}</a></li>
+      </ul>
+    </div>
+  </div>
+</%def>
+
+<%def name="buildContentHeader()">
+  <div id="content_header">
+    %if not c.print_version:
+      <div id="content_ueberschrift">${h.literal(c.formularheader)}</div>
+    %endif
+    ${self.buildModusfield()}
+  </div><br>
+  <br>
+</%def>



More information about the Mpuls-commits mailing list