use image description (if present) instead of title for display

This commit is contained in:
Helmut Merz 2012-03-28 11:52:25 +02:00
parent df7b0b7bba
commit 56bc752702
2 changed files with 8 additions and 5 deletions

View file

@ -83,7 +83,8 @@
style cell/style">
<metal:image use-macro="item/macros/image" />
<div class="legend">
<a tal:attributes="href cell/targetUrl"><b tal:content="cell/title" /></a>
<a tal:attributes="href cell/targetUrl">
<b tal:content="python: cell.description or cell.title" /></a>
<span tal:condition="cell/img/showInfo|nothing">
<a tal:define="url string:${cell/img/url}/meta_info.html"
tal:attributes="href url;
@ -93,7 +94,7 @@
string:${controller/resourceBase}/cybertools.icons/info.png" />
</a></span>
<br />
<i tal:content="cell/description" />
<!--<i tal:content="cell/description" />-->
</div>
</div>
</tal:cell>
@ -104,11 +105,10 @@
<metal:image define-macro="image">
<tal:img condition="cell/img">
<a title="Information about this object."
dojoType="dojox.image.Lightbox" group="mediasset"
<a dojoType="dojox.image.Lightbox" group="mediasset"
i18n:attributes="title"
tal:attributes="href cell/img/fullImageUrl;
title cell/img/title">
title python: cell.img['description'] or cell.img['title']">
<img tal:condition="showImageLink|python:False"
tal:attributes="src cell/img/src;
class cell/img/cssClass;

View file

@ -144,6 +144,7 @@ class ConceptView(BaseConceptView):
adImg = adapted(r)
showInfo = adImg.showInfo and adImg.metaInfo
return dict(src=src, fullImageUrl=fullSrc, title=r.title,
description=r.description,
url=url, cssClass=self.parentView.imageCssClass,
showInfo=showInfo)
@ -313,6 +314,7 @@ class ConceptRelationView(BaseConceptRelationView, ConceptView):
adImg = adapted(r)
showInfo = adImg.showInfo and adImg.metaInfo
return dict(src=src, fullImageUrl=fullSrc, title=r.title,
description=r.description,
url=url, cssClass=self.parentView.imageCssClass,
showInfo=showInfo)
@ -347,6 +349,7 @@ class ResourceView(BaseResourceView):
adImg = adapted(self.context)
showInfo = adImg.showInfo and adImg.metaInfo
return dict(src=src, fullImageUrl=fullSrc, title=self.context.title,
description=self.context.description,
url=url, cssClass=self.parentView.imageCssClass,
showInfo=showInfo)