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); ?>