Daniel Revere
8 years ago
4 changed files with 31 additions and 25 deletions
@ -1,22 +1,22 @@ |
|||||
(ns blog-clj.tags |
;; (ns blog-clj.tags |
||||
(:require [blog-clj.piece :as piece])) |
;; (:require [blog-clj.piece :as piece])) |
||||
|
|
||||
(defn has-tag [piece tag] |
;; (defn has-tag [piece tag] |
||||
(let [{:keys [tags]} piece] |
;; (let [{:keys [tags]} piece] |
||||
(some #(= tag %) tags))) |
;; (some #(= tag %) tags))) |
||||
|
|
||||
(defn page [tag] |
;; (defn page [tag] |
||||
[:body |
;; [:body |
||||
[:div.container |
;; [:div.container |
||||
[:div.jumbotron.text-center |
;; [:div.jumbotron.text-center |
||||
[:h1 "Nomad Expo"] |
;; [:h1 "Nomad Expo"] |
||||
[:h4 "tag: " tag]] |
;; [:h4 "tag: " tag]] |
||||
(let [pieces (filter #(has-tag % tag) piece/pieces)] |
;; (let [pieces (filter #(has-tag % tag) piece/pieces)] |
||||
(for [piece (sort-by :promoted? |
;; (for [piece (sort-by :promoted? |
||||
#(- (compare % %2)) |
;; #(- (compare % %2)) |
||||
pieces)] |
;; pieces)] |
||||
(let [{:keys [id name url logo desc creator promoted?]} piece] |
;; (let [{:keys [id name url logo desc creator promoted?]} piece] |
||||
[:div.panel.panel-default |
;; [:div.panel.panel-default |
||||
[:div.panel-body {:class (if promoted? "promoted")} |
;; [:div.panel-body {:class (if promoted? "promoted")} |
||||
[:a {:href (str "/piece/" id)} [:h2 name]] |
;; [:a {:href (str "/piece/" id)} [:h2 name]] |
||||
[:p {:align "right"} desc]]])))]]) |
;; [:p {:align "right"} desc]]])))]]) |
||||
|
Loading…
Reference in new issue