diff options
| author | Patrick Hoste <pko@odoo.com> | 2020-05-27 10:12:23 +0000 |
|---|---|---|
| committer | Thibault Delavallée <tde@odoo.com> | 2020-08-11 10:20:04 +0000 |
| commit | 414329dcf1a203e53ced2f4deabdc9e6f314dde7 (patch) | |
| tree | db044d9995268a984d57dbe5e017dfbcd82b8ae3 /addons | |
| parent | 923c1eae5e27fb63723a80a87808915cb478837d (diff) | |
[IMP] portal_rating: allow to tweak popup composer button display
PURPOSE
Change the display of the button to open the composer from btn-primary to
btn-link.
SPECIFICATIONS
In order to ease integration of popup composer rating widget, let us allow
to customize classes given to the button triggering it. In slides we want
specifically it to be a link, not a button.
LINKS
Task ID-2241513
PR #55698
Diffstat (limited to 'addons')
3 files changed, 6 insertions, 3 deletions
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 af6f022e04b..65f2b55b55a 100644 --- a/addons/portal_rating/static/src/xml/portal_rating_composer.xml +++ b/addons/portal_rating/static/src/xml/portal_rating_composer.xml @@ -12,7 +12,9 @@ <t t-set="inline_mode" t-value="true"/> </t> </div> - <button t-if="widget.options['display_composer']" type="button" class="btn btn-sm btn-primary mx-3" data-toggle="modal" data-target="#ratingpopupcomposer"> + <button t-if="widget.options['display_composer']" type="button" + t-att-class="'btn btn-sm mx-3 ' + widget.options['link_btn_classes'] or 'btn-primary'" + data-toggle="modal" data-target="#ratingpopupcomposer"> <t t-if="widget.options['display_composer']"> <t t-if="widget.options['default_message_id']"> Modify your review diff --git a/addons/portal_rating/views/rating_templates.xml b/addons/portal_rating/views/rating_templates.xml index 78561828a00..7125f283f5d 100644 --- a/addons/portal_rating/views/rating_templates.xml +++ b/addons/portal_rating/views/rating_templates.xml @@ -47,7 +47,8 @@ t-att-data-default_rating_value="default_rating_value" 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-disable_composer="disable_composer" + t-att-data-link_btn_classes="_link_btn_classes"> </div> </template> </odoo> diff --git a/addons/website_slides/views/website_slides_templates_course.xml b/addons/website_slides/views/website_slides_templates_course.xml index 8ddb367c90a..e6e547b9ba1 100644 --- a/addons/website_slides/views/website_slides_templates_course.xml +++ b/addons/website_slides/views/website_slides_templates_course.xml @@ -138,7 +138,6 @@ </div> <div class="d-flex flex-column justify-content-center h5 flex-grow-1 mb-md-5" t-if="channel.allow_comment"> <t t-call="portal_rating.rating_stars_static_popup_composer"> - <t t-set="btn_classes" t-value="'btn-warning'"/> <t t-set="rating_avg" t-value="rating_avg"/> <t t-set="rating_total" t-value="rating_count"/> <t t-set="object" t-value="channel"/> @@ -151,6 +150,7 @@ <t t-set="default_attachment_ids" t-value="last_message_attachment_ids"/> <t t-set="force_submit_url" t-value="'/slides/mail/update_comment' if last_message_id else False"/> <t t-set="disable_composer" t-value="not channel.can_review"/> + <t t-set="_link_btn_classes" t-value="'btn-link text-white'"/> </t> </div> </div> |
