[Mpuls-commits] r5411 - base/trunk/mpulsweb/controllers

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Oct 6 14:12:05 CEST 2011


Author: ludwig
Date: 2011-10-06 14:12:03 +0200 (Thu, 06 Oct 2011)
New Revision: 5411

Modified:
   base/trunk/mpulsweb/controllers/formularpage.py
Log:
Issue2188: use the context print_version var to find the right renderer.
So the ViewRenderer is used, if the web html is displayed and in the print case
the ViewPrintRenderer is used.


Modified: base/trunk/mpulsweb/controllers/formularpage.py
===================================================================
--- base/trunk/mpulsweb/controllers/formularpage.py	2011-10-06 11:53:05 UTC (rev 5410)
+++ base/trunk/mpulsweb/controllers/formularpage.py	2011-10-06 12:12:03 UTC (rev 5411)
@@ -80,8 +80,12 @@
         errors, defaults = convert_error_items(page.getErrors())
         formdata = TreeFormData(instance_tree, shadow=defaults, errors=errors,
                                 node=page)
-        renderer = ViewRenderer(formdata, page.getMeta(), url_factory,
-                                **renderer_kw_args)
+        if c.print_version:
+            renderer = ViewPrintRenderer(formdata, page.getMeta(), url_factory,
+                                         **renderer_kw_args)
+        else:
+            renderer = ViewRenderer(formdata, page.getMeta(), url_factory,
+                                    **renderer_kw_args)
 
     navigation_item = session['navigation.tree'].getTreeItem(id)
     mark_folderopen(navigation_item)



More information about the Mpuls-commits mailing list