From 252095da751cc09dcbfeadbcfac15b148d279898 Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Thu, 10 Mar 2011 21:04:05 +0100 Subject: Add a table of all journal articles to the journal archive page. --- mulkcms-hunchentoot.lisp | 4 +++- mulkcms.lisp | 18 ++++++++++++++---- templates/journal_page.html | 26 ++++++++++++++++++++++++++ 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} + + {.section minor-articles} +
+

Ältere Einträge

+

{full-archive-label|html}

+ + + + + + + + + + + {.repeated section @} + + + + + + {.end} + +
Einträge nach Datum
TitelDatumKommentare
{title|html}{publishing-date|html-short-human-date}{comments-label|html}
+
+ {.end} {.end} -- cgit v1.2.3