Initial commit: Core packages
|
|
@ -0,0 +1,4 @@
|
|||
.o_ChannelPreviewView_ratingImage {
|
||||
height: $font-size-base;
|
||||
width: $font-size-base;
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<templates xml:space="preserve">
|
||||
<t t-inherit="mail.ChannelPreviewView" t-inherit-mode="extension">
|
||||
<xpath expr="//*[hasclass('o_ChannelPreviewView_messageBody')]" position="replace">
|
||||
<t t-if="channelPreviewView.isRating">
|
||||
<span class="o_ChannelPreviewView_ratingText">Rating:</span>
|
||||
<img class="o_ChannelPreviewView_ratingImage ms-2" t-att-src="channelPreviewView.thread.lastMessage.rating.ratingImageUrl" t-att-alt="channelPreviewView.thread.lastMessage.rating.ratingText"/>
|
||||
</t>
|
||||
<t t-else="">$0</t>
|
||||
</xpath>
|
||||
</t>
|
||||
</templates>
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
.o_ThreadNeedactionPreview_ratingImage {
|
||||
height: $font-size-base;
|
||||
width: $font-size-base;
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<templates xml:space="preserve">
|
||||
<t t-inherit="mail.ThreadNeedactionPreview" t-inherit-mode="extension">
|
||||
<xpath expr="//*[hasclass('o_ThreadNeedactionPreview_messageBody')]" position="replace">
|
||||
<t t-if="threadNeedactionPreviewView.isRating">
|
||||
<span class="o_ThreadNeedactionPreview_ratingText">Rating:</span>
|
||||
<img class="o_ThreadNeedactionPreview_ratingImage ms-2" t-att-src="threadNeedactionPreviewView.thread.lastNeedactionMessageAsOriginThread.rating.ratingImageUrl" t-att-alt="threadNeedactionPreviewView.thread.lastNeedactionMessageAsOriginThread.rating.ratingText"/>
|
||||
</t>
|
||||
<t t-else="">$0</t>
|
||||
</xpath>
|
||||
</t>
|
||||
</templates>
|
||||
BIN
odoo-bringout-oca-ocb-rating/rating/static/src/img/rating_0.png
Normal file
|
After Width: | Height: | Size: 2 KiB |
|
After Width: | Height: | Size: 2.2 KiB |
BIN
odoo-bringout-oca-ocb-rating/rating/static/src/img/rating_1.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
|
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 68 68"><path d="M34,68A34,34,0,1,1,68,34,34,34,0,0,1,34,68ZM34,4A30,30,0,1,0,64,34,30,30,0,0,0,34,4Z" style="fill:#d23f3a"/><path d="M49.55,51.18a2,2,0,0,1-1.63-.84,17.2,17.2,0,0,0-27.84,0A2,2,0,0,1,16.82,48a21.21,21.21,0,0,1,34.36,0,2,2,0,0,1-1.63,3.2Z" style="fill:#d23f3a"/><circle cx="20.9" cy="30.19" r="4.79" style="fill:#d23f3a"/><circle cx="47" cy="30.19" r="4.79" style="fill:#d23f3a"/></svg>
|
||||
|
After Width: | Height: | Size: 454 B |
|
After Width: | Height: | Size: 2.2 KiB |
BIN
odoo-bringout-oca-ocb-rating/rating/static/src/img/rating_3.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
|
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 68 68"><path d="M34,68A34,34,0,1,1,68,34,34,34,0,0,1,34,68ZM34,4A30,30,0,1,0,64,34,30,30,0,0,0,34,4Z" style="fill:#f7931e"/><path d="M18.45,47.15a2,2,0,0,1,0-4h31.1a2,2,0,0,1,0,4Z" style="fill:#f7931e"/><circle cx="20.9" cy="30.19" r="4.79" style="fill:#f7931e"/><circle cx="47" cy="30.19" r="4.79" style="fill:#f7931e"/></svg>
|
||||
|
After Width: | Height: | Size: 380 B |
|
After Width: | Height: | Size: 2.1 KiB |
BIN
odoo-bringout-oca-ocb-rating/rating/static/src/img/rating_5.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
|
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 68 68"><path d="M34,68A34,34,0,1,1,68,34,34,34,0,0,1,34,68ZM34,4A30,30,0,1,0,64,34,30,30,0,0,0,34,4Z" style="fill:#008818"/><path d="M34,55.21a21.26,21.26,0,0,1-17.18-8.78,2,2,0,1,1,3.26-2.36,17.18,17.18,0,0,0,27.84,0,2,2,0,0,1,3.26,2.36A21.26,21.26,0,0,1,34,55.21Z" style="fill:#008818"/><circle cx="20.9" cy="30.19" r="4.79" style="fill:#008818"/><circle cx="47" cy="30.19" r="4.79" style="fill:#008818"/></svg>
|
||||
|
After Width: | Height: | Size: 466 B |
|
After Width: | Height: | Size: 2.2 KiB |
|
|
@ -0,0 +1,20 @@
|
|||
/** @odoo-module **/
|
||||
|
||||
import { registerPatch } from '@mail/model/model_core';
|
||||
import { attr } from '@mail/model/model_field';
|
||||
|
||||
registerPatch({
|
||||
name: 'ChannelPreviewView',
|
||||
fields: {
|
||||
isEmpty: {
|
||||
compute() {
|
||||
return this.isRating || this._super();
|
||||
},
|
||||
},
|
||||
isRating: attr({
|
||||
compute() {
|
||||
return Boolean(this.thread.lastMessage && this.thread.lastMessage.rating);
|
||||
},
|
||||
}),
|
||||
},
|
||||
});
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
/** @odoo-module **/
|
||||
|
||||
import { registerPatch } from '@mail/model/model_core';
|
||||
import { one } from '@mail/model/model_field';
|
||||
|
||||
registerPatch({
|
||||
name: 'Message',
|
||||
modelMethods: {
|
||||
/**
|
||||
* @override
|
||||
*/
|
||||
convertData(data) {
|
||||
const data2 = this._super(data);
|
||||
if ('rating' in data) {
|
||||
data2.rating = data.rating;
|
||||
}
|
||||
return data2;
|
||||
},
|
||||
},
|
||||
fields: {
|
||||
rating: one('Rating', {
|
||||
isCausal: true,
|
||||
}),
|
||||
},
|
||||
});
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
/** @odoo-module **/
|
||||
|
||||
import { registerModel } from '@mail/model/model_core';
|
||||
import { attr } from '@mail/model/model_field';
|
||||
|
||||
registerModel({
|
||||
name: 'Rating',
|
||||
fields: {
|
||||
id: attr({
|
||||
identifying: true,
|
||||
}),
|
||||
ratingImageUrl: attr({
|
||||
readonly: true,
|
||||
}),
|
||||
ratingText: attr({
|
||||
readonly: true,
|
||||
}),
|
||||
},
|
||||
});
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
/** @odoo-module **/
|
||||
|
||||
import { registerPatch } from '@mail/model/model_core';
|
||||
import { attr } from '@mail/model/model_field';
|
||||
|
||||
registerPatch({
|
||||
name: 'ThreadNeedactionPreviewView',
|
||||
fields: {
|
||||
isEmpty: {
|
||||
compute() {
|
||||
return this.isRating || this._super();
|
||||
},
|
||||
},
|
||||
isRating: attr({
|
||||
compute() {
|
||||
return Boolean(this.thread.lastNeedactionMessageAsOriginThread && this.thread.lastNeedactionMessageAsOriginThread.rating);
|
||||
},
|
||||
}),
|
||||
},
|
||||
});
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
.o_kanban_renderer .o_rating_rating_kanban {
|
||||
.o_kanban_record {
|
||||
width: 350px;
|
||||
}
|
||||
|
||||
.o_rating_kanban_left {
|
||||
min-width: 80px;
|
||||
|
||||
.o_rating_value {
|
||||
font-size: 4rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
/* Rating feedback */
|
||||
.o_rating_page_submit {
|
||||
|
||||
.btn-group > .btn:not(:first-child),
|
||||
.btn-group > .btn-group:not(:first-child) > .btn {
|
||||
margin-left: 0 !important;
|
||||
}
|
||||
.o_rating_label {
|
||||
opacity: 0.5;
|
||||
&:hover {
|
||||
transform: scale(1.1);
|
||||
}
|
||||
img {
|
||||
&.bg-white:hover,
|
||||
&.bg-white:focus {
|
||||
background-color: #ffffff !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.btn-check:checked + .o_rating_label {
|
||||
transform: scale(1.2);
|
||||
opacity: 1;
|
||||
img {
|
||||
&.bg-white:hover,
|
||||
&.bg-white:focus {
|
||||
background-color: #ffffff !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||