diff options
author | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2011-11-20 16:30:45 +0100 |
---|---|---|
committer | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2011-11-20 16:30:45 +0100 |
commit | f09fb71faf1ea0b9e3868f2e90840a13d3e150dc (patch) | |
tree | 8418114ea393e04944fedae8bec95d6a778d91fc | |
parent | 9b1d5e260aab6f691fa3e2b39704334364a53fa3 (diff) |
Minor bug fixes.
-rw-r--r-- | src/mulk/benki/util.clj | 2 | ||||
-rw-r--r-- | 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) |