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/xml | |
| parent | 0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff) | |
initial commit 2
Diffstat (limited to 'addons/hr_holidays/static/src/xml')
| -rw-r--r-- | addons/hr_holidays/static/src/xml/leave_stats_templates.xml | 65 | ||||
| -rw-r--r-- | addons/hr_holidays/static/src/xml/time_off_calendar.xml | 78 |
2 files changed, 143 insertions, 0 deletions
diff --git a/addons/hr_holidays/static/src/xml/leave_stats_templates.xml b/addons/hr_holidays/static/src/xml/leave_stats_templates.xml new file mode 100644 index 00000000..237ffba9 --- /dev/null +++ b/addons/hr_holidays/static/src/xml/leave_stats_templates.xml @@ -0,0 +1,65 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<templates id="template" xml:space="preserve"> + <t t-name="hr_holidays.leave_per_type"> + <table class="o_group o_inner_group table-striped"> + <thead> + <tr> + <td colspan="2"> + <div class="o_horizontal_separator"><t t-esc="widget.employee.data.display_name"/> in <t t-esc="widget.date.format('YYYY')"/></div> + </td> + </tr> + </thead> + <tbody> + <t t-if="widget.leavesPerType.length === 0"> + <tr> + <td>None</td> + </tr> + </t> + <t t-foreach="widget.leavesPerType" t-as="leave_type"> + <tr> + <td><t t-esc="leave_type.holiday_status_id[1]"/></td> + <td class="w-50"><t t-esc="leave_type.number_of_days"/> day(s)</td> + </tr> + </t> + </tbody> + </table> + </t> + + <t t-name="hr_holidays.department_leave"> + <table class="o_group o_inner_group table-striped"> + <thead> + <tr> + <td colspan="2"> + <div class="o_horizontal_separator"><t t-esc="widget.department.data.display_name"/> in <t t-esc="widget.date.format('MMMM')"/></div> + </td> + </tr> + </thead> + <tbody> + <t t-if="widget.departmentLeaves.length === 0"> + <tr> + <td>None</td> + </tr> + </t> + <t t-foreach="widget.departmentLeaves" t-as="leave"> + <tr t-attf-class="{{leave.employee_id[0] === widget.employee.res_id ? 'font-weight-bold' : ''}}"> + <td><t t-esc="leave.employee_id[1]"/>: <t t-esc="leave.number_of_days"/> day(s) </td> + <td class="w-50"><t t-esc="leave.date_from"/> - <t t-esc="leave.date_to"/></td> + </tr> + </t> + </tbody> + </table> + </t> + + <div t-name="hr_holidays.leave_stats" class="o_leave_stats"> + <t t-if="widget.employee"> + <t t-if="widget.leavesPerType"> + <t t-call="hr_holidays.leave_per_type"/> + </t> + <t t-if="widget.departmentLeaves"> + <t t-call="hr_holidays.department_leave"/> + </t> + </t> + </div> + +</templates> diff --git a/addons/hr_holidays/static/src/xml/time_off_calendar.xml b/addons/hr_holidays/static/src/xml/time_off_calendar.xml new file mode 100644 index 00000000..b041222d --- /dev/null +++ b/addons/hr_holidays/static/src/xml/time_off_calendar.xml @@ -0,0 +1,78 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<templates id="template" xml:space="preserve"> + <t t-name="hr_holidays.dashboard_calendar_header"> + <div class="o_timeoff_container d-flex"> + <div t-foreach="timeoffs" t-as="timeoff" t-attf-class="o_timeoff_card flex-grow-1 d-flex flex-column {{ timeoff_last ? 'o_timeoff_card_last' : '' }}"> + <t t-set="need_allocation" t-value="timeoff[2] !== 'no'"/> + <t t-set="cl" t-value="'text-muted'"/> + + <t t-if="need_allocation && timeoff[1]['virtual_remaining_leaves'] > 0"> + <t t-set="cl" t-value="'o_timeoff_green'"/> + </t> + + <div class="mt-2"> + <t t-if="need_allocation"> + <span t-esc="timeoff[1]['virtual_remaining_leaves']" class="o_timeoff_big o_timeoff_purple"/> / <span t-esc="timeoff[1]['max_leaves']"/> <t t-if="timeoff[1]['request_unit'] == 'hour'">Hours</t><t t-else="">Days</t> + </t> + <t t-else=""> + <span t-esc="timeoff[1]['virtual_leaves_taken']" class="o_timeoff_big o_timeoff_purple"/> <t t-if="timeoff[1]['request_unit'] == 'hour'">Hours</t><t t-else="">Days</t> + </t> + </div> + + <b><span t-esc="timeoff[0]" class="o_timeoff_name"/></b> + + <span class="mb-4" t-if="need_allocation"> + <span t-attf-class="mr-1 font-weight-bold {{ cl }}" t-esc="timeoff[1]['virtual_leaves_taken']"/><span>taken</span> + <t t-if="timeoff[3]"> (Expire on <span t-esc="moment(timeoff[3]).format('L')"/>)</t> + </span> + </div> + </div> + </t> + + <t t-name="hr_holidays.dashboard.calendar.button"> + <button class="btn btn-primary btn-time-off" type="button"> + <t t-esc="time_off"/> + </button> + <button class="btn btn-secondary btn-allocation" type="button"> + <t t-esc="request"/> + </button> + </t> + + <t t-name="hr_holidays.calendar.popover.placeholder"> + <div t-attf-class="o_cw_popover popover card shadow #{typeof color === 'number' ? _.str.sprintf('o_calendar_color_%s', color) : ''}" role="tooltip"> + <div class="arrow"/> + <div class="card-header d-flex justify-content-between py-2 pr-2"> + <h4 class="popover-header border-0 p-0 pt-1"/> + <div class="ml-4"> + <i t-if="calendarIcon" t-attf-class="fa {{calendarIcon}}"></i> + <span class="o_cw_popover_close ml-1"><i class="fa fa-close small"/></span> + </div> + </div> + <div class="o_cw_body"> + </div> + </div> + </t> + + <t t-name="hr_holidays.calendar.popover"> + <div class="o_cw_body"> + <ul class="list-group list-group-flush"> + <li t-if="!widget.hideDate and widget.eventDate.date" class="list-group-item"> + <b class="text-capitalize" t-esc="widget.eventDate.date"/> <small t-if="widget.eventDate.duration"><b t-esc="_.str.sprintf('(%s)', widget.eventDate.duration)"/></small> + </li> + <li t-if="!widget.hideTime and widget.eventTime.time" class="list-group-item"> + <b t-esc="widget.eventTime.time"/> <small t-if="widget.eventTime.duration"><b t-esc="_.str.sprintf('(%s)', widget.eventTime.duration)"/></small> + </li> + </ul> + <ul class="list-group list-group-flush o_cw_popover_fields_secondary" t-if="widget.display_name"> + <li class="list-group-item"> + <span class="o_field_char o_field_widget" t-esc="widget.display_name" /> + </li> + </ul> + <div class="card-footer border-top" t-if="widget.canEdit or widget.canDelete"> + <a t-if="widget.canEdit" href="#" class="btn btn-primary o_cw_popover_edit">Edit</a> + <a t-if="widget.canDelete" href="#" class="btn btn-secondary o_cw_popover_delete ml-2">Delete</a> + </div> + </div> + </t> +</templates> |
