[Mpuls-commits] r550 - in wasko/trunk: . waskaweb/controllers waskaweb/public/styles waskaweb/templates/formularpage

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Jul 28 10:05:57 CEST 2009


Author: torsten
Date: 2009-07-28 10:05:56 +0200 (Tue, 28 Jul 2009)
New Revision: 550

Modified:
   wasko/trunk/ChangeLog.txt
   wasko/trunk/waskaweb/controllers/formularpage.py
   wasko/trunk/waskaweb/public/styles/print.css
   wasko/trunk/waskaweb/templates/formularpage/formular.mako
Log:
Make printing of formularpages work again.


Modified: wasko/trunk/ChangeLog.txt
===================================================================
--- wasko/trunk/ChangeLog.txt	2009-07-28 07:42:07 UTC (rev 549)
+++ wasko/trunk/ChangeLog.txt	2009-07-28 08:05:56 UTC (rev 550)
@@ -54,6 +54,14 @@
 	  waskaweb/controllers/annotations.py: Copied new controller and
 	  template from mpuls-ng.
 
+	Make printing of a formularpage work again
+
+	* waskaweb/controllers/formularpage.py,
+	  waskaweb/public/styles/print.css,
+	  waskaweb/templates/formularpage/formular.mako: Added new function to
+	  formularpage to handle print requests. Added new styles for
+	  printing.
+
 2009-07-16	Torsten Irlaender  <torsten.irlaender at intevation.de> 
 
 	Set version to 1.0.5

Modified: wasko/trunk/waskaweb/controllers/formularpage.py
===================================================================
--- wasko/trunk/waskaweb/controllers/formularpage.py	2009-07-28 07:42:07 UTC (rev 549)
+++ wasko/trunk/waskaweb/controllers/formularpage.py	2009-07-28 08:05:56 UTC (rev 550)
@@ -121,3 +121,14 @@
             raise # Saving failed with unknown reason! Raise exception ->
                   # should result in a bugreport dialog if enabled.
         return self.select(page_id)
+
+    @checkRole(('admin_ka', 'cm_ka', 'pt_dlr'))
+    def printout(self, id):
+        c.print_version = 1
+        render_mode = session['render_mode']
+        session['render_mode'] = 'ro'
+        session.save()
+        page = self.select(id)
+        session['render_mode'] = render_mode 
+        session.save()
+        return page 

Modified: wasko/trunk/waskaweb/public/styles/print.css
===================================================================
--- wasko/trunk/waskaweb/public/styles/print.css	2009-07-28 07:42:07 UTC (rev 549)
+++ wasko/trunk/waskaweb/public/styles/print.css	2009-07-28 08:05:56 UTC (rev 550)
@@ -98,6 +98,10 @@
 	display:none;
 }
 
+.left {
+	display: none;
+}
+
 .menu h1, .menu li a, .menu ul, #navipath, #startmenu, #statusbar,
 #modusfield, #logo, .help, #footer, .skiplink, .table_action, .print_menu_header, #status_str_nofloat {
 	display: none;
@@ -108,7 +112,7 @@
 }
 
 table td, table th {
-	border-bottom:0.5pt solid;
+	/*border-bottom:0.5pt solid;*/
 }
 
 fieldset {

Modified: wasko/trunk/waskaweb/templates/formularpage/formular.mako
===================================================================
--- wasko/trunk/waskaweb/templates/formularpage/formular.mako	2009-07-28 07:42:07 UTC (rev 549)
+++ wasko/trunk/waskaweb/templates/formularpage/formular.mako	2009-07-28 08:05:56 UTC (rev 550)
@@ -34,7 +34,7 @@
             <li><a href="/formularpage/show/${c.page_id}" onclick="return checkModification();"> ${_('cm_actions_link_show')}</a></li>
           % endif
         % endif
-        <li><a href="${h.getPrintUrl(c.print_form, c.ds_id, c.page_id)}" target="_blank" onclick="return checkModification();"> ${_('cm_actions_link_printout')}</a></li>
+        <li><a href="/formularpage/printout/${c.page_id}" target="_blank" onclick="return checkModification();"> ${_('cm_actions_link_printout')}</a></li>
       </ul>
     </div>
   </div>



More information about the Mpuls-commits mailing list