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

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Jul 29 12:15:00 CEST 2010


Author: torsten
Date: 2010-07-29 12:14:59 +0200 (Thu, 29 Jul 2010)
New Revision: 3265

Modified:
   base/trunk/mpulsweb/controllers/formularpage.py
Log:
* mpulsweb/controllers/formularpage.py (get_rendered_page): Enumerate
	header of the rendered page if the page is in a RG.


Modified: base/trunk/mpulsweb/controllers/formularpage.py
===================================================================
--- base/trunk/mpulsweb/controllers/formularpage.py	2010-07-29 10:12:22 UTC (rev 3264)
+++ base/trunk/mpulsweb/controllers/formularpage.py	2010-07-29 10:14:59 UTC (rev 3265)
@@ -12,7 +12,8 @@
 from mpulsweb.lib.translation import _
 from pylons.controllers.util import abort, redirect_to
 
-from formed.instance.backends.postgres import DBFactory as InstanceFactory
+from formed.instance.backends.postgres import DBFactory as InstanceFactory, \
+DBRepeatInstanceNode as RepeatInstanceNode
 from formed.instance.tree import SetDataException, RepeatInstanceContainerNode
 
 from mpulsweb.lib.security import checkRole
@@ -21,7 +22,7 @@
 
 from mpulsweb.lib.base import BaseController, render
 from mpulsweb.lib.renderer import ViewRenderer, RepeatGroupRenderer, \
-     ErrorRenderer, apply_hidden_booleans
+     ErrorRenderer, apply_hidden_booleans, get_child_num
 from mpulsweb.lib.helpers import url_for, dd_mm_YYYY as format_date
 
 
@@ -76,8 +77,11 @@
     page = instance_tree.getItem(id)
 
     if page:
+        page_label = page.getMeta().getDescription()
+        if isinstance(page.getParent(), RepeatInstanceNode):
+            page_label += " %s" % get_child_num(page.getParent())
         c.formularheader = ("<h1>%s</h1>"
-                            % escape(page.getMeta().getDescription()))
+                            % escape(page_label))
         if isinstance(page, RepeatInstanceContainerNode):
             renderer = RepeatGroupRenderer(instance_tree, page,
                                            session.get('render_mode',



More information about the Mpuls-commits mailing list