From abe77a9b9d97ab64c31c6c8a4aad95d547d688e6 Mon Sep 17 00:00:00 2001 From: Alexander Bocken Date: Fri, 15 May 2026 13:26:15 +0200 Subject: [PATCH] Gap between event cards; dotless rows drop day, keep just year MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Each event row is now a self-contained card (full border on all four sides, rounded all four corners). border-spacing on the section table inserts a 10px vertical gap between cards so they read as distinct entries. The timeline rail breaks along with the cards, which actually reads better — each event feels like its own beat on the timeline rather than rungs of a ladder. - When two events share an upcoming day, the second row (dotless) used to repeat "17. MAI" — wasted vertical space. It now only prints the year, bumped up to 14px so it carries on its own. The always-visible year is also slightly larger (13px vs 11px) and tonally lifted from #aaa muted to #777 tertiary so it pairs evenly with the day-month line above it. --- resources/views/email.phtml | 84 ++++++++++++++++++++----------------- 1 file changed, 45 insertions(+), 39 deletions(-) diff --git a/resources/views/email.phtml b/resources/views/email.phtml index 4f764f2..0d936b5 100644 --- a/resources/views/email.phtml +++ b/resources/views/email.phtml @@ -431,11 +431,16 @@ $summary_item_style = 'padding:3px 0;'; // // $show_dot suppresses the dot on rows whose upcoming-day matches // the previous row, so each calendar day has exactly one dot. +// Every row is now a self-contained mini-card (full border on all +// sides, rounded corners). Vertical gaps between rows come from the +// outer table's border-spacing — the rail naturally breaks between +// rows along with the cards. +// +// $show_dot suppresses the dot AND the day+month line on rows whose +// upcoming-day matches the previous (only the year is then shown). $event_row = static function ( Fact $fact, string $body_html, - bool $is_first, - bool $is_last, bool $show_dot, ) use ( @@ -448,25 +453,15 @@ $event_row = static function ( $card_corner_radius, $palette, ): string { - $avatar_extra = ''; - $content_extra = ''; + $avatar_extra = 'border-top:1px solid ' . $palette['border'] . ';' + . 'border-bottom:1px solid ' . $palette['border'] . ';' + . 'border-top-left-radius:' . $card_corner_radius . 'px;' + . 'border-bottom-left-radius:' . $card_corner_radius . 'px;'; - if ($is_first) { - $avatar_extra .= 'border-top:1px solid ' . $palette['border'] . ';' - . 'border-top-left-radius:' . $card_corner_radius . 'px;'; - $content_extra .= 'border-top:1px solid ' . $palette['border'] . ';' - . 'border-top-right-radius:' . $card_corner_radius . 'px;'; - } - - if ($is_last) { - $avatar_extra .= 'border-bottom:1px solid ' . $palette['border'] . ';' - . 'border-bottom-left-radius:' . $card_corner_radius . 'px;'; - $content_extra .= 'border-bottom:1px solid ' . $palette['border'] . ';' - . 'border-bottom-right-radius:' . $card_corner_radius . 'px;'; - } else { - $avatar_extra .= 'border-bottom:1px solid ' . $palette['border'] . ';'; - $content_extra .= 'border-bottom:1px solid ' . $palette['border'] . ';'; - } + $content_extra = 'border-top:1px solid ' . $palette['border'] . ';' + . 'border-bottom:1px solid ' . $palette['border'] . ';' + . 'border-top-right-radius:' . $card_corner_radius . 'px;' + . 'border-bottom-right-radius:' . $card_corner_radius . 'px;'; $parts = $date_parts($fact); @@ -477,13 +472,24 @@ $event_row = static function ( . 'box-shadow:0 0 0 4px ' . $palette['bg'] . ';">' : ''; - $date_html = - '' - . '
' . e($parts['day_month']) . '
' - . '
' . e($parts['year']) . '
' - . '
'; + // When the dot is suppressed, also drop the day+month (it's + // the same as the row above) and show only the year — a touch + // larger than the always-visible year so it reads on its own. + if ($show_dot) { + $date_html = + '' + . '
' . e($parts['day_month']) . '
' + . '
' . e($parts['year']) . '
' + . '
'; + } else { + $date_html = + '' + . e($parts['year']) + . ''; + } return '' . '' . $record_avatars($fact) . '' @@ -493,10 +499,10 @@ $event_row = static function ( . ''; }; -// Outer section table is transparent. Each event row contributes its -// own card-surfaced avatar+content TDs plus the timeline TD. +// Outer section table is transparent. border-spacing puts a 10px +// vertical gap between rows so each card stands on its own. $card_open = ''; + . 'style="width:100%;border-collapse:separate;border-spacing:0 10px;">'; $card_close = '
'; ?> @@ -554,8 +560,8 @@ $card_close = '';

- - $fact) : ?> + + ' . $event_icon('BIRT') . '' @@ -565,7 +571,7 @@ $card_close = ''; . ''; $show_dot = ($fact->jd ?? 0) !== $prev_jd; $prev_jd = $fact->jd ?? 0; - echo $event_row($fact, $body, $i === 0, $i === $total - 1, $show_dot); + echo $event_row($fact, $body, $show_dot); ?> @@ -603,8 +609,8 @@ $card_close = '';

- - $fact) : ?> + + ' . $event_icon('MARR') . '' @@ -614,7 +620,7 @@ $card_close = ''; . ''; $show_dot = ($fact->jd ?? 0) !== $prev_jd; $prev_jd = $fact->jd ?? 0; - echo $event_row($fact, $body, $i === 0, $i === $total - 1, $show_dot); + echo $event_row($fact, $body, $show_dot); ?> @@ -652,8 +658,8 @@ $card_close = '';

- - $fact) : ?> + + ' . $event_icon($kind) . '' @@ -663,7 +669,7 @@ $card_close = ''; . ''; $show_dot = ($fact->jd ?? 0) !== $prev_jd; $prev_jd = $fact->jd ?? 0; - echo $event_row($fact, $body, $i === 0, $i === $total - 1, $show_dot); + echo $event_row($fact, $body, $show_dot); ?>