From c66bf143564eb45b9801f0f3be69a905f75a1874 Mon Sep 17 00:00:00 2001 From: Damiano Lombardi Date: Mon, 25 May 2026 07:21:53 +0200 Subject: [PATCH 1/3] Highlight today date in the table view --- assets/styles/app.css | 4 ++++ templates/Reservations/reservation_table.html.twig | 11 ++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/assets/styles/app.css b/assets/styles/app.css index 81023914..54e6d369 100644 --- a/assets/styles/app.css +++ b/assets/styles/app.css @@ -616,6 +616,10 @@ body { background-color: var(--feb-weekend-bg) !important; } +#reservation-table tbody td.reservation-table-today { + background-color: rgba(13, 110, 253, 0.08) !important; +} + /* 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) { 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 %} -
{% elseif cell.type == 'blocked' %} {# Blocked cell #} - +
{% else %} {# Empty half-day cell #} - From 5fc8d079d94e00ad3526cd2a545a7f2a5b26a4b2 Mon Sep 17 00:00:00 2001 From: Damiano Lombardi Date: Mon, 25 May 2026 07:59:51 +0200 Subject: [PATCH 2/3] Yearly view today highlight --- assets/styles/app.css | 9 ++++++++- .../Reservations/reservation_table_month.html.twig | 14 +++++++++++--- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/assets/styles/app.css b/assets/styles/app.css index 54e6d369..d1894bbc 100644 --- a/assets/styles/app.css +++ b/assets/styles/app.css @@ -620,6 +620,13 @@ body { 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) { @@ -677,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_month.html.twig b/templates/Reservations/reservation_table_month.html.twig index e6530b08..66ae77eb 100644 --- a/templates/Reservations/reservation_table_month.html.twig +++ b/templates/Reservations/reservation_table_month.html.twig @@ -1,5 +1,7 @@ {# year and month are provided #} {% set startDate = date(year ~ '-' ~ month ~ '-01 UTC') %} +{# set today date for highlight #} +{% set todayDate = 'now'|date('Y-m-d') %} {# this is a dummy date where the first of month is monday which is used for the table header #} {% set dummyDate = date('2021-11-01 UTC') %} @@ -104,10 +106,16 @@ {% set tdContent = tdContent ~ '
 
' ~ dummyContent %} {% endfor %} - -
{{ tdContent|raw }}
-
{{ tmpDate|date('d') }}
+
+ {% if isToday %}
{% endif %} + {{ tdContent|raw }} +
+
{{ tmpDate|date('d') }}
From f227aa66afee3f0bd7e9aed92898c1531eb4036a Mon Sep 17 00:00:00 2001 From: Damiano Lombardi Date: Mon, 25 May 2026 08:07:28 +0200 Subject: [PATCH 3/3] Fix highlight for days with no reservtions --- templates/Reservations/reservation_table_month.html.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/Reservations/reservation_table_month.html.twig b/templates/Reservations/reservation_table_month.html.twig index 66ae77eb..7bbab90e 100644 --- a/templates/Reservations/reservation_table_month.html.twig +++ b/templates/Reservations/reservation_table_month.html.twig @@ -111,8 +111,8 @@ {% set todayCss = isToday ? ' reservation-table-today' : '' %} -
- {% if isToday %}
{% endif %} + {% if isToday %}
{% endif %} +
{{ tdContent|raw }}
{{ tmpDate|date('d') }}