summaryrefslogtreecommitdiff
path: root/addons/website/static/src/xml
diff options
context:
space:
mode:
authorSamuel Degueldre <sad@odoo.com>2020-02-26 11:58:27 +0000
committerSamuel Degueldre <sad@odoo.com>2020-03-30 11:07:10 +0000
commit807ac811446836925092b7214fec004ef4ef4ca8 (patch)
treef259401bc6ce867555dc63643df8eb7f283068b6 /addons/website/static/src/xml
parent02e71a1a3c2ec1446210cddfa0e08840bea7fde6 (diff)
[IMP] web_editor, *: set image alt automatically, remove useless alts
*: website, web_unplash The html alt attribute is supposed to contain a description of an image's content (an alternative to the visual representation), a lot of snippets contained alt attributes that were not descriptive of their content, and would as such be counter-productive in terms of accessibility. This commit removes those. Previously, the alt attribute on img tags had to be set manually by the user through the editor. This commit makes use of the description field on ir.attachment to store image description, and sets the alt attribute on images to that description when choosing an image from the media dialog. task-2091417 closes odoo/odoo#45174 Related: odoo/enterprise#9520 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Diffstat (limited to 'addons/website/static/src/xml')
-rw-r--r--addons/website/static/src/xml/website.gallery.xml10
1 files changed, 5 insertions, 5 deletions
diff --git a/addons/website/static/src/xml/website.gallery.xml b/addons/website/static/src/xml/website.gallery.xml
index 3d0b6e4478d..23bcf471eb2 100644
--- a/addons/website/static/src/xml/website.gallery.xml
+++ b/addons/website/static/src/xml/website.gallery.xml
@@ -12,9 +12,9 @@
<t t-name="website.gallery.slideshow">
<div t-attf-id="#{id}" class="carousel slide" data-ride="carousel" t-attf-data-interval="#{interval}" style="margin: 0 12px;">
<div class="carousel-inner" style="padding: 0;">
- <t t-foreach="srcs" t-as="src">
- <div t-attf-class="carousel-item #{src_index == index and 'active' or ''}">
- <img t-attf-class="img img-fluid d-block #{userStyle}" t-att-src="src" alt="Slide image"/>
+ <t t-foreach="images" t-as="image">
+ <div t-attf-class="carousel-item #{image_index == index and 'active' or ''}">
+ <img t-attf-class="img img-fluid d-block #{userStyle}" t-att-src="image.src" t-att-alt="image.alt"/>
</div>
</t>
</div>
@@ -23,8 +23,8 @@
<li class="o_indicators_left text-center" aria-label="Previous" title="Previous">
<i class="fa fa-chevron-left"/>
</li>
- <t t-foreach="srcs" t-as="src">
- <li t-attf-data-target="##{id}" t-att-data-slide-to="src_index" t-att-class="src_index == index and 'active'" t-attf-style="background-image: url(#{src})"></li>
+ <t t-foreach="images" t-as="image">
+ <li t-attf-data-target="##{id}" t-att-data-slide-to="image_index" t-att-class="image_index == index and 'active'" t-attf-style="background-image: url(#{image.src})"></li>
</t>
<li class="o_indicators_right text-center" aria-label="Next" title="Next">
<i class="fa fa-chevron-right"/>