From f09fb71faf1ea0b9e3868f2e90840a13d3e150dc Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Sun, 20 Nov 2011 16:30:45 +0100 Subject: Minor bug fixes. --- src/mulk/benki/util.clj | 2 +- src/mulk/benki/wiki.clj | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/mulk/benki/util.clj b/src/mulk/benki/util.clj index c2729f9..d0bcc07 100644 --- a/src/mulk/benki/util.clj +++ b/src/mulk/benki/util.clj @@ -21,7 +21,7 @@ ;; defpartial is just defn + html. (defpartial layout [title & content] - (html5 + (html5 {:xml? true} [:head [:title title] ;; jQuery diff --git a/src/mulk/benki/wiki.clj b/src/mulk/benki/wiki.clj index 45b3270..572a30e 100644 --- a/src/mulk/benki/wiki.clj +++ b/src/mulk/benki/wiki.clj @@ -26,7 +26,8 @@ (select (where (=* :title title))) (select (where (if revision-id (=* :id revision-id) - (=* 0 0))))) + (=* 0 0)))) + (sort [:date#desc])) revision (with-dbt (first @revisions))] (layout (fmt nil "~A — Benki~@[/~A~] " title revision-id) (if revision @@ -34,7 +35,7 @@ [:div#wiki-page-content [:p "This page does not exist yet."]]) [:hr] [:div#wiki-page-footer {:style "text-align: right"} - [:a {:href (link :wiki title :edit)} "Edit" + [:a {:href (link :wiki title :revisions)} "Page revisions" ]]))) (defn insert-empty-page [] @@ -44,7 +45,8 @@ (defpage [:post "/wiki/:title"] {title :title, content :content} (with-dbt (let [revisions (-> page_revisions - (select (where (=* :title title)))) + (select (where (=* :title title))) + (sort [:date#desc])) revision (first @revisions) page (:page revision)] (println "For page: " title " (id " page "); got content: " content) -- cgit v1.2.3