statistics page made pretier
This commit is contained in:
+10
-7
@@ -122,13 +122,16 @@
|
|||||||
(return-content-type "text/plain; charset=utf-8" md-text)))
|
(return-content-type "text/plain; charset=utf-8" md-text)))
|
||||||
|
|
||||||
(GET "/:year/:month/:day/:title/stats" [year month day title]
|
(GET "/:year/:month/:day/:title/stats" [year month day title]
|
||||||
(when-let [stats (:statistics (api/get-note {:noteID (api/build-key year month day title)}))]
|
(when-let [resp (api/get-note {:noteID (api/build-key year month day title)})]
|
||||||
(layout (get-message :statistics)
|
(let [stats (:statistics resp)
|
||||||
[:table#stats.helvetica.central-element
|
statistics (get-message :statistics)]
|
||||||
(map
|
(layout statistics
|
||||||
#(when (% stats)
|
[:h2.central-element statistics ": " (api/derive-title (:note resp))]
|
||||||
[:tr [:td (str (get-message %) ":")] [:td (% stats)]])
|
[:table#stats.helvetica.central-element
|
||||||
[:published :edited :publisher :views])])))
|
(map
|
||||||
|
#(when (% stats)
|
||||||
|
[:tr [:td (str (get-message %) ":")] [:td (% stats)]])
|
||||||
|
[:published :edited :publisher :views])]))))
|
||||||
|
|
||||||
(GET "/:year/:month/:day/:title/edit" [year month day title]
|
(GET "/:year/:month/:day/:title/edit" [year month day title]
|
||||||
(let [noteID (api/build-key year month day title)]
|
(let [noteID (api/build-key year month day title)]
|
||||||
|
|||||||
Reference in New Issue
Block a user