diff --git a/frontend/messages/de.json b/frontend/messages/de.json index 5f0ad724..3999cf27 100644 --- a/frontend/messages/de.json +++ b/frontend/messages/de.json @@ -141,6 +141,7 @@ "conv_no_results_heading": "Keine Dokumente gefunden.", "conv_no_results_text": "Versuchen Sie, den Zeitraum anzupassen.", "conv_swap_btn": "Personen tauschen", + "conv_summary": "{count} Dokumente · {yearFrom}–{yearTo}", "admin_heading": "Admin Dashboard", "admin_tab_users": "Benutzer", diff --git a/frontend/messages/en.json b/frontend/messages/en.json index 556543c2..2aa6bfb2 100644 --- a/frontend/messages/en.json +++ b/frontend/messages/en.json @@ -141,6 +141,7 @@ "conv_no_results_heading": "No documents found.", "conv_no_results_text": "Try adjusting the time period.", "conv_swap_btn": "Swap persons", + "conv_summary": "{count} documents · {yearFrom}–{yearTo}", "admin_heading": "Admin Dashboard", "admin_tab_users": "Users", diff --git a/frontend/messages/es.json b/frontend/messages/es.json index a0d36bfc..f60be0d2 100644 --- a/frontend/messages/es.json +++ b/frontend/messages/es.json @@ -141,6 +141,7 @@ "conv_no_results_heading": "No se encontraron documentos.", "conv_no_results_text": "Intente ajustar el período de tiempo.", "conv_swap_btn": "Intercambiar personas", + "conv_summary": "{count} documentos · {yearFrom}–{yearTo}", "admin_heading": "Panel de administración", "admin_tab_users": "Usuarios", diff --git a/frontend/src/routes/conversations/+page.svelte b/frontend/src/routes/conversations/+page.svelte index 9e15379c..64086b2e 100644 --- a/frontend/src/routes/conversations/+page.svelte +++ b/frontend/src/routes/conversations/+page.svelte @@ -14,6 +14,14 @@ let fromDate = $state(untrack(() => data.filters.from)); let toDate = $state(untrack(() => data.filters.to)); let sortDir = $state(untrack(() => data.filters.dir)); +const documentYears = $derived( + data.documents + .map((doc) => (doc.documentDate ? new Date(doc.documentDate).getFullYear() : null)) + .filter((y): y is number => y !== null) +); +const yearFrom = $derived(documentYears.length > 0 ? Math.min(...documentYears) : null); +const yearTo = $derived(documentYears.length > 0 ? Math.max(...documentYears) : null); + // Sync with server data after navigation $effect(() => { senderId = data.filters.senderId; @@ -191,6 +199,19 @@ function swapPersons() {

{m.conv_no_results_text()}

{:else} + +
+ {#if yearFrom !== null && yearTo !== null} +

+ {m.conv_summary({ count: data.documents.length, yearFrom, yearTo })} +

+ {:else} +

+ {data.documents.length} +

+ {/if} +
+