summaryrefslogtreecommitdiff
path: root/addons/website_profile/views/website_profile.xml
diff options
context:
space:
mode:
authorThibault Delavallée <tde@odoo.com>2019-09-12 09:47:09 +0000
committerThibault Delavallée <tde@odoo.com>2019-09-13 10:05:15 +0000
commit98f847be3a7e2d3e28db977085a577b8295cc620 (patch)
tree41a79de0838b3c0676be4efcf7513bb6489d79dd /addons/website_profile/views/website_profile.xml
parent477b73ed316307644876287c4f06c79a7afcc339 (diff)
[FIX] website_{slides, profile}: fix display of not square user image
When having not square images for user avatar several issues appear * website_slides: heroes of the week banner is broken as circles are not circles anymore. They look more like UFOs or funny snowmen; * website_slides: my user status / leaderboard / achievements card display is broken as image may take much more width than planned; * website_slides: channel page view displays user avatar when having joined it, and it is broken; * website_profile: user avatars in top 3 of users karma ranking is broken. In this commit we apply strict rules on width / height combined to an object fit in order to always have a bioutifoul displayed circled image. Task 2065425 (avatar ratio badly displayed) PR #36756
Diffstat (limited to 'addons/website_profile/views/website_profile.xml')
-rw-r--r--addons/website_profile/views/website_profile.xml4
1 files changed, 3 insertions, 1 deletions
diff --git a/addons/website_profile/views/website_profile.xml b/addons/website_profile/views/website_profile.xml
index 4d77af30669..40330800585 100644
--- a/addons/website_profile/views/website_profile.xml
+++ b/addons/website_profile/views/website_profile.xml
@@ -514,7 +514,9 @@
<div class="card text-center mb-2 border-bottom-0 o_wprofile_pointer">
<div class="card-body">
<div class="d-inline-block position-relative">
- <img class="rounded-circle img-fluid" t-att-src="'/profile/avatar/%s?field=image_128%s' % (user['id'], '&amp;res_model=%s&amp;res_id=%s' % (record._name, record.id) if record else '')"/>
+ <img class="rounded-circle img-fluid"
+ style="width: 128px; height: 128px; object-fit: cover;"
+ t-att-src="'/profile/avatar/%s?field=image_256%s' % (user['id'], '&amp;res_model=%s&amp;res_id=%s' % (record._name, record.id) if record else '')"/>
<img class="position-absolute" t-attf-src="/website_profile/static/src/img/rank_#{user_index + 1}.svg" alt="User rank" style="bottom: 0; right: -10px"/>
</div>
<h3 class="mt-2 mb-0" t-esc="user['name']"></h3>