diff options
Diffstat (limited to 'src/view/main.phel')
| -rw-r--r-- | src/view/main.phel | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/view/main.phel b/src/view/main.phel index a47f308..1be6226 100644 --- a/src/view/main.phel +++ b/src/view/main.phel @@ -1,5 +1,7 @@ (ns lezer.view.main - (:require phel.html :refer [html doctype])) + (:require phel.html :refer [html doctype]) + (:require phel.pdo) + (:require phel.string :as str)) (def- head [:head @@ -27,14 +29,19 @@ head [:body [:ul - (for [book :in books] - [:li (:title book)])] + (for [b :in books] + (let [authors (:authors b) + book (:book b)] + [:li (:title book) + (if (not (empty? authors)) + (str " by " + (str/join ", " (map :name authors))))]))] [:div {:class "flex-center position-ref full-height"} [:form {:action "/book" :method "POST"} [:label {:for "title"} "Title: "] [:input {:type "text" :name "title"}] [:br] - [:label {:for "authors"} "Author: "] + [:label {:for "author"} "Author: "] [:input {:type "text" :name "author"}] [:input {:type "submit"}]]]]])) |
