summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <code@mail.matthias.benkard.de>2011-03-10 21:04:05 +0100
committerMatthias Andreas Benkard <code@mail.matthias.benkard.de>2011-03-10 21:04:05 +0100
commit252095da751cc09dcbfeadbcfac15b148d279898 (patch)
tree52c2d41dfe28def323720646cb2de0a557cd325d
parent559777bb473f27fb0d6ec7e739856386e07fee62 (diff)
Add a table of all journal articles to the journal archive page.
-rw-r--r--mulkcms-hunchentoot.lisp4
-rw-r--r--mulkcms.lisp18
-rw-r--r--templates/journal_page.html26
3 files changed, 43 insertions, 5 deletions
diff --git a/mulkcms-hunchentoot.lisp b/mulkcms-hunchentoot.lisp
index 664658d..3200110 100644
--- a/mulkcms-hunchentoot.lisp
+++ b/mulkcms-hunchentoot.lisp
@@ -13,7 +13,9 @@
(defun dispatch-mulkcms-request (request)
(let* ((relative-path (subseq (script-name request) 1)))
- (or (mulkcms::find-journal-archive-request-handler relative-path)
+ (or (mulkcms::find-journal-archive-request-handler
+ relative-path
+ (assoc "full" (get-parameters*) :test #'equal))
(mulkcms::find-article-request-handler relative-path))))
(defun setup-handlers ()
diff --git a/mulkcms.lisp b/mulkcms.lisp
index 638026e..f15b6cb 100644
--- a/mulkcms.lisp
+++ b/mulkcms.lisp
@@ -7,6 +7,7 @@
(unless (member "html-human-date" *template-formatters* :key #'car :test #'equal)
(setq *template-formatters*
(list* (cons "html-human-date" 'format-human-date)
+ (cons "html-short-human-date" 'format-short-human-date)
(cons "html-iso-date" 'format-iso-date)
(cons "article-html" 'format-article)
*template-formatters*)))
@@ -23,6 +24,10 @@
:type :wild
:directory *templates*))))
+(defun format-short-human-date (date)
+ ;; FIXME
+ "(some date)")
+
(defun format-human-date (date)
;; FIXME
"(some date)")
@@ -128,9 +133,10 @@
ORDER BY min(date) DESC"
:column)
-(defun find-journal-archive-request-handler (path &optional action characteristics)
+(defun find-journal-archive-request-handler (path full-p &optional action characteristics)
(declare (ignore action))
- (when (string= path "journal")
+ (when (or (string= path "journal")
+ (string= path "journal/"))
(lambda ()
(with-db
(let* ((articles (find-journal-articles))
@@ -141,19 +147,23 @@
(mapcar (lambda (x)
(find-article-params x characteristics))
articles)))
- (displayed-revisions (subseq revisions 0 10))
+ (displayed-revisions (if full-p revisions (subseq revisions 0 10)))
(page-skeleton (template "page_skeleton"))
(page-template (template "journal_page"))
(template-params (list :title *site-name*
:root *base-uri*
:site-name *site-name*
:site-subtitle ""
- :link ""))
+ :link ""
+ :full-archive-link ""
+ :full-archive-label "Full archive (slow!)"))
(head (expand-template page-template (list* :head t
:articles displayed-revisions
+ :minor-articles revisions
template-params)))
(body (expand-template page-template (list* :body t
:articles displayed-revisions
+ :minor-articles revisions
template-params))))
(expand-template page-skeleton (list :title *site-name*
:head head
diff --git a/templates/journal_page.html b/templates/journal_page.html
index 037146d..d567d2f 100644
--- a/templates/journal_page.html
+++ b/templates/journal_page.html
@@ -12,4 +12,30 @@
{@|article-html}
{.end}
</div>
+
+ {.section minor-articles}
+ <div class="old-entries">
+ <h2>&#196;ltere Eintr&#228;ge</h2>
+ <p><a href="{full-archive-link|html-attr-value}" rel="archives">{full-archive-label|html}</a></p>
+ <table class="old-entry-table">
+ <caption>Eintr&#228;ge nach Datum</caption>
+ <thead>
+ <tr>
+ <th scope="col">Titel</th>
+ <th scope="col">Datum</th>
+ <th scope="col">Kommentare</th>
+ </tr>
+ </thead>
+ <tbody>
+ {.repeated section @}
+ <tr>
+ <td><a href="{link|html-attr-value}">{title|html}</a></td>
+ <td style="text-align: right">{publishing-date|html-short-human-date}</td>
+ <td><a href="{comments-link|html-attr-value}">{comments-label|html}</a></td>
+ </tr>
+ {.end}
+ </tbody>
+ </table>
+ </div>
+ {.end}
{.end}