summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mulk/benki/util.clj2
-rw-r--r--src/mulk/benki/wiki.clj8
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)