From f0a014a077fac95ff4615dde8df59d8ffc470af0 Mon Sep 17 00:00:00 2001 From: smueller Date: Tue, 7 Jul 2026 13:32:57 +0200 Subject: [PATCH] Refactor newsletter HTML generation for improved styling and consistency - Update the "Top Highlights" section to use new color variables and enhanced padding for better visual appeal. - Change the eyebrow text for article cards to uppercase for consistency with design standards. - Adjust padding and margin styles in article cards to improve layout and readability in Outlook-compatible HTML. --- app/services/newsletter.py | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/app/services/newsletter.py b/app/services/newsletter.py index fbdc58b..abcdb49 100644 --- a/app/services/newsletter.py +++ b/app/services/newsletter.py @@ -746,17 +746,20 @@ def _outlook_highlights(items: list[dict[str, Any]]) -> str: for idx, item in enumerate(items[:3], start=1): url = _article_url(item.get("title", "")) rows += ( - f'' + f'' f'{_outlook_font(f"{idx}. ", color=OUTLOOK_ORANGE, bold=True)}' f'{_outlook_link(item.get("title", "Ohne Titel"), url, color=OUTLOOK_TEXT, bold=False)}' f'' ) return ( f'' - f'' - f'{rows}
' - f'{_outlook_font("Top Highlights", color=OUTLOOK_ORANGE, size="2", bold=True)}
' + f'bgcolor="{COLOR_TK_ORANGE_LIGHT}" style="background-color:{COLOR_TK_ORANGE_LIGHT} !important;' + f'border:1px solid {COLOR_TK_ORANGE_BORDER};margin:0 0 12px;" data-ogsb="{COLOR_TK_ORANGE_LIGHT}">' + f'' + f'{_outlook_font("TOP HIGHLIGHTS", color=COLOR_TK_ORANGE_DARK, size="1", bold=True)}' + f'' + f'{rows}
' + f'' ) @@ -809,7 +812,7 @@ def _outlook_section( def _outlook_article_card(idx: int, item: dict[str, Any], display: DisplayOptions, kind: str) -> str: accent = OUTLOOK_ORANGE if kind == "new" else OUTLOOK_GRAY_DARK - eyebrow = "Neuer Beitrag" if kind == "new" else "Aktualisierter Beitrag" + eyebrow = "NEUER BEITRAG" if kind == "new" else "AKTUALISIERTER BEITRAG" title = item.get("title", "Ohne Titel") url = _article_url(item.get("title", "")) meta = _outlook_meta_line(item, display) @@ -819,10 +822,10 @@ def _outlook_article_card(idx: int, item: dict[str, Any], display: DisplayOption -
  + {_outlook_font(f"{idx}. {eyebrow}", color=accent, size="1", bold=True)}
- {_outlook_link(title, url, size="3")}{meta_html}
- {_outlook_cta(url, "Zum Beitrag →")} + {_outlook_link(title, url, color=OUTLOOK_TEXT, size="4")}{meta_html}
+ {_outlook_cta(url, "Zum Beitrag →")}