diff --git a/views/postfach.ejs b/views/postfach.ejs index b622df2..4117e11 100644 --- a/views/postfach.ejs +++ b/views/postfach.ejs @@ -60,7 +60,11 @@ <%= e.email_date ? new Date(e.email_date).toLocaleString('de-DE') : '' %>

<%= e.subject || '(kein Betreff)' %>

-

<%= e.body_text || '' %>

+

<%= e.body_text || '' %>

+ <% if (e.body_text && e.body_text.length > 600) { %> + + <% } %> <% if (e.anhaenge && e.anhaenge.length) { %>
@@ -130,6 +134,19 @@ }); const cy = document.getElementById('currentYear'); if (cy) cy.textContent = new Date().getFullYear(); + + // Expand/collapse the full e-mail body for each card. + document.querySelectorAll('.email-toggle').forEach(function (btn) { + btn.addEventListener('click', function () { + var body = btn.previousElementSibling; + if (!body || !body.classList.contains('email-body')) return; + var expanded = btn.dataset.expanded === 'true'; + body.classList.toggle('max-h-40', expanded); + body.classList.toggle('overflow-hidden', expanded); + btn.dataset.expanded = expanded ? 'false' : 'true'; + btn.textContent = expanded ? 'Vollständig anzeigen' : 'Weniger anzeigen'; + }); + }); })();