diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2022-05-10 21:51:50 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2022-05-10 21:51:50 +0700 |
| commit | 3751379f1e9a4c215fb6eb898b4ccc67659b9ace (patch) | |
| tree | a44932296ef4a9b71d5f010906253d8c53727726 /addons/hr_holidays/static/src/components/thread_view | |
| parent | 0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff) | |
initial commit 2
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> |
