Author: jmorliaguet
Date: Mon Jun 19 00:08:02 2006
New Revision: 3458

Modified:
   cpsskins/branches/paris-sprint-2006/browser/negotiation/README.txt
   cpsskins/branches/paris-sprint-2006/thememanager.py
   cpsskins/branches/paris-sprint-2006/ui/screens/common/views.py
   cpsskins/branches/paris-sprint-2006/ui/zmi/views.py

Log:

- saving work, some fixes



Modified: cpsskins/branches/paris-sprint-2006/browser/negotiation/README.txt
==============================================================================
--- cpsskins/branches/paris-sprint-2006/browser/negotiation/README.txt  
(original)
+++ cpsskins/branches/paris-sprint-2006/browser/negotiation/README.txt  Mon Jun 
19 00:08:02 2006
@@ -87,7 +87,8 @@
 If nothing is specified, the default theme is returned:
 
     >>> page = negotiation.getPage()
-    >>> page.theme(), page
+    >>> page.theme, page
+    (Theme('Theme 1'), ThemePage('A page'))
 
 
 The page's name can be specified in the URL, by writing
@@ -95,7 +96,8 @@
 
     >>> request.form[u'page'] = u'Theme-2:ThemePage'
     >>> page = negotiation.getPage()
-    >>> page.theme(), page
+    >>> page.theme, page
+    (Theme('Theme 2'), ThemePage('A page'))
 
     >>> del request.form[u'page']
 
@@ -104,7 +106,8 @@
 
     >>> request.response.setCookie('cpsskins_page', u'Theme-3:ThemePage')
     >>> page = negotiation.getPage()
-    >>> page.theme(), page
+    >>> page.theme, page
+    (Theme('Theme 3'), ThemePage('A page'))
 
     >>> request.response.expireCookie('cpsskins_page')
 

Modified: cpsskins/branches/paris-sprint-2006/thememanager.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/thememanager.py (original)
+++ cpsskins/branches/paris-sprint-2006/thememanager.py Mon Jun 19 00:08:02 2006
@@ -27,6 +27,7 @@
 from zope.i18nmessageid import MessageFactory
 from zope.schema import TextLine
 from zope.traversing.api import getName, getParent, getPath
+from zope.traversing.interfaces import IPhysicallyLocatable
 
 from cpsskins.caching import ImageCache, IImageCache
 from cpsskins.elements.interfaces import IFormattable
@@ -350,6 +351,10 @@
     ###################################################################
 
     def getLocation(self, context, root=u''):
+        site = IPhysicallyLocatable(context).getNearestSite()
+        if site is None:
+            return None
         locations = self.getLocationStorage()
         path = getPath(context)
         return locations.find(path, root)
+

Modified: cpsskins/branches/paris-sprint-2006/ui/screens/common/views.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/ui/screens/common/views.py      
(original)
+++ cpsskins/branches/paris-sprint-2006/ui/screens/common/views.py      Mon Jun 
19 00:08:02 2006
@@ -258,7 +258,7 @@
         response = self.request.response
         negotiation = getMultiAdapter((self.context, self.request),
                                       INegotiation, 'negotiation')
-        theme, page = negotiation.getPage()
+        theme = negotiation.getPage().theme
         page = ThemePage()
         self.tmutil.addPage(theme, page)
         response.redirect('.')

Modified: cpsskins/branches/paris-sprint-2006/ui/zmi/views.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/ui/zmi/views.py (original)
+++ cpsskins/branches/paris-sprint-2006/ui/zmi/views.py Mon Jun 19 00:08:02 2006
@@ -99,7 +99,7 @@
         request = self.request
         authoring = getMultiAdapter((context, request), IAuthoring,
                                          name='authoring')
-        authoring.setWorkTheme(name)
+        authoring.setWorkPage(name)
         request.response.redirect('./@@editor.html')
 
     def addTheme(self):
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to