summaryrefslogtreecommitdiff
path: root/addons/website_livechat/views
diff options
context:
space:
mode:
authorPedro M. Baeza <pedro.baeza@gmail.com>2018-09-20 13:08:50 +0200
committerOlivier Dony <odo@odoo.com>2018-10-03 17:48:14 +0200
commit1ad4d42f0b6da1677a5114c0b79a86b7be35577a (patch)
tree92f266fc1f196de1c2aa97666ca3dec97954146e /addons/website_livechat/views
parent1be50fdeafcd2b94f7b2f47d6e5bc4b6ebaceadd (diff)
[ADD] *: replace hardcoded data URIs with helper
- Add a method for generating an image data URI, and expose it in QWeb context - Fix reports, website templates or mail templates with data hardcoded data URIs, to use the helper (Python cases), or the existing kanban_image helper (for JS cases) This will gracefully handle SVG support in addition to classical image formats. Closes #26635
Diffstat (limited to 'addons/website_livechat/views')
-rw-r--r--addons/website_livechat/views/website_livechat.xml4
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/website_livechat/views/website_livechat.xml b/addons/website_livechat/views/website_livechat.xml
index a7673243222..6afcda0cd0e 100644
--- a/addons/website_livechat/views/website_livechat.xml
+++ b/addons/website_livechat/views/website_livechat.xml
@@ -147,7 +147,7 @@
<t t-foreach="team" t-as="user">
<div class="media mt-3">
<t t-if="user.image_small">
- <img t-att-src="user.image_small and ('data:image/png;base64,' + to_text(user.image_small)) or '/web/static/src/img/placeholder.png'"
+ <img t-att-src="user.image_small and image_data_uri(user.image_small) or '/web/static/src/img/placeholder.png'"
class="rounded" style="padding-right: 8px;" t-att-alt="user.name"/>
</t>
<div class="media-body">
@@ -180,7 +180,7 @@
<t t-foreach="channels" t-as="channel">
<div t-attf-class="media#{' mt-3' if channel_index else ''}">
<a t-attf-href="/livechat/channel/#{ slug(channel)}">
- <img t-att-src="channel.image_small and ('data:image/png;base64,' + to_text(channel.image_small)) or '/web/static/src/img/placeholder.png'" t-att-alt="channel.name" />
+ <img t-att-src="channel.image_small and image_data_uri(channel.image_small) or '/web/static/src/img/placeholder.png'" t-att-alt="channel.name" />
</a>
<div class="media-body">
<h4><t t-esc="channel.name"/></h4>