From 849cdf575666e0d526deb20143c155b6e6319bd2 Mon Sep 17 00:00:00 2001 From: lelo Date: Sun, 4 May 2025 11:52:57 +0000 Subject: [PATCH] display expired links --- templates/folder_secret_config_editor.html | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/templates/folder_secret_config_editor.html b/templates/folder_secret_config_editor.html index 26db61b..41f3e2d 100644 --- a/templates/folder_secret_config_editor.html +++ b/templates/folder_secret_config_editor.html @@ -55,10 +55,17 @@ const key = rec.secret; const isEdit = editing.has(key); const cls = isEdit ? 'unlocked' : 'locked'; + + // Determine if entry has expired + const validityISO = formatISO(rec.validity); + const expired = validityISO ? (new Date(validityISO) < new Date()) : false; + + // Build card HTML let html = `
`; - html += `
Link
`; + // Show exclamation if expired + html += `
Link${expired ? ' ! abgelaufen !' : ''}
`; html += `
Secret:
`; - html += `
Validity:
`; + html += `
Validity:
`; html += `
Ordner
`; rec.folders.forEach((f,i) => { html += `
`; @@ -71,7 +78,6 @@ }); if(isEdit) html += ``; html += `
`; - // Change Delete button to a class + data-secret if (!isEdit) html += `Link öffnen`; html += ``; html += ``; @@ -187,4 +193,4 @@ render(); }); - {% endblock %} +{% endblock %}