Skip to content
Snippets Groups Projects
Commit 414329dc authored by Patrick Hoste's avatar Patrick Hoste Committed by Thibault Delavallée
Browse files

[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
parent 923c1eae
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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>
......@@ -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>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment