[FIX] hr_homeworking: fix homeworking button not clickable in week scale

https://github.com/odoo/odoo/pull/138670 changed how the set location buttons
look, however this change started causing the button not to be clickable. This
commit fixes this issue. Also we change the button text from "add location" to
"set location". On top of that, the "set location" button takes too much space,
creating a big gap between the date and the events for that day. To make the
gap smaller, we reduced the size of the button.

task-3570053

Part-of: odoo/odoo#139736
This commit is contained in:
Leonardo Pavan Rocha
2023-11-04 00:38:21 +00:00
parent d1285bc41c
commit 82c9e8f85c
3 changed files with 5 additions and 7 deletions
@@ -93,7 +93,7 @@ patch(AttendeeCalendarCommonRenderer.prototype, {
onDayRender(info){
const parsedDate = DateTime.fromJSDate(info.date).toISODate();
if (this.props.model.scale === 'week' || this.props.model.scale === 'day'){
const button = info.view.context.calendar.el.querySelector(`.fc-day-header[data-date='${parsedDate}'] o_worklocation_text`)
const button = info.view.context.calendar.el.querySelector(`.fc-day-header[data-date='${parsedDate}'] .o_worklocation_text`)
const line = info.view.context.calendar.el.querySelector(`.fc-day-header[data-date='${parsedDate}'] .o_worklocation_line`)
if (!button || !line)
return;
@@ -1,12 +1,10 @@
.o_worklocation_btn {
margin: 2px;
.o_worklocation_text, .o_worklocation_line {
box-shadow: 0 1px 0 rgba(0,0,0, 0.3)
}
.o_worklocation_text {
font-size: $o-font-size-base-smaller;
font-size: o-to-rem(10px);
}
}
@@ -38,12 +38,12 @@
</t>
<t t-name="hr.homeworking.CalendarCommonRenderer.buttonWorklocation">
<div class="o_worklocation_btn d-flex align-items-center opacity-0 opacity-100-hover">
<div class="o_worklocation_btn w-100 d-flex align-items-center opacity-0 opacity-100-hover">
<button class='o_worklocation_text bg-info bg-opacity-25 border-0 rounded-pill px-lg-2 py-0 text-nowrap'>
<i class="fa fa-map-marker me-lg-1" aria-hidden="true"></i>
<span class="d-none d-lg-inline fw-bold">Add Location</span>
<span class="d-lg-inline fw-bold">Set Location</span>
</button>
<button class="o_worklocation_line d-none d-lg-block w-100 bg-info bg-opacity-25 border-0 p-0"/>
<button class="o_worklocation_line d-lg-block w-100 bg-info bg-opacity-25 border-0 p-0"/>
</div>
</t>
</templates>