bugfix: noir doesn't respect the routes order

This commit is contained in:
Christian Mueller
2012-06-24 08:35:50 +02:00
parent 8e6972c048
commit abc04e122f
2 changed files with 4 additions and 7 deletions
+2 -5
View File
@@ -13,7 +13,7 @@
[hiccup.core]
[hiccup.element]
[noir.response :only [redirect status content-type]]
[noir.core :only [defpage render]]
[noir.core :only [defpage pre-route]]
[cheshire.core]
[noir.statuses])
(:import
@@ -87,7 +87,7 @@
[:div.centered.helvetica-neue (md-to-html (get-message :created-by))]))
; New Note Page
(defpage "/new" {}
(pre-route "/new" {}
(layout {:js true} (get-message :new-note)
[:div.central-element
(form-to [:post "/post-note"]
@@ -115,9 +115,6 @@
(let [md-text (get-note [year month day] title)]
(if md-text (content-type "text/plain; charset=utf-8" md-text) (response 404))))
(defpage "/:year/:month/:day/:title/short-url" params
(layout (get-message :short-url) (url (create-short-url params))))
; Provides the number of views of the specified note
(defpage "/:year/:month/:day/:title/stats" {:keys [year month day title]}
(let [views (get-note-views [year month day] title)]