From 5757e6bbea9bd18128f6c7d18ffa2adc3bf724e0 Mon Sep 17 00:00:00 2001 From: Arne <1169654+arnef@users.noreply.github.com> Date: Thu, 6 Aug 2026 21:05:30 +0200 Subject: [PATCH] Move detail back navigation into header --- views/pages.templ | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/views/pages.templ b/views/pages.templ index 20e9da7..6a41724 100644 --- a/views/pages.templ +++ b/views/pages.templ @@ -5,7 +5,7 @@ import ( "github.com/arnef/ebooks/internal/library" ) -templ Layout(title string) { +templ Layout(title string, backHref string) { @@ -16,7 +16,14 @@ templ Layout(title string) {
-

eBook Library

+
+ if backHref != "" { + ← Zurück + } else { + + } +

eBook Library

+
{ children... } @@ -36,7 +43,7 @@ templ BookCover(book library.Book, detail bool) { } templ IndexPage(books []library.Book) { - @Layout("Bibliothek") { + @Layout("Bibliothek", "") {

Meine Bücher

Titel, Autor und Cover auf einen Blick.

@@ -65,13 +72,12 @@ templ IndexPage(books []library.Book) { } templ BookPage(book library.Book) { - @Layout(book.Title) { + @Layout(book.Title, "/") {