summaryrefslogtreecommitdiff
path: root/addons/website_profile/views/website_profile.xml
diff options
context:
space:
mode:
authorDavid Beguin <dbe@odoo.com>2020-01-20 14:35:09 +0000
committerThibault Delavallée <tde@odoo.com>2020-04-16 10:26:32 +0000
commit45f7463e7a532ca5afbc280de7e86c2deff99921 (patch)
tree11e15cd5b5671d6b262841144464b484148c5cf0 /addons/website_profile/views/website_profile.xml
parent16e492860be83c4d8b78aa7b17d73f627f59bda0 (diff)
[IMP] website_(profile, slides): use badge level image as default badge image
Before this commit, if no image was set on the badge, no image was shown when displaying the badge. After this commit, if a badge level is set on the badge and no image is set, the badge level image will be used for the badge. This fix / improvement is applied twice * when displaying an user profile, its received badges; * when displaying current user achievements in eLearning; Task ID 1981399 PR #43577
Diffstat (limited to 'addons/website_profile/views/website_profile.xml')
-rw-r--r--addons/website_profile/views/website_profile.xml17
1 files changed, 13 insertions, 4 deletions
diff --git a/addons/website_profile/views/website_profile.xml b/addons/website_profile/views/website_profile.xml
index 37b5359e032..d04d5876daf 100644
--- a/addons/website_profile/views/website_profile.xml
+++ b/addons/website_profile/views/website_profile.xml
@@ -367,10 +367,19 @@
<div class="card">
<div class="card-body p-2 pr-3">
<div class="media align-items-center">
- <img width="38" height="38" t-att-src="website.image_url(badge.badge_id, 'image_128')" class="o_object_fit_cover mr-0"/>
- <div class="media-body col-md-10 p-0">
- <h6 class="my-0 text-truncate" t-field="badge.badge_id.name"/>
- </div>
+ <img t-if="not badge.badge_id.image_1920 and badge.badge_id.level"
+ width="38" height="38"
+ t-attf-src="/website_profile/static/src/img/badge_#{badge.badge_id.level}.svg"
+ class="o_object_fit_cover mr-0"
+ t-att-alt="badge.badge_id.name"/>
+ <img t-else=""
+ width="38" height="38"
+ t-att-src="website.image_url(badge.badge_id, 'image_128')"
+ class="o_object_fit_cover mr-0"
+ t-att-alt="badge.badge_id.name"/>
+ <div class="media-body col-md-10 p-0">
+ <h6 class="my-0 pl-1 text-truncate" t-field="badge.badge_id.name"/>
+ </div>
</div>
</div>
</div>