From c4f6f2eed7a7c614472d09246c92042d7ec5e226 Mon Sep 17 00:00:00 2001 From: Davide Grilli Date: Wed, 22 Jul 2026 14:34:03 +0200 Subject: [PATCH] Add a help link and bug-report button to the user navbar Serves docs/guida-utente.md as plain text at GET /guida (no markdown rendering, kept simple) and links it from the navbar next to a "Segnala un bug" button. The bug-report link is a placeholder GitHub issues URL (REPLACE_ME) until a real repo exists. Co-Authored-By: Claude Sonnet 5 --- app/main.py | 8 ++++++++ app/static/index.html | 6 ++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/app/main.py b/app/main.py index c6e8bf6..6165355 100644 --- a/app/main.py +++ b/app/main.py @@ -95,4 +95,12 @@ async def admin_panel() -> FileResponse: return FileResponse("app/static/admin.html", headers=_NO_STORE_HEADERS) +@app.get("/guida", include_in_schema=False) +async def user_guide() -> FileResponse: + """Serves docs/guida-utente.md as plain text so it opens inline in the + browser (no markdown rendering — keeps this simple), linked from the + navbar's help button in app/static/index.html.""" + return FileResponse("docs/guida-utente.md", media_type="text/plain; charset=utf-8") + + app.mount("/", StaticFiles(directory="app/static", html=True), name="static") diff --git a/app/static/index.html b/app/static/index.html index a6cbe75..b572765 100644 --- a/app/static/index.html +++ b/app/static/index.html @@ -90,12 +90,12 @@ border: 1px solid var(--color-border); } - button.link { + button.link, a.link { width: auto; margin-top: 0; padding: 0; min-height: auto; background: none; color: var(--color-muted-foreground); font-weight: 500; font-size: 0.85rem; text-decoration: underline; } - button.link:hover { filter: none; color: var(--color-foreground); } + button.link:hover, a.link:hover { filter: none; color: var(--color-foreground); } .row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; } @@ -293,6 +293,8 @@ PLM Lottery