diff options
-rw-r--r-- | mulkcms-hunchentoot.lisp | 4 | ||||
-rw-r--r-- | mulkcms.lisp | 18 | ||||
-rw-r--r-- | 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} </div> + + {.section minor-articles} + <div class="old-entries"> + <h2>Ältere Einträ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ä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} |