forked from OCA/social
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
26d37c8
commit db55715
Showing
7 changed files
with
82 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,60 @@ | ||
/* Copyright 2021 Creu Blanca | ||
* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
*/ | ||
odoo.define('mail_quote_reply.reply', function (require) { | ||
odoo.define("mail_quote_reply.reply", function(require) { | ||
"use strict"; | ||
|
||
var ThreadWidget = require('mail.widget.Thread'); | ||
var ThreadField = require('mail.ThreadField'); | ||
var DocumentThread = require('mail.model.DocumentThread'); | ||
var ThreadWidget = require("mail.widget.Thread"); | ||
var ThreadField = require("mail.ThreadField"); | ||
var DocumentThread = require("mail.model.DocumentThread"); | ||
|
||
DocumentThread.include({ | ||
_fetchMessages: function(options) { | ||
if (options && options.forceReloadMessages) { | ||
this._mustFetchMessageIDs = true; | ||
} | ||
return this._super.apply(this, arguments) | ||
} | ||
return this._super.apply(this, arguments); | ||
}, | ||
}); | ||
|
||
ThreadField.include({ | ||
start: function () { | ||
start: function() { | ||
var self = this; | ||
return this._super.apply(this, arguments).then(function () { | ||
self._threadWidget.on('reload_thread_messages', self, self._onReloadThreadMessages); | ||
}) | ||
return this._super.apply(this, arguments).then(function() { | ||
self._threadWidget.on( | ||
"reload_thread_messages", | ||
self, | ||
self._onReloadThreadMessages | ||
); | ||
}); | ||
}, | ||
_onReloadThreadMessages: function () { | ||
this._fetchAndRenderThread({forceReloadMessages: true }); | ||
_onReloadThreadMessages: function() { | ||
this._fetchAndRenderThread({forceReloadMessages: true}); | ||
}, | ||
}); | ||
|
||
ThreadWidget.include({ | ||
events: _.defaults({ | ||
"click .o_thread_mail_message_reply": "_onClickMailMessageReply", | ||
}, ThreadWidget.prototype.events), | ||
events: _.defaults( | ||
{ | ||
"click .o_thread_mail_message_reply": "_onClickMailMessageReply", | ||
}, | ||
ThreadWidget.prototype.events | ||
), | ||
|
||
_onClickMailMessageReply: function(event) { | ||
var self = this, | ||
msg_id = $(event.currentTarget).data('message-id'); | ||
msg_id = $(event.currentTarget).data("message-id"); | ||
this._rpc({ | ||
model: "mail.message", | ||
method: "reply_message", | ||
args: [msg_id], | ||
}).then(function (result) { | ||
self.do_action(result, { | ||
on_close: function () { | ||
self.trigger('reload_thread_messages'); | ||
}, | ||
}); | ||
model: "mail.message", | ||
method: "reply_message", | ||
args: [msg_id], | ||
}).then(function(result) { | ||
self.do_action(result, { | ||
on_close: function() { | ||
self.trigger("reload_thread_messages"); | ||
}, | ||
}); | ||
}); | ||
}, | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<!-- Copyright 2021 Creu Blanca | ||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). --> | ||
<template> | ||
<t t-extend="mail.widget.Thread.Message"> | ||
<t t-jquery=".o_thread_message_reply" t-operation="after"> | ||
<i t-if="message.isLinkedToDocumentThread() and !options.displayReplyIcons and !message.isSystemNotification()" | ||
class="fa fa-reply o_thread_icon o_thread_mail_message_reply" | ||
t-att-data-message-id="message.getID()" title="Reply" role="img" aria-label="Reply"/> | ||
<i | ||
t-if="message.isLinkedToDocumentThread() and !options.displayReplyIcons and !message.isSystemNotification()" | ||
class="fa fa-reply o_thread_icon o_thread_mail_message_reply" | ||
t-att-data-message-id="message.getID()" | ||
title="Reply" | ||
role="img" | ||
aria-label="Reply" | ||
/> | ||
</t> | ||
</t> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,19 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
|
||
<?xml version="1.0" encoding="utf-8" ?> | ||
<!-- Copyright 2014-2015 Grupo ESOC <http://www.grupoesoc.es> | ||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). --> | ||
|
||
<odoo> | ||
|
||
<template id="assets_backend" | ||
name="mail_quoted_reply assets" | ||
inherit_id="web.assets_backend"> | ||
<template | ||
id="assets_backend" | ||
name="mail_quoted_reply assets" | ||
inherit_id="web.assets_backend" | ||
> | ||
<xpath expr="." position="inside"> | ||
|
||
<script type="text/javascript" | ||
src="/mail_quoted_reply/static/src/js/mail_message_reply.js"/> | ||
<script | ||
type="text/javascript" | ||
src="/mail_quoted_reply/static/src/js/mail_message_reply.js" | ||
/> | ||
</xpath> | ||
</template> | ||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters