diff --git a/browser/configure.zcml b/browser/configure.zcml index 9fa353e..bbac24d 100644 --- a/browser/configure.zcml +++ b/browser/configure.zcml @@ -3,8 +3,24 @@ + i18n_domain="zope"> + + + + + + @@ -44,7 +60,7 @@ @@ -91,10 +107,9 @@ /> + for="loops.interfaces.IConcept" + class=".concept.ConceptRelations" + permission="zope.ManageContent"> @@ -182,26 +197,24 @@ - - + fields="title description type body" + permission="zope.ManageContent"> + + + + + + + + + + + + + + + + diff --git a/browser/macros.py b/browser/macros.py new file mode 100644 index 0000000..a468edd --- /dev/null +++ b/browser/macros.py @@ -0,0 +1,28 @@ +# +# Copyright (c) 2006 Helmut Merz helmutm@cy55.de +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +""" +Macro definitions. + +$Id$ +""" + +from zope.app.rotterdam.standardmacros import StandardMacros + +class Macros(StandardMacros): + macro_pages = ('node_macros',) diff --git a/browser/node.pt b/browser/node.pt new file mode 100644 index 0000000..986c2a1 --- /dev/null +++ b/browser/node.pt @@ -0,0 +1,24 @@ + + + + + + + + + +
The body
+
+ + + +
+
+ +
+
+ + + +
diff --git a/interfaces.py b/interfaces.py index a97b561..e275135 100644 --- a/interfaces.py +++ b/interfaces.py @@ -174,9 +174,26 @@ class IView(Interface): class INode(IView, IOrderedContainer): """ A node is a view that may contain other views, thus building a menu or folder hierarchy. + + A node may be a content object on its own; for this reason it + has a body attribute that may be shown e.g. on web pages. """ contains(IView) + type = schema.Choice( + title=_(u'Type'), + description=_(u'Type of the node'), + values=('page', 'text', 'menu', 'menuitem'), + default='page', + required=True) + + body = schema.Text( + title=_(u'Body'), + description=_(u'Textual body that may be shown in addition to ' + 'or instead of information coming from the target'), + default=u'', + required=False) + class IViewManager(IContainer): """ A manager/container for views. diff --git a/view.py b/view.py index 747ee3c..d93901c 100644 --- a/view.py +++ b/view.py @@ -78,11 +78,20 @@ class View(object): super(View, self).__init__() - class Node(View, OrderedContainer): implements(INode) + _type = 'page' + def getType(self): return self._type + def setType(self, type): self._type = type + type = property(getType, setType) + + _body = u'' + def getBody(self): return self._body + def setBody(self, body): self._body = body + body = property(getBody, setBody) + class ViewManager(BTreeContainer): @@ -90,7 +99,6 @@ class ViewManager(BTreeContainer): class TargetRelation(DyadicRelation): - """ A relation between a view and a concept or resource object. + """ A relation between a view and another object. """ - \ No newline at end of file