Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ビュー用に新しいネームスペースを作って、文字列で書いていた HTML を
Hiccup を 使って書きなおした
- Loading branch information
Showing
4 changed files
with
23 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
(ns todo-clj.view.main | ||
(:require [hiccup.core :as hc])) | ||
|
||
(defn home-view [req] | ||
(-> (list | ||
[:h1 "ホーム画面"] | ||
[:a {:href "/todo"} "TODO 一覧"]) | ||
hc/html)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
(ns todo-clj.view.todo | ||
(:require [hiccup.core :as hc])) | ||
|
||
(defn todo-index-view [req todo-list] | ||
(-> `([:h1 "TODO 一覧"] | ||
[:ul | ||
~@(for [{:keys [title]} todo-list] | ||
[:li title])]) | ||
hc/html)) |