feat: Display most recent recording time
Add `recorded_at_iso` and `time_hms_utc` to `CasePageTemplate` to display the timestamp of the most recent recording. Introduce a new partial `partials/time_format.js` for consistent date and time formatting in the browser. Update templates to use the new partial for rendering timestamps and group headings.
This commit is contained in:
@@ -8,9 +8,10 @@ body { font-family: sans-serif; max-width: 900px; margin: 2em auto; padding: 0 1
|
||||
header { display: flex; justify-content: space-between; align-items: center; }
|
||||
header form { margin: 0; }
|
||||
.back { color: #4a90e2; text-decoration: none; }
|
||||
h1 { display: flex; align-items: center; gap: 0.6em; flex-wrap: wrap; }
|
||||
h1 { display: flex; align-items: center; gap: 0.6em; flex-wrap: wrap; margin-bottom: 0.2em; }
|
||||
h1 .title { display: flex; align-items: center; gap: 0.6em; flex-wrap: wrap; flex: 1; min-width: 0; }
|
||||
h1 .delete-form { margin: 0 0 0 auto; }
|
||||
.case-time { color: #666; font-size: 1.05em; margin: 0 0 1em; }
|
||||
.meta { color: #999; font-family: monospace; font-size: 0.8em; margin: 0 0 1em; }
|
||||
.status-badge { display: inline-block; padding: 0.1em 0.6em; border-radius: 999px; font-size: 0.6em; font-weight: bold; color: white; vertical-align: middle; }
|
||||
.status-badge.open { background: #4a90e2; }
|
||||
@@ -71,12 +72,14 @@ try {
|
||||
</span>
|
||||
<form class="delete-form" method="post" action="/web/cases/{{ case_id }}/delete"><button type="submit" class="delete-btn" title="Fall entfernen" aria-label="Fall entfernen"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="3 6 5 6 21 6"></polyline><path d="M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6"></path><path d="M10 11v6"></path><path d="M14 11v6"></path><path d="M9 6V4a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2"></path></svg></button></form>
|
||||
</h1>
|
||||
{% match recorded_at_iso %}
|
||||
{% when Some with (iso) %}<p class="case-time"><time datetime="{{ iso }}">{{ time_hms_utc }}</time></p>
|
||||
{% when None %}
|
||||
{% endmatch %}
|
||||
{% if is_admin %}<div class="meta admin-only">{{ case_id }}</div>{% endif %}
|
||||
|
||||
<div class="actions">
|
||||
{% if analyzing %}
|
||||
<span class="analyzing">wird analysiert …</span>
|
||||
{% else if can_analyze && !has_document %}
|
||||
{% if can_analyze && !has_document %}
|
||||
<form method="post" action="/web/cases/{{ case_id }}/analyze"><button type="submit">Analysieren</button></form>
|
||||
{% else if llm_missing && !has_document %}
|
||||
<span class="llm-missing">LLM-Analyse nicht konfiguriert</span>
|
||||
@@ -146,6 +149,20 @@ try {
|
||||
<a class="recordings-link" href="/web/cases/{{ case_id }}/recordings">→ Aufnahmen anzeigen ({{ recordings_count }})</a>
|
||||
</div>
|
||||
<script>
|
||||
{% include "partials/time_format.js" %}
|
||||
</script>
|
||||
<script>
|
||||
// Format the case timestamp as "Heute HH:MM" / "Gestern HH:MM" / "DD.MM.YYYY HH:MM"
|
||||
// in the browser's local timezone and locale. Server-rendered text is only a
|
||||
// no-JS fallback (UTC HH:MM).
|
||||
(() => {
|
||||
const el = document.querySelector('.case-time time[datetime]');
|
||||
if (!el) return;
|
||||
const d = new Date(el.dateTime);
|
||||
if (isNaN(d.getTime())) return;
|
||||
el.textContent = TimeFmt.dateLabel(d) + ' - ' + TimeFmt.timeLabel(d);
|
||||
})();
|
||||
|
||||
(() => {
|
||||
const cb = document.getElementById('admin-view-toggle');
|
||||
if (!cb) return;
|
||||
|
||||
Reference in New Issue
Block a user