[IMP] mail: thread: parameterize the display of messages' star
To allow hiding it in livechat windows on the website.
This commit is contained in:
@@ -16,12 +16,15 @@ return Widget.extend({
|
||||
"click .o_chat_title": "on_click_fold",
|
||||
},
|
||||
|
||||
init: function (parent, channel_id, title, is_folded) {
|
||||
init: function (parent, channel_id, title, is_folded, options) {
|
||||
this._super(parent);
|
||||
this.title = title;
|
||||
this.channel_id = channel_id;
|
||||
this.placeholder = _t("Say something");
|
||||
this.folded = is_folded;
|
||||
this.options = _.defaults(options || {}, {
|
||||
display_stars: true,
|
||||
});
|
||||
},
|
||||
start: function () {
|
||||
this.$content = this.$('.o_chat_content');
|
||||
@@ -30,6 +33,7 @@ return Widget.extend({
|
||||
this.thread = new ChatThread(this, {
|
||||
display_avatar: false,
|
||||
display_needactions: false,
|
||||
display_stars: this.options.display_stars,
|
||||
});
|
||||
this.thread.on('toggle_star_status', this, function (message_id) {
|
||||
this.trigger('toggle_star_status', message_id);
|
||||
|
||||
@@ -34,6 +34,7 @@ var Thread = Widget.extend({
|
||||
this.options = _.defaults(options || {}, {
|
||||
display_order: ORDER.ASC,
|
||||
display_needactions: true,
|
||||
display_stars: true,
|
||||
default_username: _t('Anonymous'),
|
||||
display_document_link: true,
|
||||
display_avatar: true,
|
||||
|
||||
@@ -37,8 +37,12 @@
|
||||
</div>
|
||||
<div class="o_thread_message_core">
|
||||
<span class="pull-right">
|
||||
<i t-if="message.is_needaction && options.display_needactions" class="fa fa-check o_thread_message_needaction" t-att-data-message-id="message.id" t-att-title="_t('Mark as Done')"/>
|
||||
<i t-att-class="'fa fa-lg o_thread_message_star ' + (message.is_starred ? 'fa-star' : 'fa-star-o')" t-att-data-message-id="message.id" t-att-title="_t('Mark as Todo')"/>
|
||||
<i t-if="message.is_needaction && options.display_needactions"
|
||||
class="fa fa-check o_thread_message_needaction"
|
||||
t-att-data-message-id="message.id" t-att-title="_t('Mark as Done')"/>
|
||||
<i t-if="options.display_stars"
|
||||
t-att-class="'fa fa-lg o_thread_message_star ' + (message.is_starred ? 'fa-star' : 'fa-star-o')"
|
||||
t-att-data-message-id="message.id" t-att-title="_t('Mark as Todo')"/>
|
||||
</span>
|
||||
<p class="text-muted">
|
||||
<t t-if="message.is_note">
|
||||
|
||||
Reference in New Issue
Block a user