Commit 51bc7cdf authored by Andreas Jung's avatar Andreas Jung

- Collector #1557/OFS.Image: Introducing new 'alt' property. The 'alt' attribute

        is no longer taken from the 'title' property but from the new 'alt' property. 
        The border="0" attribute is no longer part of the HTML output except specified
        otherwise.
parent e7704bac
......@@ -33,6 +33,12 @@ Zope Changes
- docutils: moved from lib/python/docutils to lib/python/third_party/docutils
- Collector #1557/OFS.Image: Introducing new 'alt' property. The 'alt' attribute
is no longer taken from the 'title' property but from the new 'alt' property.
The border="0" attribute is no longer part of the HTML output except specified
otherwise.
Zope 2.8a1
......
......@@ -113,6 +113,7 @@ class File(Persistent, Implicit, PropertyManager,
_properties=({'id':'title', 'type': 'string'},
{'id':'alt', 'type':'string'},
{'id':'content_type', 'type':'string'},
)
......@@ -788,7 +789,7 @@ class Image(File):
result='<img src="%s"' % (self.absolute_url())
if alt is None:
alt=getattr(self, 'title', '')
alt=getattr(self, 'alt', '')
result = '%s alt="%s"' % (result, escape(alt, 1))
if title is None:
......@@ -801,8 +802,9 @@ class Image(File):
if width:
result = '%s width="%s"' % (result, width)
if not 'border' in [ x.lower() for x in args.keys()]:
result = '%s border="0"' % result
# Omitting 'border' attribute (Collector #1557)
# if not 'border' in [ x.lower() for x in args.keys()]:
# result = '%s border="0"' % result
if css_class is not None:
result = '%s class="%s"' % (result, css_class)
......
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