put skin spec in dialog URLs, making dialog forms customizable
git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@2432 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
parent
a1de35aeb3
commit
255d47f5da
4 changed files with 17 additions and 4 deletions
|
@ -19,7 +19,7 @@
|
||||||
"""
|
"""
|
||||||
Base classes (sort of views) for action portlet items.
|
Base classes (sort of views) for action portlet items.
|
||||||
|
|
||||||
$Id$
|
$Id: action.py 2313 2008-01-15 13:00:34Z helmutm $
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from urllib import urlencode
|
from urllib import urlencode
|
||||||
|
@ -68,8 +68,9 @@ class DialogAction(Action):
|
||||||
if self.fixedType:
|
if self.fixedType:
|
||||||
urlParams['fixed_type'] = 'yes'
|
urlParams['fixed_type'] = 'yes'
|
||||||
urlParams.update(self.addParams)
|
urlParams.update(self.addParams)
|
||||||
return self.jsOnClick % (self.dialogName, self.page.virtualTargetUrl,
|
url = self.page.virtualTargetUrlWithSkin
|
||||||
self.viewName, urlencode(urlParams))
|
return self.jsOnClick % (self.dialogName, url, self.viewName,
|
||||||
|
urlencode(urlParams))
|
||||||
|
|
||||||
@Lazy
|
@Lazy
|
||||||
def innerHtmlId(self):
|
def innerHtmlId(self):
|
||||||
|
|
|
@ -225,6 +225,7 @@ class CreateObjectForm(ObjectForm):
|
||||||
def macro(self): return self.template.macros['create']
|
def macro(self): return self.template.macros['create']
|
||||||
|
|
||||||
defaultTitle = u'Create Resource, Type = '
|
defaultTitle = u'Create Resource, Type = '
|
||||||
|
defaultType = '.loops/concepts/textdocument'
|
||||||
form_action = 'create_resource'
|
form_action = 'create_resource'
|
||||||
dialog_name = 'create'
|
dialog_name = 'create'
|
||||||
|
|
||||||
|
|
|
@ -68,7 +68,7 @@
|
||||||
tal:define="qualifier request/qualifier | string:resource;
|
tal:define="qualifier request/qualifier | string:resource;
|
||||||
innerForm request/inner_form | string:inner_form.html;
|
innerForm request/inner_form | string:inner_form.html;
|
||||||
typeToken python: request.get('form.type')
|
typeToken python: request.get('form.type')
|
||||||
or '.loops/concepts/textdocument';
|
or view.defaultType;
|
||||||
fixedType request/fixed_type | nothing">
|
fixedType request/fixed_type | nothing">
|
||||||
<input type="hidden" name="form.action" value="create"
|
<input type="hidden" name="form.action" value="create"
|
||||||
tal:attributes="value view/form_action" />
|
tal:attributes="value view/form_action" />
|
||||||
|
|
|
@ -22,6 +22,7 @@ View class for Node objects.
|
||||||
$Id$
|
$Id$
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from urlparse import urlparse, urlunparse
|
||||||
from zope import component, interface, schema
|
from zope import component, interface, schema
|
||||||
from zope.cachedescriptors.property import Lazy
|
from zope.cachedescriptors.property import Lazy
|
||||||
from zope.app import zapi
|
from zope.app import zapi
|
||||||
|
@ -343,6 +344,16 @@ class NodeView(BaseView):
|
||||||
else:
|
else:
|
||||||
return self.url
|
return self.url
|
||||||
|
|
||||||
|
@Lazy
|
||||||
|
def virtualTargetUrlWithSkin(self):
|
||||||
|
url = self.virtualTargetUrl
|
||||||
|
if self.skin:
|
||||||
|
parts = urlparse(url)
|
||||||
|
url = urlunparse(parts[:2] +
|
||||||
|
('/++skin++' + self.skin.__name__ + parts[2],) +
|
||||||
|
parts[3:])
|
||||||
|
return url
|
||||||
|
|
||||||
@Lazy
|
@Lazy
|
||||||
def realTargetUrl(self):
|
def realTargetUrl(self):
|
||||||
target = self.virtualTargetObject
|
target = self.virtualTargetObject
|
||||||
|
|
Loading…
Add table
Reference in a new issue