comparison data/plugin/macro/Image.py @ 307:3126b6ff38fa

macro.Image: linebreak for description line when width exceeded
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Thu, 27 Nov 2008 00:53:06 +0100
parents 2f1b790d9746
children 81a4a9a1f497
comparison
equal deleted inserted replaced
306:2f1b790d9746 307:3126b6ff38fa
245 <<Image(PageName/attachname,width=100,alt="sample image")>> 245 <<Image(PageName/attachname,width=100,alt="sample image")>>
246 """ 246 """
247 if '/' not in itemname: 247 if '/' not in itemname:
248 itemname = macro.formatter.page.page_name + '/' + itemname 248 itemname = macro.formatter.page.page_name + '/' + itemname
249 img = Image(macro.request, itemname, caption=alt) 249 img = Image(macro.request, itemname, caption=alt)
250 return "%s%s%s%s%s%s" % ('<div class="thumbnail">', 250 return "%s%s%s%s%s%s%s%s" % ('<div class="thumbnail">',
251 macro.formatter.image(src=img.url((width, height)), alt=img.caption), 251 macro.formatter.image(src=img.url((width, height)), alt=img.caption),
252 '<div class="decription">', 252 '<div class="decription">',
253 macro.formatter.text(description), 253 '<div style="width:%spx">' % (width),
254 '</div>', 254 macro.formatter.text(description),
255 '</div>') 255 '</div>', '</div>', '</div>', )
256 256