slight rearrangement of action definitions allowing more freedom when specifying actions as type options
git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@2655 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
parent
9d0ab14f74
commit
18ab09c31b
2 changed files with 26 additions and 3 deletions
|
@ -87,13 +87,15 @@ class BlogView(ConceptView):
|
|||
return view_macros.macros['blog']
|
||||
|
||||
def getActions(self, category='object', page=None, target=None):
|
||||
acts = list(super(BlogView, self).getActions(category, page, target))
|
||||
blogOwnerId = self.blogOwnerId
|
||||
if blogOwnerId:
|
||||
principal = self.request.principal
|
||||
if principal and principal.id != blogOwnerId:
|
||||
return []
|
||||
return actions.get(category, ['createBlogPost'],
|
||||
view=self, page=page, target=target)
|
||||
return acts
|
||||
blogActions = list(actions.get(category, ['createBlogPost'],
|
||||
view=self, page=page, target=target))
|
||||
return blogActions + acts
|
||||
|
||||
@Lazy
|
||||
def blogOwnerId(self):
|
||||
|
|
|
@ -30,14 +30,35 @@ from zope.cachedescriptors.property import Lazy
|
|||
#from zope.formlib.namedtemplate import NamedTemplate
|
||||
from zope.i18nmessageid import MessageFactory
|
||||
|
||||
from cybertools.browser.action import actions
|
||||
from cybertools.typology.interfaces import IType
|
||||
from loops.browser.action import DialogAction
|
||||
from loops.browser.common import BaseView
|
||||
from loops.browser.concept import ConceptView
|
||||
from loops.knowledge.interfaces import IPerson, ITask
|
||||
from loops.organize.party import getPersonForUser
|
||||
|
||||
_ = MessageFactory('zope')
|
||||
|
||||
|
||||
actions.register('createTopic', 'portlet', DialogAction,
|
||||
title=_(u'Create Topic...'),
|
||||
description=_(u'Create a new topic.'),
|
||||
viewName='create_concept.html',
|
||||
dialogName='createTopic',
|
||||
typeToken='.loops/concepts/topic',
|
||||
fixedType=True,
|
||||
innerForm='inner_concept_form.html',
|
||||
)
|
||||
|
||||
actions.register('editTopic', 'portlet', DialogAction,
|
||||
title=_(u'Edit Topic...'),
|
||||
description=_(u'Modify topic.'),
|
||||
viewName='edit_concept.html',
|
||||
dialogName='editTopic',
|
||||
)
|
||||
|
||||
|
||||
class MyKnowledge(BaseView):
|
||||
|
||||
#template = NamedTemplate('loops.knowledge_macros')
|
||||
|
|
Loading…
Add table
Reference in a new issue