feat: Add display name to user profiles

Introduce `display_name` field to `User` struct for human-readable names
in the UI.
This falls back to the user's `slug` if not provided.

Update `AuthenticatedWebUser` and `MyCasesTemplate` to use this new
field for rendering.
Add tests for parsing `display_name` and ensure fallback logic works
correctly.
Update `users.toml.example` to document the new field.
This commit is contained in:
2026-05-04 11:46:19 +02:00
parent 03129ad592
commit 2fc7f8ddd2
6 changed files with 97 additions and 24 deletions
+2 -2
View File
@@ -4,7 +4,7 @@
<html lang="de" style="--preview-lines: {{ preview_lines }}">
<head>
<meta charset="utf-8">
<title>Doctate — Meine Fälle</title>
<title>Doctate — 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; }
@@ -85,7 +85,7 @@ try {
</head>
<body>
<header>
<h1>{{ slug }} — Meine Fälle</h1>
<h1>{{ display_name }}</h1>
<div class="header-right">
{% if is_admin %}<label class="admin-toggle"><input type="checkbox" id="admin-view-toggle"> Admin view</label>{% endif %}
<form method="post" action="/web/logout">{% call csrf::field(csrf_token) %}<button type="submit">Logout</button></form>