4b554f04ff
Introduce a `DocumentTemplate` struct for rendering the document view, replacing inline HTML. Introduce a `CaseFlags` struct to encapsulate the logic for determining various UI states of a case (e.g., `has_document`, `analyzing`, `can_close`, `llm_missing`). Update `handle_case_detail` to use `compute_flags` for populating the `CaseDetailTemplate`. Update `scan_user_cases` to compute `analyzing` and `has_document` flags for the `UserCaseView`. Add new template logic in `case_detail.html` to display actions based on `CaseFlags`. Add new template logic in `my_cases.html` to display `analyzing` and `done-doc` labels for cases. Create a new `document.html` template. Add a helper function `any_document_exists` to check for the presence of a document file.
70 lines
2.6 KiB
HTML
70 lines
2.6 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="de">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Doctate — Meine Fälle</title>
|
|
<style>
|
|
body { font-family: sans-serif; max-width: 900px; margin: 2em auto; padding: 0 1em; }
|
|
header { display: flex; justify-content: space-between; align-items: center; }
|
|
header form { margin: 0; }
|
|
.case { border: 1px solid #ccc; margin: 0.8em 0; padding: 0.8em 1em; border-radius: 4px; display: block; text-decoration: none; color: inherit; }
|
|
.case:hover { background: #f6f6f6; }
|
|
.case h2 { margin: 0 0 0.3em 0; font-size: 1em; }
|
|
.case small { color: #666; font-family: monospace; }
|
|
.status-open { border-left: 4px solid #4a90e2; }
|
|
.status-done { border-left: 4px solid #7ed321; }
|
|
.oneliner { font-size: 1em; color: #333; margin: 0.2em 0; }
|
|
section { margin: 1.5em 0; }
|
|
section h2 { font-size: 1.1em; color: #555; border-bottom: 1px solid #ddd; padding-bottom: 0.2em; }
|
|
.empty { color: #888; font-style: italic; }
|
|
.label { display: inline-block; margin-left: 0.6em; padding: 0.05em 0.5em; border-radius: 999px; font-size: 0.75em; font-weight: bold; }
|
|
.label.analyzing { background: #eee; color: #555; }
|
|
.label.done-doc { background: #7ed321; color: white; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<header>
|
|
<h1>{{ slug }} — Meine Fälle</h1>
|
|
<form method="post" action="/web/logout"><button type="submit">Logout</button></form>
|
|
</header>
|
|
|
|
<section>
|
|
<h2>Offen ({{ open.len() }})</h2>
|
|
{% if open.is_empty() %}
|
|
<p class="empty">Keine offenen Fälle.</p>
|
|
{% else %}
|
|
{% for case in open %}
|
|
<a class="case status-{{ case.status }}" href="/web/cases/{{ case.case_id }}">
|
|
<h2>{{ case.case_id_short }} — {{ case.recordings.len() }} Aufnahme(n){% if case.has_document %}<span class="label done-doc">ausgewertet</span>{% else if case.analyzing %}<span class="label analyzing">wird analysiert</span>{% endif %}</h2>
|
|
{% match case.oneliner %}
|
|
{% when Some with (t) %}
|
|
<div class="oneliner">{{ t }}</div>
|
|
{% when None %}
|
|
{% endmatch %}
|
|
<small>{{ case.most_recent }}</small>
|
|
</a>
|
|
{% endfor %}
|
|
{% endif %}
|
|
</section>
|
|
|
|
<section>
|
|
<h2>Abgeschlossen ({{ done.len() }})</h2>
|
|
{% if done.is_empty() %}
|
|
<p class="empty">Keine abgeschlossenen Fälle.</p>
|
|
{% else %}
|
|
{% for case in done %}
|
|
<a class="case status-{{ case.status }}" href="/web/cases/{{ case.case_id }}">
|
|
<h2>{{ case.case_id_short }} — {{ case.recordings.len() }} Aufnahme(n){% if case.has_document %}<span class="label done-doc">ausgewertet</span>{% else if case.analyzing %}<span class="label analyzing">wird analysiert</span>{% endif %}</h2>
|
|
{% match case.oneliner %}
|
|
{% when Some with (t) %}
|
|
<div class="oneliner">{{ t }}</div>
|
|
{% when None %}
|
|
{% endmatch %}
|
|
<small>{{ case.most_recent }}</small>
|
|
</a>
|
|
{% endfor %}
|
|
{% endif %}
|
|
</section>
|
|
</body>
|
|
</html>
|