diff options
author | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2012-02-23 18:10:33 +0100 |
---|---|---|
committer | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2012-02-23 18:10:33 +0100 |
commit | 995492e70d3bea9d260caf518a89ad53841115fd (patch) | |
tree | 945a591938ebe33f3b68171ec9fabf8355ff2853 /src | |
parent | d981836a0ac4daac51396ed96ee395231ca18a99 (diff) |
Wiki: Revision list: Display author of each revision.
Diffstat (limited to 'src')
-rw-r--r-- | src/mulk/benki/wiki.clj | 10 |
1 files changed, 7 insertions, 3 deletions
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 *"] |