Commit bff389a3 authored by Lu Xu's avatar Lu Xu 👀

ImageField: add title

parent e08ace32
......@@ -34,6 +34,7 @@ from OFS.Image import Image as OFSImage
from lxml.etree import Element
from lxml import etree
import re
from zLOG import LOG
DRAW_URI = 'urn:oasis:names:tc:opendocument:xmlns:drawing:1.0'
TEXT_URI = 'urn:oasis:names:tc:opendocument:xmlns:text:1.0'
......@@ -104,6 +105,7 @@ class ImageFieldWidget(Widget.TextWidget):
image = value
alt = field.get_value('description') or \
field.get_value('title')
title = field.get_value('title')
css_class = field.get_value('css_class')
extra = field.get_value('extra')
options = {}
......@@ -119,13 +121,16 @@ class ImageFieldWidget(Widget.TextWidget):
if v])
if parameters:
image = '%s?%s' % (image, parameters)
return Widget.render_element(
x = Widget.render_element(
"img",
alt=alt,
title=title,
src=image,
css_class=css_class,
extra=extra,
)
LOG('Testing... ', 0, x)
return x
def render_odg_view(self, field, value, as_string, ooo_builder, REQUEST,
render_prefix, attr_dict, local_name):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment