d3ef78796d
Introduce an `oneliner` field to the `CaseView` struct and update the `scan_cases` function to read it from `oneliner.txt`. The `cases.html` template is updated to display the oneliner if present. A new integration test is added to verify the functionality.
56 lines
1.8 KiB
HTML
56 lines
1.8 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Doctate — Cases</title>
|
|
<style>
|
|
body { font-family: sans-serif; max-width: 900px; margin: 2em auto; padding: 0 1em; }
|
|
.case { border: 1px solid #ccc; margin: 1em 0; padding: 1em; border-radius: 4px; }
|
|
.case h2 { margin: 0 0 0.3em 0; font-size: 1.1em; }
|
|
.case small { color: #666; font-family: monospace; }
|
|
.status-open { border-left: 4px solid #4a90e2; }
|
|
.status-done { border-left: 4px solid #7ed321; }
|
|
.recording { margin: 0.5em 0; }
|
|
.recording-head { display: flex; align-items: center; gap: 1em; }
|
|
.recording-head span { font-family: monospace; font-size: 0.9em; min-width: 20em; }
|
|
.transcript { margin: 0.5em 0 0 1em; padding: 0.5em; background: #f6f6f6; border-radius: 4px; white-space: pre-wrap; font-family: serif; }
|
|
.pending { margin: 0.5em 0 0 1em; color: #888; font-style: italic; }
|
|
.oneliner { font-size: 1em; color: #333; margin: 0 0 0.3em 0; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<h1>Cases</h1>
|
|
{% if cases.is_empty() %}
|
|
<p>No cases found.</p>
|
|
{% else %}
|
|
{% for case in cases %}
|
|
<div class="case status-{{ case.status }}">
|
|
<h2>{{ case.user_slug }} — {{ case.case_id_short }} ({{ case.status }})</h2>
|
|
{% match case.oneliner %}
|
|
{% when Some with (t) %}
|
|
<div class="oneliner">{{ t }}</div>
|
|
{% when None %}
|
|
{% endmatch %}
|
|
<small>{{ case.case_id }}</small>
|
|
{% for rec in case.recordings %}
|
|
<div class="recording">
|
|
<div class="recording-head">
|
|
<span>{{ rec.filename }}</span>
|
|
<audio controls preload="none">
|
|
<source src="/web/audio/{{ case.user_slug }}/{{ case.case_id }}/{{ rec.filename }}" type="audio/mp4">
|
|
</audio>
|
|
</div>
|
|
{% match rec.transcript %}
|
|
{% when Some with (t) %}
|
|
<div class="transcript">{{ t }}</div>
|
|
{% when None %}
|
|
<div class="pending">Transcription pending…</div>
|
|
{% endmatch %}
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
{% endfor %}
|
|
{% endif %}
|
|
</body>
|
|
</html>
|