From db7b15988bc46cdb1ab935f7ab93447430aac817 Mon Sep 17 00:00:00 2001 From: std-odoo Date: Thu, 17 Dec 2020 09:46:08 +0000 Subject: [PATCH] [IMP] portal: allow better customization of the portal rating composer Purpose ======= Add a new option on the portal rating composer, "hide_rating_avg" in order to hide the global rating on the button and allow to fully customize the button. Also allow to customize the text style and to add an icon on the button. Add the dependency "portal_chatter.xml" from portal rating on the portal composer Widget. It already has the dependency "portal_chatter.xml" from the simple portal module, but because the second file was not in the dependency, the view was not inherited if we add the widget in a fullscreen view. Task 2322583 --- .../static/src/js/portal_rating_composer.js | 1 + .../static/src/xml/portal_rating_composer.xml | 21 +++++++++++-------- .../portal_rating/views/rating_templates.xml | 5 ++++- .../views/website_slides_templates_course.xml | 2 +- 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/addons/portal_rating/static/src/js/portal_rating_composer.js b/addons/portal_rating/static/src/js/portal_rating_composer.js index 71c53f98c39..ec39284de81 100644 --- a/addons/portal_rating/static/src/js/portal_rating_composer.js +++ b/addons/portal_rating/static/src/js/portal_rating_composer.js @@ -17,6 +17,7 @@ var RatingPopupComposer = publicWidget.Widget.extend({ template: 'portal_rating.PopupComposer', xmlDependencies: [ '/portal/static/src/xml/portal_chatter.xml', + '/portal_rating/static/src/xml/portal_chatter.xml', '/portal_rating/static/src/xml/portal_tools.xml', '/portal_rating/static/src/xml/portal_rating_composer.xml', ], diff --git a/addons/portal_rating/static/src/xml/portal_rating_composer.xml b/addons/portal_rating/static/src/xml/portal_rating_composer.xml index 80ef4441048..b437314d80b 100644 --- a/addons/portal_rating/static/src/xml/portal_rating_composer.xml +++ b/addons/portal_rating/static/src/xml/portal_rating_composer.xml @@ -7,22 +7,25 @@
- +
diff --git a/addons/portal_rating/views/rating_templates.xml b/addons/portal_rating/views/rating_templates.xml index 322e7268b12..c617fd138b8 100644 --- a/addons/portal_rating/views/rating_templates.xml +++ b/addons/portal_rating/views/rating_templates.xml @@ -50,7 +50,10 @@ t-att-data-default_attachment_ids="default_attachment_ids" t-att-data-force_submit_url="force_submit_url" t-att-data-disable_composer="disable_composer" - t-att-data-link_btn_classes="_link_btn_classes"> + t-att-data-link_btn_classes="_link_btn_classes" + t-att-data-icon="icon" + t-att-data-text_classes="_text_classes" + t-att-data-hide_rating_avg="hide_rating_avg"> diff --git a/addons/website_slides/views/website_slides_templates_course.xml b/addons/website_slides/views/website_slides_templates_course.xml index 27ab0d45d2b..49f9aa8b3ac 100644 --- a/addons/website_slides/views/website_slides_templates_course.xml +++ b/addons/website_slides/views/website_slides_templates_course.xml @@ -154,7 +154,7 @@ - +