diff options
Diffstat (limited to 'addons/hr_holidays/static/src/components/thread_view')
3 files changed, 46 insertions, 0 deletions
diff --git a/addons/hr_holidays/static/src/components/thread_view/thread_view.js b/addons/hr_holidays/static/src/components/thread_view/thread_view.js new file mode 100644 index 00000000..73ca28d4 --- /dev/null +++ b/addons/hr_holidays/static/src/components/thread_view/thread_view.js @@ -0,0 +1,28 @@ +odoo.define('hr_holidays/static/src/components/thread_view/thread_view.js', function (require) { +'use strict'; + +const components = { + ThreadView: require('mail/static/src/components/thread_view/thread_view.js'), +}; + +const { patch } = require('web.utils'); + +patch(components.ThreadView, 'hr_holidays/static/src/components/thread_view/thread_view.js', { + //-------------------------------------------------------------------------- + // Private + //-------------------------------------------------------------------------- + + /** + * @override + */ + _useStoreSelector(props) { + const res = this._super(...arguments); + const thread = res.thread; + const correspondent = thread && thread.correspondent; + return Object.assign({}, res, { + correspondentOutOfOfficeText: correspondent && correspondent.outOfOfficeText, + }); + }, +}); + +}); diff --git a/addons/hr_holidays/static/src/components/thread_view/thread_view.scss b/addons/hr_holidays/static/src/components/thread_view/thread_view.scss new file mode 100644 index 00000000..9cecd24e --- /dev/null +++ b/addons/hr_holidays/static/src/components/thread_view/thread_view.scss @@ -0,0 +1,8 @@ +// ----------------------------------------------------------------------------- +// Layout +// ----------------------------------------------------------------------------- + +.o_ThreadView_outOfOffice { + margin-top: 0; + margin-bottom: 0; +} diff --git a/addons/hr_holidays/static/src/components/thread_view/thread_view.xml b/addons/hr_holidays/static/src/components/thread_view/thread_view.xml new file mode 100644 index 00000000..796dcfba --- /dev/null +++ b/addons/hr_holidays/static/src/components/thread_view/thread_view.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<templates xml:space="preserve"> + <t t-inherit="mail.ThreadView" t-inherit-mode="extension"> + <xpath expr="//*[@name='loadingCondition']" position="before"> + <t t-if="threadView.thread.correspondent and threadView.thread.correspondent.outOfOfficeText"> + <div class="o_ThreadView_outOfOffice alert alert-primary" t-esc="threadView.thread.correspondent.outOfOfficeText" role="alert"/> + </t> + </xpath> + </t> +</templates> |
