From 995492e70d3bea9d260caf518a89ad53841115fd Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Thu, 23 Feb 2012 18:10:33 +0100 Subject: Wiki: Revision list: Display author of each revision. --- src/mulk/benki/wiki.clj | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/mulk/benki/wiki.clj b/src/mulk/benki/wiki.clj index b93467a..66874be 100644 --- a/src/mulk/benki/wiki.clj +++ b/src/mulk/benki/wiki.clj @@ -85,13 +85,15 @@ (defpage "/wiki/:title/revisions" {title :title} (with-auth (let [revisions (with-dbt - (query "SELECT r.* + (query "SELECT r.*, u.first_name FROM wiki_page_revisions r JOIN (SELECT * FROM wiki_page_revisions WHERE title = ? ORDER BY date DESC LIMIT 1) pr ON (pr.page = r.page) + JOIN users u + ON u.id = r.author ORDER BY date DESC" "Home"))] (with-dbt @@ -100,7 +102,8 @@ [:table {:style ""} [:thead [:th "Date"] - [:th "Title"]] + [:th "Title"] + [:th "Author"]] [:tbody (for [rev revisions] [:tr @@ -108,7 +111,8 @@ (:title rev) (fmt nil "?revision=~a" (:id rev)))} (:date rev)]] - [:td (:title rev)]])]]))))) + [:td (:title rev)] + [:td (:first_name rev)]])]]))))) (defn insert-empty-page [] (sql/with-query-results results ["INSERT INTO wiki_pages DEFAULT VALUES RETURNING *"] -- cgit v1.2.3