[Zope-CVS] CVS: Products/CompositePage - composite.py:1.9.2.5
designuis.py:1.1.2.4
Shane Hathaway
shane at zope.com
Thu Feb 26 11:29:17 EST 2004
Update of /cvs-repository/Products/CompositePage
In directory cvs.zope.org:/tmp/cvs-serv10961
Modified Files:
Tag: composite-flat-ui-branch
composite.py designuis.py
Log Message:
Edit, preview, move up, and move down are now functional.
=== Products/CompositePage/composite.py 1.9.2.4 => 1.9.2.5 ===
--- Products/CompositePage/composite.py:1.9.2.4 Wed Feb 25 16:15:01 2004
+++ Products/CompositePage/composite.py Thu Feb 26 11:28:47 2004
@@ -217,7 +217,8 @@
slot = self.slots[name]
elements = []
index = 0
- for element in slot.objectValues():
+ slot_values = slot.objectValues()
+ for element in slot_values:
icon = getIconURL(element, icon_base_url)
element_info = {
'title': element.title_or_id(),
@@ -225,6 +226,8 @@
'source_path': '/'.join(element.getPhysicalPath()),
'index': index,
'next_index': index + 1,
+ 'can_move_up': (index > 0),
+ 'can_move_down': (index < len(slot_values) - 1),
'view': 'xxx',
'available_views': ('yyy', 'zzz'),
}
=== Products/CompositePage/designuis.py 1.1.2.3 => 1.1.2.4 ===
--- Products/CompositePage/designuis.py:1.1.2.3 Tue Feb 24 17:34:11 2004
+++ Products/CompositePage/designuis.py Thu Feb 26 11:28:47 2004
@@ -82,7 +82,7 @@
changeViewForm = PageTemplateFile("changeViewForm.pt", _common)
- workspace_view_name = "" # To be overridden
+ workspace_view_name = "view" # To be overridden
security.declarePublic("getFragments")
def getFragments(self, composite):
@@ -149,6 +149,15 @@
obj = root.restrictedTraverse(path)
RESPONSE.redirect("%s/%s" % (
obj.absolute_url(), self.workspace_view_name))
+
+
+ security.declarePublic("previewElement")
+ def previewElement(self, path, RESPONSE):
+ """Redirects to the preview for an element.
+ """
+ root = self.getPhysicalRoot()
+ obj = root.restrictedTraverse(path)
+ RESPONSE.redirect(obj.absolute_url())
security.declarePublic("showSlot")
More information about the Zope-CVS
mailing list