publisher removed from the statistics node of the API response
This commit is contained in:
@@ -66,7 +66,8 @@
|
||||
(GET "/:year/:month/:day/:title/stats" [year month day title]
|
||||
(let [note-id (api/build-key year month day title)]
|
||||
(statistics-page (api/derive-title (storage/get-note note-id))
|
||||
(storage/get-note-statistics note-id))))
|
||||
(storage/get-note-statistics note-id)
|
||||
(storage/get-publisher note-id))))
|
||||
|
||||
(GET "/:year/:month/:day/:title/edit" [year month day title]
|
||||
(let [note-id (api/build-key year month day title)]
|
||||
|
||||
@@ -72,8 +72,7 @@
|
||||
(defn get-note-statistics [noteID]
|
||||
{:views (get-note-views noteID)
|
||||
:published (redis :hget :published noteID)
|
||||
:edited (redis :hget :edited noteID)
|
||||
:publisher (get-publisher noteID)})
|
||||
:edited (redis :hget :edited noteID)})
|
||||
|
||||
(defn note-exists? [noteID]
|
||||
(= 1 (redis :hexists :note noteID)))
|
||||
|
||||
@@ -73,14 +73,15 @@
|
||||
[:div#footer (md-to-html (get-message :footer))]))
|
||||
|
||||
|
||||
(defn statistics-page [note-title stats]
|
||||
(let [page-title (get-message :statistics)]
|
||||
(defn statistics-page [note-title stats publisher]
|
||||
(let [page-title (get-message :statistics)
|
||||
info (assoc stats :publisher publisher)]
|
||||
(layout :no-js page-title
|
||||
[:h2.central-element note-title]
|
||||
[:h3.central-element.helvetica page-title]
|
||||
[:table#stats.helvetica.central-element
|
||||
(map
|
||||
#(when-let [v (% stats)]
|
||||
#(when-let [v (% info)]
|
||||
[:tr
|
||||
[:td (str (get-message %) ":")]
|
||||
[:td (if (or (= % :published) (= % :edited))
|
||||
|
||||
Reference in New Issue
Block a user