diff options
| author | Thibault Delavallée <tde@odoo.com> | 2019-10-24 14:05:48 +0000 |
|---|---|---|
| committer | Thibault Delavallée <tde@odoo.com> | 2019-12-02 15:18:45 +0000 |
| commit | 9e0677882d64ac2be92cd1ea147ce823e2d9f69b (patch) | |
| tree | 389e992bf7ee18cf77ea08ca2e32a945d02c400d /addons/website_rating/static/src/xml/portal_chatter.xml | |
| parent | 82f56ffddfc6aed21030214dc95c0a3e9f5d9a93 (diff) | |
[MOV] website_rating: move to portal_rating
PURPOSE
Clean posting process and improve mail.message definition and comprehension.
Move as much possible content from website_* modules to portal_* modules
to ease their use in customer portal
SPECIFICATIONS
Now that publish feature is replaced by internal directly in mail and portal
rating portal inclusion can be done safely in a portal_ratign module instead
of website_rating. It allows to remove the dependency and give the rating
feature of customer chatter directly in portal applications.
LINKS
Task ID 2071556
PR #38692
Diffstat (limited to 'addons/website_rating/static/src/xml/portal_chatter.xml')
| -rw-r--r-- | addons/website_rating/static/src/xml/portal_chatter.xml | 116 |
1 files changed, 0 insertions, 116 deletions
diff --git a/addons/website_rating/static/src/xml/portal_chatter.xml b/addons/website_rating/static/src/xml/portal_chatter.xml deleted file mode 100644 index ba8fa74cc7c..00000000000 --- a/addons/website_rating/static/src/xml/portal_chatter.xml +++ /dev/null @@ -1,116 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<templates id="template" xml:space="preserve"> - <!-- - Inherited templates from portal to custom chatter with rating - --> - <t t-extend="portal.Composer"> - <t t-jquery="textarea" t-operation="inner"><t t-esc="widget.options['default_message'] ? _.str.trim(widget.options['default_message']) : ''"/></t><!-- need to be one line to avoid \t in textarea --> - <t t-jquery="form" t-operation="attributes"> - <attribute name="t-attf-action">#{widget.options['force_submit_url'] ? widget.options['force_submit_url'] : '/mail/chatter_post'}</attribute> - </t> - <t t-jquery=".o_portal_chatter_composer_form input[name='csrf_token']" t-operation="after"> - <t t-call="website_rating.rating_star_input"> - <t t-set="default_rating" t-value="widget.options['default_rating_value']"/> - </t> - <input type="hidden" name="message_id" t-att-value="widget.options['default_message_id']" t-if="widget.options['default_message_id']"/> - </t> - </t> - - <t t-extend="portal.chatter_messages"> - <t t-jquery="t[t-raw='message.body']" t-operation="before"> - <t t-if="message['rating_value']"> - <t t-call="website_rating.rating_stars_static"> - <t t-set="val" t-value="message.rating_value"/> - </t> - </t> - </t> - <t t-jquery=".o_portal_chatter_attachments" t-operation="after"> - <!--Only possible if a rating is link to the message, for now we can't comment if no rating - is link to the message (because publisher comment data - is on the rating.rating model - one comment max) --> - <t t-if="message.rating and message.rating.id" t-call="website_rating.chatter_rating_publisher"> - <t t-set="is_publisher" t-value="widget.options['is_user_publisher']"/> - <t t-set="rating" t-value="message.rating"/> - </t> - </t> - </t> - - <t t-extend="portal.Chatter"> - <t t-jquery="t[t-call='portal.chatter_message_count']" t-operation="replace"> - <t t-if="widget.options['display_rating']"> - <t t-call="website_rating.rating_card"/> - </t> - <t t-if="!widget.options['display_rating']"> - <t t-call="portal.chatter_message_count"/> - </t> - </t> - </t> - - <!-- - New templates specific of rating in Chatter - --> - <t t-name="website_rating.chatter_rating_publisher"> - <div class="o_wrating_publisher_container"> - <button t-if="is_publisher" - t-attf-class="btn px-2 btn-sm border o_wrating_js_publisher_comment_btn {{ rating.publisher_comment !== '' ? 'd-none' : '' }}" - t-att-data-mes_index="rating.mes_index"> - <i class="fa fa-comment text-muted mr-1"/>Comment - </button> - <div class="o_wrating_publisher_comment mt-2 mb-2"> - <t t-if="rating.publisher_comment" t-call="website_rating.chatter_rating_publisher_comment"/> - </div> - </div> - </t> - - <t t-name="website_rating.chatter_rating_publisher_comment"> - <div class="media o_portal_chatter_message"> - <img class="o_portal_chatter_avatar" t-att-src="rating.publisher_avatar" alt="avatar"/> - <div class="media-body"> - <div class="o_portal_chatter_message_title"> - <div class="d-inline-block"> - <h5><t t-esc="rating.publisher_name"/></h5> - </div> - <div t-if="is_publisher" class="dropdown d-inline-block"> - <button class="btn py-0" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> - <i class="fa fa-ellipsis-v"/> - </button> - <div class="dropdown-menu" aria-labelledby="dropdownMenuButton"> - <button class="dropdown-item o_wrating_js_publisher_comment_edit" t-att-data-mes_index="rating.mes_index"> - <i class="fa fa-fw fa-pencil mr-1"/>Edit - </button> - <button class="dropdown-item o_wrating_js_publisher_comment_delete" t-att-data-mes_index="rating.mes_index"> - <i class="far fa-fw fa-trash-alt mr-1"/>Delete - </button> - </div> - </div> - <p>Published on <t t-esc="rating.publisher_datetime"/></p> - </div> - <t t-raw="rating.publisher_comment"/> - </div> - </div> - </t> - <t t-name="website_rating.chatter_rating_publisher_form"> - <div t-if="is_publisher" class="media o_portal_chatter_message shadow bg-white rounded px-3 py-3 my-1"> - <img class="o_portal_chatter_avatar" t-att-src="rating.publisher_avatar" alt="avatar"/> - <div class="media-body"> - <div class="o_portal_chatter_message_title"> - <h5><t t-esc="rating.publisher_name"/></h5> - <p>Published on <t t-esc="rating.publisher_datetime"/></p> - </div> - <textarea rows="3" class="form-control o_portal_rating_comment_input"><t t-esc="rating.publisher_comment"/></textarea> - <div> - <button class="btn btn-primary mt-2 o_wrating_js_publisher_comment_submit" t-att-data-mes_index="rating.mes_index"> - <t t-if="rating.publisher_comment === ''"> - Post comment - </t><t t-else=""> - Update comment - </t> - </button> - <button class="border btn btn-light mt-2 bg-white o_wrating_js_publisher_comment_cancel" t-att-data-mes_index="rating.mes_index"> - Cancel - </button> - </div> - </div> - </div> - </t> -</templates> |
