some minor bugfixes for dialogs, dijit.Editor and action handling
git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@2581 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
parent
04b8c9633c
commit
3d8b566b87
6 changed files with 31 additions and 16 deletions
|
@ -102,7 +102,7 @@ actions.register('info', 'object', DialogAction,
|
||||||
dialogName='',
|
dialogName='',
|
||||||
icon='cybertools.icons/info.png',
|
icon='cybertools.icons/info.png',
|
||||||
cssClass='icon-action',
|
cssClass='icon-action',
|
||||||
addParams=dict(version='this')
|
addParams=dict(version='this'),
|
||||||
)
|
)
|
||||||
|
|
||||||
actions.register('external_edit', 'object', TargetAction,
|
actions.register('external_edit', 'object', TargetAction,
|
||||||
|
@ -111,3 +111,11 @@ actions.register('external_edit', 'object', TargetAction,
|
||||||
icon='edit.gif',
|
icon='edit.gif',
|
||||||
cssClass='icon-action',
|
cssClass='icon-action',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
actions.register('edit_object', 'portlet', DialogAction,
|
||||||
|
title=_(u'Edit Resource...'),
|
||||||
|
description=_(u'Modify resource object.'),
|
||||||
|
viewName='edit_object.html',
|
||||||
|
dialogName='edit',
|
||||||
|
prerequisites=['registerDojoEditor'],
|
||||||
|
)
|
||||||
|
|
|
@ -483,6 +483,11 @@ class BaseView(GenericView, I18NView):
|
||||||
jsCall = 'dojo.require("dijit.form.ValidationTextBox");'
|
jsCall = 'dojo.require("dijit.form.ValidationTextBox");'
|
||||||
self.controller.macros.register('js-execute', jsCall, jsCall=jsCall)
|
self.controller.macros.register('js-execute', jsCall, jsCall=jsCall)
|
||||||
|
|
||||||
|
def registerDojoEditor(self):
|
||||||
|
self.registerDojo()
|
||||||
|
jsCall = 'dojo.require("dijit.Editor");'
|
||||||
|
self.controller.macros.register('js-execute', jsCall, jsCall=jsCall)
|
||||||
|
|
||||||
|
|
||||||
# vocabulary stuff
|
# vocabulary stuff
|
||||||
|
|
||||||
|
|
|
@ -49,9 +49,9 @@ actions.register('editFolder', 'portlet', DialogAction,
|
||||||
|
|
||||||
class FolderView(ConceptView):
|
class FolderView(ConceptView):
|
||||||
|
|
||||||
def getActions(self, category='concept', page=None):
|
def getActions(self, category='concept', page=None, target=None):
|
||||||
if category == 'portlet':
|
if category == 'portlet':
|
||||||
return actions.get(category, ['createFolder', 'editFolder'],
|
return actions.get(category, ['createFolder', 'editFolder'],
|
||||||
view=self, page=page)
|
view=self, page=page, target=target)
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
|
@ -111,9 +111,11 @@ class ObjectForm(NodeView):
|
||||||
|
|
||||||
@Lazy
|
@Lazy
|
||||||
def schema(self):
|
def schema(self):
|
||||||
ti = self.typeInterface or IConceptSchema
|
#ti = self.typeInterface or IConceptSchema
|
||||||
schemaFactory = component.getAdapter(self.adapted, ISchemaFactory)
|
#schemaFactory = component.getAdapter(self.adapted, ISchemaFactory)
|
||||||
return schemaFactory(ti, manager=self, request=self.request)
|
schemaFactory = ISchemaFactory(self.adapted)
|
||||||
|
return schemaFactory(self.typeInterface, manager=self,
|
||||||
|
request=self.request)
|
||||||
|
|
||||||
@Lazy
|
@Lazy
|
||||||
def fields(self):
|
def fields(self):
|
||||||
|
@ -340,7 +342,10 @@ class CreateConceptForm(CreateObjectForm):
|
||||||
@Lazy
|
@Lazy
|
||||||
def typeInterface(self):
|
def typeInterface(self):
|
||||||
if self.typeConcept:
|
if self.typeConcept:
|
||||||
return removeSecurityProxy(ITypeConcept(self.typeConcept).typeInterface)
|
ti = ITypeConcept(self.typeConcept).typeInterface
|
||||||
|
if ti is not None:
|
||||||
|
return removeSecurityProxy(ti)
|
||||||
|
return IConceptSchema
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def assignments(self):
|
def assignments(self):
|
||||||
|
@ -393,7 +398,8 @@ class EditObject(FormController, I18NView):
|
||||||
|
|
||||||
@Lazy
|
@Lazy
|
||||||
def schema(self):
|
def schema(self):
|
||||||
schemaFactory = component.getAdapter(self.adapted, ISchemaFactory)
|
#schemaFactory = component.getAdapter(self.adapted, ISchemaFactory)
|
||||||
|
schemaFactory = ISchemaFactory(self.adapted)
|
||||||
#return schemaFactory(self.typeInterface)
|
#return schemaFactory(self.typeInterface)
|
||||||
return schemaFactory(self.typeInterface, manager=self,
|
return schemaFactory(self.typeInterface, manager=self,
|
||||||
request=self.request)
|
request=self.request)
|
||||||
|
|
|
@ -152,9 +152,9 @@ function validate() {
|
||||||
if (titleField != undefined && titleField.value == '') {
|
if (titleField != undefined && titleField.value == '') {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (form != undefined) {
|
/*if (form != undefined) {
|
||||||
return form.submit();
|
return form.submit();
|
||||||
}
|
}*/
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -176,12 +176,8 @@ class ResourceView(BaseView):
|
||||||
# actions
|
# actions
|
||||||
|
|
||||||
def getPortletActions(self, page=None, target=None):
|
def getPortletActions(self, page=None, target=None):
|
||||||
actions = []
|
return actions.get('portlet', ['edit_object'], view=self, page=page,
|
||||||
actions.append(DialogAction(self, title='Edit Resource...',
|
target=target)
|
||||||
description='Modify resource object.',
|
|
||||||
viewName='edit_object.html', dialogName='edit',
|
|
||||||
page=page, target=target))
|
|
||||||
return actions
|
|
||||||
|
|
||||||
def getObjectActions(self, page=None, target=None):
|
def getObjectActions(self, page=None, target=None):
|
||||||
acts = ['info']
|
acts = ['info']
|
||||||
|
|
Loading…
Add table
Reference in a new issue