Commit 50dc6467 authored by Stefan H. Holek's avatar Stefan H. Holek

Merged r69769:69770 from 2.9 branch.

Moved 'alt' property from File to Image.
Fixes http://www.zope.org/Collectors/Zope/1907
parent ce2682bf
...@@ -8,6 +8,8 @@ Zope Changes ...@@ -8,6 +8,8 @@ Zope Changes
Bugs fixed Bugs fixed
- Collector #1907: Moved 'alt' property from File to Image.
- Collector #1983: Specifying session-resolution-seconds >= 1200 caused - Collector #1983: Specifying session-resolution-seconds >= 1200 caused
Zope startup to fail. Zope startup to fail.
......
...@@ -85,7 +85,6 @@ class File(Persistent, Implicit, PropertyManager, ...@@ -85,7 +85,6 @@ class File(Persistent, Implicit, PropertyManager,
precondition='' precondition=''
size=None size=None
alt=''
manage_editForm =DTMLFile('dtml/fileEdit',globals(), manage_editForm =DTMLFile('dtml/fileEdit',globals(),
Kind='File',kind='file') Kind='File',kind='file')
...@@ -110,7 +109,6 @@ class File(Persistent, Implicit, PropertyManager, ...@@ -110,7 +109,6 @@ class File(Persistent, Implicit, PropertyManager,
) )
_properties=({'id':'title', 'type': 'string'}, _properties=({'id':'title', 'type': 'string'},
{'id':'alt', 'type':'string'},
{'id':'content_type', 'type':'string'}, {'id':'content_type', 'type':'string'},
) )
...@@ -734,6 +732,7 @@ class Image(File): ...@@ -734,6 +732,7 @@ class Image(File):
security = ClassSecurityInfo() security = ClassSecurityInfo()
security.declareObjectProtected(View) security.declareObjectProtected(View)
alt=''
height='' height=''
width='' width=''
...@@ -750,6 +749,7 @@ class Image(File): ...@@ -750,6 +749,7 @@ class Image(File):
security.declareProtected(delete_objects, 'DELETE') security.declareProtected(delete_objects, 'DELETE')
_properties=({'id':'title', 'type': 'string'}, _properties=({'id':'title', 'type': 'string'},
{'id':'alt', 'type':'string'},
{'id':'content_type', 'type':'string','mode':'w'}, {'id':'content_type', 'type':'string','mode':'w'},
{'id':'height', 'type':'string'}, {'id':'height', 'type':'string'},
{'id':'width', 'type':'string'}, {'id':'width', 'type':'string'},
......
...@@ -2,10 +2,7 @@ ...@@ -2,10 +2,7 @@
<dtml-var manage_tabs> <dtml-var manage_tabs>
<p> <p>
<img src="&dtml-absolute_url;" <dtml-if <dtml-var tag>
width>width="&dtml-width;" </dtml-if><dtml-if
height>height="&dtml-height;" </dtml-if
> alt="&dtml-title_or_id;" />
</p> </p>
<dtml-var manage_page_footer> <dtml-var manage_page_footer>
......
...@@ -277,8 +277,12 @@ class ImageTests(FileTests): ...@@ -277,8 +277,12 @@ class ImageTests(FileTests):
('<img src="http://foo/file" alt="" title="" height="16" width="16" />')) ('<img src="http://foo/file" alt="" title="" height="16" width="16" />'))
def testTag(self): def testTag(self):
self.assertEqual(self.file.tag(), tag_fmt = '<img src="http://foo/file" alt="%s" title="%s" height="16" width="16" />'
('<img src="http://foo/file" alt="" title="" 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): def testViewImageOrFile(self):
pass # dtml method,screw it 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