summaryrefslogtreecommitdiff
path: root/addons/hr_holidays/static/src/components
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
committerstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
commit3751379f1e9a4c215fb6eb898b4ccc67659b9ace (patch)
treea44932296ef4a9b71d5f010906253d8c53727726 /addons/hr_holidays/static/src/components
parent0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff)
initial commit 2
Diffstat (limited to 'addons/hr_holidays/static/src/components')
-rw-r--r--addons/hr_holidays/static/src/components/partner_im_status_icon/partner_im_status_icon.scss12
-rw-r--r--addons/hr_holidays/static/src/components/partner_im_status_icon/partner_im_status_icon.xml13
-rw-r--r--addons/hr_holidays/static/src/components/thread_icon/thread_icon.scss11
-rw-r--r--addons/hr_holidays/static/src/components/thread_icon/thread_icon.xml13
-rw-r--r--addons/hr_holidays/static/src/components/thread_view/thread_view.js28
-rw-r--r--addons/hr_holidays/static/src/components/thread_view/thread_view.scss8
-rw-r--r--addons/hr_holidays/static/src/components/thread_view/thread_view.xml10
7 files changed, 95 insertions, 0 deletions
diff --git a/addons/hr_holidays/static/src/components/partner_im_status_icon/partner_im_status_icon.scss b/addons/hr_holidays/static/src/components/partner_im_status_icon/partner_im_status_icon.scss
new file mode 100644
index 00000000..e981e30f
--- /dev/null
+++ b/addons/hr_holidays/static/src/components/partner_im_status_icon/partner_im_status_icon.scss
@@ -0,0 +1,12 @@
+// -----------------------------------------------------------------------------
+// Style
+// -----------------------------------------------------------------------------
+
+.o_PartnerImStatusIcon_icon {
+ &.o-leave-online {
+ color: $o-enterprise-primary-color;
+ }
+ &.o-leave-offline {
+ color: theme-color('warning');
+ }
+}
diff --git a/addons/hr_holidays/static/src/components/partner_im_status_icon/partner_im_status_icon.xml b/addons/hr_holidays/static/src/components/partner_im_status_icon/partner_im_status_icon.xml
new file mode 100644
index 00000000..c07377d3
--- /dev/null
+++ b/addons/hr_holidays/static/src/components/partner_im_status_icon/partner_im_status_icon.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<templates xml:space="preserve">
+ <t t-inherit="mail.PartnerImStatusIcon" t-inherit-mode="extension">
+ <xpath expr="//*[@name='rootCondition']" position="inside">
+ <t t-if="partner.im_status === 'leave_online'">
+ <i class="o_PartnerImStatusIcon_icon o-leave-online fa fa-plane fa-stack-1x" title="Online" role="img" aria-label="User is online"/>
+ </t>
+ <t t-if="partner.im_status === 'leave_offline'">
+ <i class="o_PartnerImStatusIcon_icon o-leave-offline fa fa-plane fa-stack-1x" title="Out of office" role="img" aria-label="User is out of office"/>
+ </t>
+ </xpath>
+ </t>
+</templates>
diff --git a/addons/hr_holidays/static/src/components/thread_icon/thread_icon.scss b/addons/hr_holidays/static/src/components/thread_icon/thread_icon.scss
new file mode 100644
index 00000000..4caabb3b
--- /dev/null
+++ b/addons/hr_holidays/static/src/components/thread_icon/thread_icon.scss
@@ -0,0 +1,11 @@
+// ------------------------------------------------------------------
+// Style
+// ------------------------------------------------------------------
+
+.o_ThreadIcon_leaveOnline {
+ color: $o-enterprise-primary-color;
+}
+
+.o_ThreadIcon_leaveOffline {
+ color: theme-color('warning');
+}
diff --git a/addons/hr_holidays/static/src/components/thread_icon/thread_icon.xml b/addons/hr_holidays/static/src/components/thread_icon/thread_icon.xml
new file mode 100644
index 00000000..f8a728a9
--- /dev/null
+++ b/addons/hr_holidays/static/src/components/thread_icon/thread_icon.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<templates xml:space="preserve">
+ <t t-inherit="mail.ThreadIcon" t-inherit-mode="extension">
+ <xpath expr="//*[@name='noImStatusCondition']" position="before">
+ <t t-elif="thread.correspondent.im_status === 'leave_online'">
+ <div class="o_ThreadIcon_leaveOnline fa fa-plane" title="Online"/>
+ </t>
+ <t t-elif="thread.correspondent.im_status === 'leave_offline'">
+ <div class="o_ThreadIcon_leaveOffline fa fa-plane" title="Out of office"/>
+ </t>
+ </xpath>
+ </t>
+</templates>
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>