provide Lightbox for showing images
git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@3583 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
parent
8daa4de2ef
commit
bc6c7a174f
3 changed files with 26 additions and 9 deletions
|
@ -562,8 +562,12 @@ class BaseView(GenericView, I18NView):
|
|||
'dojo.registerModulePath("jocy", "/@@/cybertools.jocy"); '
|
||||
'dojo.require("jocy.data");')
|
||||
cm.register('js-execute', jsCall, jsCall=jsCall)
|
||||
cm.register('css', identifier='Lightbox.css', position=0,
|
||||
resourceName='ajax.dojo/dojox/image/resources/Lightbox.css',
|
||||
media='all')
|
||||
cm.register('css', identifier='tundra.css', position=0,
|
||||
resourceName='ajax.dojo/dijit/themes/tundra/tundra.css', media='all')
|
||||
resourceName='ajax.dojo/dijit/themes/tundra/tundra.css',
|
||||
media='all')
|
||||
#cm.register('css', identifier='dojo.css', position=1,
|
||||
# resourceName='ajax.dojo/dojo/resources/dojo.css', media='all')
|
||||
|
||||
|
@ -614,7 +618,8 @@ class BaseView(GenericView, I18NView):
|
|||
'dojo.require("dijit.form.TimeTextBox"); '
|
||||
'dojo.require("dijit.form.SimpleTextarea"); '
|
||||
'dojo.require("dijit.form.FilteringSelect"); '
|
||||
'dojo.require("dojox.data.QueryReadStore"); ')
|
||||
'dojo.require("dojox.data.QueryReadStore"); '
|
||||
'dojo.require("dojox.image.Lightbox"); ')
|
||||
cm.register('js-execute', 'dojo.form.all', jsCall=jsCall)
|
||||
|
||||
def registerDojoFormAllGrid(self):
|
||||
|
|
|
@ -166,13 +166,16 @@
|
|||
class="checkbox">
|
||||
<input type="checkbox" name="selection:list" checked
|
||||
tal:attributes="value uid;" /></td>
|
||||
<td valign="top">
|
||||
<a href="#"
|
||||
tal:attributes="href python: view.getUrlForTarget(related);
|
||||
<td valign="top"
|
||||
tal:define="icon related/icon">
|
||||
<a dojoType="dojox.image.Lightbox" group="mediasset"
|
||||
tal:condition="icon"
|
||||
tal:attributes="href related/fullImage/src|nothing;
|
||||
title related/fullImage/title|related/title">
|
||||
<img tal:attributes="src icon/src" />
|
||||
</a>
|
||||
<a tal:attributes="href python: view.getUrlForTarget(related);
|
||||
title description">
|
||||
<img tal:define="icon related/icon"
|
||||
tal:condition="icon"
|
||||
tal:attributes="src icon/src" />
|
||||
<div tal:content="related/title">Resource Title</div>
|
||||
</a>
|
||||
</td>
|
||||
|
|
|
@ -114,10 +114,19 @@ class ResourceView(BaseView):
|
|||
|
||||
@Lazy
|
||||
def icon(self):
|
||||
if IMediaAsset.providedBy(self.adapted):
|
||||
if (IMediaAsset.providedBy(self.adapted) and
|
||||
'image/' in self.context.contentType):
|
||||
return dict(src='%s/mediaasset.html?v=minithumb' %
|
||||
(self.nodeView.getUrlForTarget(self.context)))
|
||||
|
||||
@Lazy
|
||||
def fullImage(self):
|
||||
if (IMediaAsset.providedBy(self.adapted) and
|
||||
'image/' in self.context.contentType):
|
||||
return dict(src='%s/mediaasset.html?v=medium' %
|
||||
self.nodeView.getUrlForTarget(self.context),
|
||||
title=self.context.title)
|
||||
|
||||
@property
|
||||
def macro(self):
|
||||
if 'image/' in self.context.contentType:
|
||||
|
|
Loading…
Add table
Reference in a new issue