Commit b17b217e authored by Stefan H. Holek's avatar Stefan H. Holek

Moved 'alt' property from File to Image.

Fixes http://www.zope.org/Collectors/Zope/1907
parent 84bf1298
......@@ -8,6 +8,8 @@ Zope Changes
Bugs fixed
- Collector #1907: Moved 'alt' property from File to Image.
- Collector #1983: Specifying session-resolution-seconds >= 1200 caused
Zope startup to fail.
......
......@@ -77,7 +77,6 @@ class File(Persistent, Implicit, PropertyManager,
precondition=''
size=None
alt=''
manage_editForm =DTMLFile('dtml/fileEdit',globals(),
Kind='File',kind='file')
......@@ -115,7 +114,6 @@ class File(Persistent, Implicit, PropertyManager,
_properties=({'id':'title', 'type': 'string'},
{'id':'alt', 'type':'string'},
{'id':'content_type', 'type':'string'},
)
......@@ -719,7 +717,7 @@ class Image(File):
__implements__ = (WriteLockInterface,)
meta_type='Image'
alt=''
height=''
width=''
......@@ -738,6 +736,7 @@ class Image(File):
)
_properties=({'id':'title', 'type': 'string'},
{'id':'alt', 'type':'string'},
{'id':'content_type', 'type':'string','mode':'w'},
{'id':'height', 'type':'string'},
{'id':'width', 'type':'string'},
......
......@@ -2,10 +2,7 @@
<dtml-var manage_tabs>
<p>
<img src="&dtml-absolute_url;" <dtml-if
width>width="&dtml-width;" </dtml-if><dtml-if
height>height="&dtml-height;" </dtml-if
> alt="&dtml-title_or_id;" />
<dtml-var tag>
</p>
<dtml-var manage_page_footer>
......
......@@ -272,8 +272,12 @@ class ImageTests(FileTests):
('<img src="http://foo/file" alt="" title="" height="16" width="16" />'))
def testTag(self):
self.assertEqual(self.file.tag(),
('<img src="http://foo/file" alt="" title="" height="16" width="16" />'))
tag_fmt = '<img src="http://foo/file" alt="%s" title="%s" height="16" width="16" />'
self.assertEqual(self.file.tag(), (tag_fmt % ('','')))
self.file.manage_changeProperties(title='foo')
self.assertEqual(self.file.tag(), (tag_fmt % ('','foo')))
self.file.manage_changeProperties(alt='bar')
self.assertEqual(self.file.tag(), (tag_fmt % ('bar','foo')))
def testViewImageOrFile(self):
pass # dtml method,screw it
......
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