diff --git a/assets/styles/app.css b/assets/styles/app.css index 81023914..d1894bbc 100644 --- a/assets/styles/app.css +++ b/assets/styles/app.css @@ -616,6 +616,17 @@ body { background-color: var(--feb-weekend-bg) !important; } +#reservation-table tbody td.reservation-table-today { + background-color: rgba(13, 110, 253, 0.08) !important; +} + +/* Overlay for today highlight in yearly view */ +.reservation-table-today-overlay { + pointer-events: none; + z-index: 2; + background: rgba(13, 110, 253, 0.18); + border-radius: 0.25rem; +} /* remove bottom border of tr for multiple reservations of one apartment (select tr where the next tr has border-top-0 class) */ #reservation-table tr:has( + .border-top-0) { @@ -673,7 +684,7 @@ div .reservation-yearly-day { position: absolute; left: 0; top: 0; - z-index: 2; + z-index: 3; padding: .5rem; } .month-reservationstartend { diff --git a/templates/Reservations/reservation_table.html.twig b/templates/Reservations/reservation_table.html.twig index f52130c8..ca30dabb 100644 --- a/templates/Reservations/reservation_table.html.twig +++ b/templates/Reservations/reservation_table.html.twig @@ -91,6 +91,7 @@
{% set totalColumnCount = grid.dayColumns|length * 2 + 1 %} {% set emptyTdNr = 0 %} + {% set todayDate = 'now'|date('Y-m-d') %} {% for row in grid.rows %} {# Subsidiary group header #} @@ -122,10 +123,14 @@ {# ── Cells ── #} {% for cell in row.cells %} + {% set cellEndOffset = cell.startsAtDayBoundary ? ((cell.span - 1) / 2)|round(0, 'floor') : (cell.span / 2)|round(0, 'floor') %} + {% set cellEndDate = cell.date|date_modify('+' ~ cellEndOffset ~ ' day')|date('Y-m-d') %} + {% set isSingleDayCell = cell.span <= 2 %} + {% set todayCss = isSingleDayCell and todayDate >= cell.date and todayDate <= cellEndDate ? ' reservation-table-today' : '' %} {% if cell.type == 'reservation' %} {# Reservation cell #} {% set reservation = cell.reservation %} -