| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
| 2 |
<templates xml:space="preserve"> |
| 3 |
<t t-inherit="mail.Message" t-inherit-mode="extension"> |
| 4 |
<xpath expr="//div[@name='header']" position="after"> |
| 5 |
<div t-if="ratingValue" class="mb-2"> |
| 6 |
<t t-call="portal_rating.rating_stars_static"> |
| 7 |
<t t-set="val" t-value="ratingValue"/> |
| 8 |
</t> |
| 9 |
</div> |
| 10 |
</xpath> |
| 11 |
<xpath expr="//*[@t-ref='messageContent']" position="inside"> |
| 12 |
<!--Only possible if a rating is link to the message, for now we can't comment if no rating |
| 13 |
is link to the message (because publisher comment data |
| 14 |
is on the rating.rating model - one comment max) --> |
| 15 |
<div t-if="message.rating_id and message.rating_id.id" class="o_wrating_publisher_container"> |
| 16 |
<button t-if="store.self.is_user_publisher" |
| 17 |
t-attf-class="btn px-2 my-2 btn-sm border o_wrating_js_publisher_comment_btn {{ message.rating_id.publisher_comment !== '' ? 'd-none' : '' }}" |
| 18 |
t-att-data-mes_index="message.rating_id.mes_index" |
| 19 |
t-on-click="onClikEditComment"> |
| 20 |
<i class="fa fa-comment text-muted me-1"/>Comment |
| 21 |
</button> |
| 22 |
<div t-if="state.editRating" class="mt-2"> |
| 23 |
<Composer autofocus="true" composer="message.composer" onDiscardCallback.bind="exitEditCommentMode" onPostCallback.bind="exitEditCommentMode" mode="'compact'"/> |
| 24 |
</div> |
| 25 |
<div t-if="message.rating_id.publisher_comment and !state.editRating" class="o_wrating_publisher_comment mt-2 mb-2"> |
| 26 |
<div class="o-mail-Message-core position-relative d-flex flex-shrink-0"> |
| 27 |
<div class="o-mail-Message-sidebar d-flex flex-shrink-0"> |
| 28 |
<div class="o-mail-Message-avatarContainer position-relative"> |
| 29 |
<img class="o-mail-Message-avatar w-100 h-100 rounded" |
| 30 |
t-att-src="message.rating_id.publisher_avatar" t-att-class="authorAvatarAttClass"/> |
| 31 |
</div> |
| 32 |
</div> |
| 33 |
<div class="w-100 o-min-width-0"> |
| 34 |
<div class="o-mail-Message-header d-flex flex-wrap align-items-baseline mb-1 lh-1"> |
| 35 |
<strong class="me-1 text-truncate"><t t-esc="message.rating_id.publisher_name"/></strong> |
| 36 |
<small class="text-muted opacity-50 me-2">Published on <t t-esc="message.rating_id.publisher_datetime"/></small> |
| 37 |
<div t-if="store.self.is_user_publisher" class="d-flex rounded-0"> |
| 38 |
<Dropdown> |
| 39 |
<button class="bg-transparent border-0"> |
| 40 |
<i class="btn px-1 py-0 oi oi-ellipsis-v"/> |
| 41 |
</button> |
| 42 |
<t t-set-slot="content"> |
| 43 |
<DropdownItem class="'o_wrating_js_publisher_comment_edit'" onSelected="() => this.onClikEditComment()"> |
| 44 |
<i class="fa fa-fw fa-pencil me-1"/>Edit |
| 45 |
</DropdownItem> |
| 46 |
<DropdownItem class="'o_wrating_js_publisher_comment_delete'" onSelected="() => this.deleteComment()"> |
| 47 |
<i class="fa fa-fw fa-trash-o me-1"/>Delete |
| 48 |
</DropdownItem> |
| 49 |
</t> |
| 50 |
</Dropdown> |
| 51 |
</div> |
| 52 |
</div> |
| 53 |
<div class="position-relative d-flex"> |
| 54 |
<div class="o-min-width-0 position-relative d-flex overflow-x-auto d-inline-block"> |
| 55 |
<div class="o-mail-Message-bubble rounded-bottom-3 position-absolute top-0 start-0 w-100 h-100 bg-info-light opacity-25 rounded-end-3"/> |
| 56 |
<div class="position-relative text-break o-mail-Message-body mb-0 py-2 px-3 align-self-start rounded-end-3 rounded-bottom-3"> |
| 57 |
<p><t t-out="message.rating_id.publisher_comment"/></p> |
| 58 |
</div> |
| 59 |
</div> |
| 60 |
</div> |
| 61 |
</div> |
| 62 |
</div> |
| 63 |
</div> |
| 64 |
</div> |
| 65 |
</xpath> |
| 66 |
</t> |
| 67 |
</templates> |