[IMP] website_profile: change badge decoration with xp

Before this commit, if an user receives an increase or decrease in the XP,
both are currently shown with success badge (green).

After this commit, if there is decrease in user XP, it will be shown with
warning badge (orange).

closes odoo/odoo#118068

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit is contained in:
niyasraphy
2023-04-12 14:02:35 +02:00
committed by Thibault Delavallée
parent ed7f4ebb6a
commit 7eb3f91777
@@ -569,7 +569,7 @@
<span class="badge text-bg-danger fw-normal px-2" t-if="not user['website_published']">Unpublished</span>
<strong class="text-muted" t-esc="user['rank']"/>
<div class="h3 my-2" t-if="user['karma_gain']">
<span class="badge rounded-pill text-bg-success px-3 py-2" >
<span t-attf-class="badge rounded-pill px-3 py-2 #{ 'text-bg-success' if user['karma_gain'] > 0 else 'text-bg-warning'}">
<t t-if="user['karma_gain'] > 0">+ </t><t t-esc="user['karma_gain']"/> XP
</span>
</div>
@@ -594,7 +594,7 @@
</td>
<td class="align-middle text-nowrap">
<t t-if="user['karma_gain']">
<span class="badge rounded-pill text-bg-success d-inline">
<span t-attf-class="badge rounded-pill d-inline #{ 'text-bg-success' if user['karma_gain'] > 0 else 'text-bg-warning'}">
<t t-if="user['karma_gain'] > 0">+ </t><t t-esc="user['karma_gain']"/> XP
</span>
<span class="text-muted ps-2 pe-3">