From e3b5b20b39ddd6faefb8edada3b0c42d769376c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Mottet=20=28oms=29?= Date: Tue, 31 Mar 2020 09:47:27 +0000 Subject: [PATCH] [IMP] website_[profile|forum]: show filtering forum on user profile page - A tag has been added next to the title of each tab in the profile when the user come from a specific forum. The goal is to indicate to the user that the displayed content is specific to a given forum. The tag can be clicked by the user to remove the applied filter. - Change label in edit profile page from "real name" to "name" Task Id: 2214425 closes odoo/odoo#48665 Signed-off-by: Thibault Delavallee (tde) --- addons/website_forum/controllers/main.py | 5 +++- .../views/website_forum_profile.xml | 26 ++++++++++++++++--- .../website_profile/views/website_profile.xml | 2 +- 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/addons/website_forum/controllers/main.py b/addons/website_forum/controllers/main.py index a07de8ae4e7..dfac6dc75a9 100644 --- a/addons/website_forum/controllers/main.py +++ b/addons/website_forum/controllers/main.py @@ -555,7 +555,10 @@ class WebsiteForum(WebsiteProfile): forums = post['forum'] elif post.get('forum_id'): forums = request.env['forum.forum'].browse(int(post['forum_id'])) - values.update({'edit_button_url_param': 'forum_id=' + str(post['forum_id'])}) + values.update({ + 'edit_button_url_param': 'forum_id=%s' % str(post['forum_id']), + 'forum_filtered': forums.name, + }) else: forums = request.env['forum.forum'].search([]) diff --git a/addons/website_forum/views/website_forum_profile.xml b/addons/website_forum/views/website_forum_profile.xml index 541aadf4a29..5ac4de54d05 100644 --- a/addons/website_forum/views/website_forum_profile.xml +++ b/addons/website_forum/views/website_forum_profile.xml @@ -56,7 +56,10 @@
-
Questions
+
+ Questions + +
@@ -87,7 +90,11 @@
-
Answers
+
+ Answers + +
+
@@ -106,7 +113,10 @@
-
Activities
+
+ Activities + +
@@ -114,6 +124,16 @@ + +