--- a/src/pyams_file/image.py Mon Jul 16 12:14:21 2018 +0200
+++ b/src/pyams_file/image.py Tue Jul 17 11:12:44 2018 +0200
@@ -264,7 +264,7 @@
"""
def render(self, context=None, lg_thumb='lg', lg_width=12, md_thumb='md', md_width=12,
- sm_thumb='sm', sm_width=12, xs_thumb='xs', xs_width=12, css_class=''):
+ sm_thumb='sm', sm_width=12, xs_thumb='xs', xs_width=12, alt='', css_class=''):
if context is None:
context = self.context
return render('templates/picture.pt',
@@ -277,5 +277,6 @@
'sm_width': sm_width,
'xs_thumb': xs_thumb,
'xs_width': xs_width,
+ 'alt': alt,
'css_class': css_class},
request=self.request)
--- a/src/pyams_file/templates/picture.pt Mon Jul 16 12:14:21 2018 +0200
+++ b/src/pyams_file/templates/picture.pt Tue Jul 17 11:12:44 2018 +0200
@@ -49,5 +49,5 @@
tal:condition="not:xs_width" />
<!-- fallback image -->
<img style="width: 100%;"
- tal:attributes="src image_url" />
+ tal:attributes="alt alt; src image_url" />
</picture>