Aktivitäten-Feed: empfangene und gesendete E-Mails einbeziehen
Der Aktivitäten-Feed (Startseite, /aktivitaeten, /statistik) führt Status- änderungen und E-Mails per UNION zusammen, sortiert nach Erfassungszeit. E-Mail-Einträge bekommen einen eigenen Farbpunkt (blau = erhalten, sky = gesendet); ohne verknüpfte Bewerbung wird Absender bzw. Empfänger als Kopfzeile gezeigt. Das UNION steckt in einem Subselect, weil SQLite ORDER BY an einem Compound-SELECT keine Ergebnisspalten nach Namen aufloest. Die Paginierung von /aktivitaeten zaehlt jetzt Statusaenderungen + E-Mails. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
+16
-9
@@ -309,7 +309,7 @@
|
||||
<div class="stat-card">
|
||||
<h2 id="aktivitaet" class="text-gray-900 dark:text-white">Letzte Aktivität</h2>
|
||||
<p class="sub mb-5">
|
||||
Die jüngsten Statusänderungen deiner Bewerbungen.
|
||||
Die jüngsten Statusänderungen und E-Mails deiner Bewerbungen.
|
||||
<a href="/aktivitaeten" class="text-blue-600 dark:text-sky-400 hover:underline">Alle</a>
|
||||
</p>
|
||||
<% if (aktivitaet.length) {
|
||||
@@ -319,29 +319,36 @@
|
||||
'Vorstellungsgespräch':'#10b981','Vertragsverhandlung':'#84cc16','Absage':'#f43f5e','Absage von meiner Seite':'#f97316',
|
||||
'Einstellung':'#059669','Keine Rückmeldung':'#cbd5e1'
|
||||
}[s] || '#2563eb');
|
||||
const emailColor = (a) => a.direction === 'out' ? '#0ea5e9' : '#3b82f6';
|
||||
%>
|
||||
<div class="tl">
|
||||
<% aktivitaet.forEach(a => { %>
|
||||
<div class="tl-item" style="--stat-accent:<%= statusColor(a.status) %>">
|
||||
<% aktivitaet.forEach(a => {
|
||||
const accent = a.typ === 'email' ? emailColor(a) : statusColor(a.status);
|
||||
let titel = '', titelSub = '';
|
||||
if (a.bewerbung_id) { titel = a.firma || '(ohne Firma)'; titelSub = a.stelle || ''; }
|
||||
else if (a.typ === 'email') { titel = a.direction === 'out' ? ('An: ' + (a.to_addr || '?')) : (a.from_addr || a.subject || 'E-Mail'); }
|
||||
else { titel = 'Gelöschte Bewerbung'; }
|
||||
%>
|
||||
<div class="tl-item" style="--stat-accent:<%= accent %>">
|
||||
<div class="flex flex-wrap items-baseline gap-x-2 gap-y-0.5">
|
||||
<% if (a.bewerbung_id) { %>
|
||||
<a href="/bewerbung/<%= a.bewerbung_id %>" class="text-sm font-medium text-gray-900 dark:text-white hover:underline"><%= a.firma || '(ohne Firma)' %></a>
|
||||
<span class="text-sm text-gray-500 dark:text-slate-400">· <%= a.stelle || '' %></span>
|
||||
<a href="/bewerbung/<%= a.bewerbung_id %>" class="text-sm font-medium text-gray-900 dark:text-white hover:underline"><%= titel %></a>
|
||||
<% if (titelSub) { %><span class="text-sm text-gray-500 dark:text-slate-400">· <%= titelSub %></span><% } %>
|
||||
<% } else { %>
|
||||
<span class="text-sm font-medium text-gray-700 dark:text-gray-200">Gelöschte Bewerbung</span>
|
||||
<span class="text-sm font-medium text-gray-700 dark:text-gray-200"><%= titel %></span>
|
||||
<% } %>
|
||||
</div>
|
||||
<div class="mt-0.5 flex flex-wrap items-center gap-x-2 text-sm">
|
||||
<span class="inline-flex items-center gap-1.5 font-medium" style="color:<%= statusColor(a.status) %>">
|
||||
<span class="inline-flex items-center gap-1.5 font-medium" style="color:<%= accent %>">
|
||||
<span class="swatch" style="margin:0"></span><%= a.status %>
|
||||
</span>
|
||||
<span class="text-gray-400 dark:text-slate-500">· <%= a.datum %></span>
|
||||
<% if (a.datum) { %><span class="text-gray-400 dark:text-slate-500">· <%= a.datum %></span><% } %>
|
||||
<% if (a.kommentar) { %><span class="text-gray-500 dark:text-slate-400 truncate">· <%= a.kommentar %></span><% } %>
|
||||
</div>
|
||||
</div>
|
||||
<% }); %>
|
||||
</div>
|
||||
<% } else { %><div class="stat-empty">Noch keine Statusänderungen protokolliert.</div><% } %>
|
||||
<% } else { %><div class="stat-empty">Noch keine Aktivitäten — Statusänderungen und E-Mails erscheinen hier.</div><% } %>
|
||||
</div>
|
||||
|
||||
<% } %>
|
||||
|
||||
Reference in New Issue
Block a user