changeset 338:10748ba0542b

Image.macro_Image: bug fix don't set default width value for div style
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Tue, 20 Jan 2009 23:05:26 +0100
parents 2f5be6a82766
children 7163e5cf5b77
files data/plugin/macro/Image.py
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/data/plugin/macro/Image.py	Tue Jan 20 22:24:57 2009 +0100
+++ b/data/plugin/macro/Image.py	Tue Jan 20 23:05:26 2009 +0100
@@ -247,10 +247,14 @@
     if '/' not in itemname:
         itemname = macro.formatter.page.page_name + '/' + itemname
     img = Image(macro.request, itemname, caption=alt)
-    return """<div class="thumbnail">%s<div class="decription"><div style="width:%spx">%s
+    
+    div_width = ""
+    if width != 9999:
+        div_width = '<div style="width:%spx">' % width
+    return """<div class="thumbnail">%s<div class="decription">%s%s
               <div class="show-datetime">%s</div></div></div></div>""" % (
                                      macro.formatter.image(src=img.url((width, height)), alt=img.caption),
-                                     width,
+                                     div_width,
                                      macro.formatter.text(description),
                                      macro.request.user.getFormattedDateTime(img.ctime),
                                      )