Refactor case detail and document view
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.
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Doctate — Dokument v{{ version }}</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; }
|
||||
.back { color: #4a90e2; text-decoration: none; }
|
||||
pre { white-space: pre-wrap; font-family: serif; font-size: 1.05em; line-height: 1.5; background: #f6f6f6; padding: 1em; border-radius: 4px; }
|
||||
.meta { color: #666; font-family: monospace; font-size: 0.9em; margin-bottom: 1em; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<div><a class="back" href="/web/cases/{{ case_id }}">← Zurück zum Fall</a></div>
|
||||
<form method="post" action="/web/logout"><button type="submit">Logout</button></form>
|
||||
</header>
|
||||
<h1>Dokument v{{ version }}</h1>
|
||||
<div class="meta">{{ case_id }}</div>
|
||||
<pre>{{ content }}</pre>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user