From 3ee724eb0c4d681e81f6d915b88fa5985957b27a Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Wed, 9 Sep 2026 22:57:41 -0700 Subject: Add page for each book --- src/view/book.phel | 11 +++++++++++ src/view/main.phel | 4 +++- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 src/view/book.phel (limited to 'src/view') diff --git a/src/view/book.phel b/src/view/book.phel new file mode 100644 index 0000000..79341ad --- /dev/null +++ b/src/view/book.phel @@ -0,0 +1,11 @@ +(ns lezer.view.book + (:require phel.html :refer [html doctype])) + +(defn book-html [book] + (html + (doctype :html5) + [:html + [:head + [:title (str "Book: " (:title book) " - Lezer")]] + [:body + [:h1 (:title book)]]])) diff --git a/src/view/main.phel b/src/view/main.phel index e25a079..9301bbc 100644 --- a/src/view/main.phel +++ b/src/view/main.phel @@ -31,7 +31,9 @@ [:main [:ul (for [b :in books] - [:li (:title (:book b)) + [:li + [:a {:href (r/generate router :book {:id (:id (:book b))})} + (:title (:book b))] " by " (authors-list (:authors b) router) " " -- cgit v1.3-2-g0d8e