[Mpuls-commits] r2347 - wasko/branches/2.0/mpulsweb/controllers

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Apr 14 15:30:20 CEST 2010


Author: torsten
Date: 2010-04-14 15:30:20 +0200 (Wed, 14 Apr 2010)
New Revision: 2347

Modified:
   wasko/branches/2.0/mpulsweb/controllers/navigation.py
Log:
* mpulsweb/controllers/navigation.py
(NavigationController.open_branch): Fixed navigation. If a case was
first loaded session cound have the wrong value for the currently
selected page. The values are now reseted when load a new case.
selectedpgae will be set new if it is not set.


Modified: wasko/branches/2.0/mpulsweb/controllers/navigation.py
===================================================================
--- wasko/branches/2.0/mpulsweb/controllers/navigation.py	2010-04-14 13:24:50 UTC (rev 2346)
+++ wasko/branches/2.0/mpulsweb/controllers/navigation.py	2010-04-14 13:30:20 UTC (rev 2347)
@@ -56,9 +56,11 @@
             mark_folderopen(ti)
         tree_item = tree_item.deepest_item()
         page_id = tree_item.key
+        if session.get('navigation.selectedpage') is None:
+            session['navigation.selectedpage'] = page_id
+            session.save()
         return FormularpageController().select(session.get('navigation'
-                                                           '.selectedpage',
-                                                           page_id))
+                                                           '.selectedpage'))
 
     def close_branch(self, id):
         self.navigation = session['navigation.tree']
@@ -69,8 +71,7 @@
         mark_folderclose(tree_item)
         page_id = tree_item.key
         return FormularpageController().select(session.get('navigation'
-                                                           '.selectedpage',
-                                                           page_id))
+                                                           '.selectedpage'))
 
     def select_branch(self, id):
         self.navigation = session['navigation.tree']
@@ -86,8 +87,7 @@
         session['navigation.selectedpage'] = page_id
         session.save()
         return FormularpageController().select(session.get('navigation'
-                                                           '.selectedpage',
-                                                           page_id))
+                                                           '.selectedpage'))
 
 
 # vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8:



More information about the Mpuls-commits mailing list