From 775cda9a675ca501e0a9236003b66c7ecb0969b0 Mon Sep 17 00:00:00 2001 From: rene Date: Fri, 1 May 2026 19:19:03 +0200 Subject: [PATCH] =?UTF-8?q?Feature:=20Outreach-Log=20=E2=80=94=20Mail-Inha?= =?UTF-8?q?lt=20per=20Klick=20anzeigen,=20SW=20by-v585?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/routes/outreach.py | 4 ++-- backend/static/js/app.js | 2 +- backend/static/js/pages/admin.js | 28 ++++++++++++++++++++++++++-- backend/static/sw.js | 2 +- 4 files changed, 30 insertions(+), 6 deletions(-) diff --git a/backend/routes/outreach.py b/backend/routes/outreach.py index daeb907..4fbd03c 100644 --- a/backend/routes/outreach.py +++ b/backend/routes/outreach.py @@ -87,7 +87,7 @@ def _imap_save_sent(msg_bytes: bytes, account: str): def _build_message(to: str, subject: str, body: str, account: str, html: str = None) -> MIMEMultipart: acc = _ACCOUNTS.get(account) or _ACCOUNTS["partner"] msg = MIMEMultipart("alternative") - msg["Date"] = formatdate(localtime=True) + msg["Date"] = formatdate(localtime=False) # UTC explizit, Container hat keine lokale TZ msg["Subject"] = subject msg["From"] = formataddr((acc["name"], acc["from"])) msg["To"] = to @@ -267,7 +267,7 @@ def send_support_mail(to: str, subject: str, body: str): def outreach_log_endpoint(user=Depends(require_admin)): with db() as conn: rows = conn.execute( - """SELECT ol.id, ol.recipient, ol.subject, ol.sent_at, + """SELECT ol.id, ol.recipient, ol.subject, ol.body, ol.sent_at, ol.from_account, u.name AS sent_by_name FROM outreach_log ol JOIN users u ON u.id = ol.sent_by diff --git a/backend/static/js/app.js b/backend/static/js/app.js index 71ccb01..9a377ab 100644 --- a/backend/static/js/app.js +++ b/backend/static/js/app.js @@ -3,7 +3,7 @@ Router, State-Management, Navigation, Initialisierung. ============================================================ */ -const APP_VER = '584'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen +const APP_VER = '585'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen const APP_VERSION = '1.2.1'; // ← semantische Version, wird bei make release gesetzt const IS_STAGING = location.hostname === 'staging.banyaro.app'; diff --git a/backend/static/js/pages/admin.js b/backend/static/js/pages/admin.js index fafba5b..8c9bca4 100644 --- a/backend/static/js/pages/admin.js +++ b/backend/static/js/pages/admin.js @@ -2134,8 +2134,10 @@ window.Page_admin = (() => { - ${log.map(l => ` - + ${log.map((l, i) => ` + ${accountBadge(l.from_account)} ${_esc(l.recipient)} ${_esc(l.subject)} @@ -2149,6 +2151,28 @@ window.Page_admin = (() => { `; + // Log-Zeile: Mail-Inhalt anzeigen + el.querySelectorAll('tr[data-log-idx]').forEach(row => { + row.addEventListener('click', () => { + const l = log[Number(row.dataset.logIdx)]; + if (!l) return; + UI.modal({ + title: _esc(l.subject), + body: ` +
+ An: ${_esc(l.recipient)}  ·  + Von: ${_esc(l.from_account)}@banyaro.app  ·  + ${(l.sent_at||'').slice(0,16).replace('T',' ')} +
+
${_esc(l.body || '(kein Text gespeichert)')}
`, + footer: ``, + }); + }); + }); + // Vorlage in Compose laden function _loadTplIntoCompose(id) { const tpl = templates.find(t => t.id === id); diff --git a/backend/static/sw.js b/backend/static/sw.js index 9f9474e..5c7da57 100644 --- a/backend/static/sw.js +++ b/backend/static/sw.js @@ -3,7 +3,7 @@ Offline-Cache + Push Notifications + Tile-Cache ============================================================ */ -const CACHE_VERSION = 'by-v584'; +const CACHE_VERSION = 'by-v585'; const CACHE_STATIC = `${CACHE_VERSION}-static`; const CACHE_TILES = 'ban-yaro-tiles-v1'; // bleibt über SW-Updates erhalten const CACHE_API = 'ban-yaro-api-v1'; // API-Response-Cache