[IMP] website_forum: show popover info only for public profile

before this commit, even it the user profile is not public,
or if the user karma is less than karma_profile_min set
in the website, on hovering the move on the user image
in the post, the user details is shown in the pop over

after this commit, the pop over information is shown only
if the user's profile is public profile and user karma is
greater than karma_profile_min in website

closes odoo/odoo#126628

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit is contained in:
niyasraphy
2023-08-04 10:58:55 +02:00
parent 0b18fa884b
commit b62f5081aa
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -260,7 +260,7 @@ class Post(models.Model):
post.can_comment = is_admin or user.karma >= post.karma_comment
post.can_comment_convert = is_admin or user.karma >= post.karma_comment_convert
post.can_view = is_admin or user.karma >= post.karma_close or (post_sudo.create_uid.karma > 0 and (post_sudo.active or post_sudo.create_uid == user))
post.can_display_biography = is_admin or post_sudo.create_uid.karma >= post.forum_id.karma_user_bio
post.can_display_biography = is_admin or (post_sudo.create_uid.karma >= post.forum_id.karma_user_bio and post_sudo.create_uid.website_published)
post.can_post = is_admin or user.karma >= post.forum_id.karma_post
post.can_flag = is_admin or user.karma >= post.forum_id.karma_flag
post.can_moderate = is_admin or user.karma >= post.forum_id.karma_moderate
@@ -126,7 +126,7 @@
<template id="author_box">
<t t-set="display_info" t-value="show_name or show_date or show_karma"/>
<t t-if="allow_biography and object.can_display_biography" t-set="bio_popover_data">
<t t-if="allow_biography and object.can_display_biography and request.env.user.karma >= website.karma_profile_min" t-set="bio_popover_data">
<div class="o_wforum_bio_popover_wrap d-flex transition-fade">
<div class="d-flex flex-column">
<img class="o_wforum_avatar flex-shrink-0 rounded me-3" t-att-src="request.website.image_url(object.create_uid, 'avatar_128', '60x60')" alt="Avatar"/>