package views import ( "strings" "github.com/arnef/ebooks/internal/library" ) templ Layout(title string, backHref string) { { title }
if backHref != "" { }

eBook Library

{ children... }
} templ BookCover(book library.Book, detail bool) { if book.HasCover { { } else { } } templ IndexPage(books []library.Book) { @Layout("Bibliothek", "") {

Meine Bücher

Titel, Autor und Cover auf einen Blick.

if len(books) == 0 {

Keine eBooks gefunden. Lege EPUB- oder PDF-Dateien im Ordner books/ ab.

} else { } } } templ BookPage(book library.Book) { @Layout(book.Title, "/") {
@BookCover(book, true)

{ book.Title }

{ book.Author }

Datei
{ book.Filename }
Format
{ book.Format }

Auf Tolino herunterladen

} } func coverClass(detail bool) string { if detail { return "book-cover book-cover-detail" } return "book-cover" } func placeholderClass(detail bool) string { if detail { return "book-cover-placeholder book-cover-placeholder-detail" } return "book-cover-placeholder" }