From a6fe5d1be483d0e7e74385f2d4a7afc545fd93ca Mon Sep 17 00:00:00 2001 From: Matthias Benkard Date: Wed, 10 Dec 2008 22:26:29 +0100 Subject: On the main page, omit body data of old entries. darcs-hash:02d7634f84bc05274aa8fcc27e8a062448cd14b8 --- journal.lisp | 69 +++++++++++++++++++++++++++++++++--------------------------- 1 file changed, 38 insertions(+), 31 deletions(-) (limited to 'journal.lisp') diff --git a/journal.lisp b/journal.lisp index adcb55b..bfd5f76 100755 --- a/journal.lisp +++ b/journal.lisp @@ -153,39 +153,41 @@ (<:span :class :journal-entry-category (<:as-html (format nil "Abgeheftet unter ..."))))) - (<:div :class :journal-entry-body - (<:as-is (journal-markup->html body))) + (when *full-entry-view* + (<:div :class :journal-entry-body + (<:as-is (journal-markup->html body)))) (<:div :class :journal-entry-footer - (<:form :class :journal-entry-delete-button-form - :style "display: inline;" - :method "post" - :action (link-to :index) - (<:div :style "display: inline;" - (<:input :type "hidden" - :name "action" - :value "delete") - (<:input :type "hidden" - :name "id" - :value (prin1-to-string id)) - (<:button :type "submit" - (<:as-is "Löschen")))) - " | " - (<:form :class :journal-entry-edit-button-form - :style "display: inline;" - :method "get" - :action (link-to :edit :post-id id) - (<:div :style "display: inline;" - (<:input :type "hidden" - :name "id" - :value (prin1-to-string id)) - (<:button :type "submit" - (<:as-is "Bearbeiten")))) - " | " + (when *full-entry-view* + (<:form :class :journal-entry-delete-button-form + :style "display: inline;" + :method "post" + :action (link-to :index) + (<:div :style "display: inline;" + (<:input :type "hidden" + :name "action" + :value "delete") + (<:input :type "hidden" + :name "id" + :value (prin1-to-string id)) + (<:button :type "submit" + (<:as-is "Löschen")))) + " | " + (<:form :class :journal-entry-edit-button-form + :style "display: inline;" + :method "get" + :action (link-to :edit :post-id id) + (<:div :style "display: inline;" + (<:input :type "hidden" + :name "id" + :value (prin1-to-string id)) + (<:button :type "submit" + (<:as-is "Bearbeiten")))) + " | ") (<:a :href (link-to :view :post-id id) (<:as-is (format nil "~D Kommentar~:*~[e~;~:;e~]" (length comments)))))) - (when (and comments-p (not (null comments))) + (when (and *full-entry-view* comments-p (not (null comments))) (<:div :class :journal-comments (<:h2 "Kommentare") (dolist (comment comments) @@ -201,7 +203,7 @@ (<:div :class :journal-comment-body (<:as-html (render-comment-body body)))))))) - (when comments-p + (when (and *full-entry-view* comments-p) (<:div :class :journal-new-comment (<:h2 "Neuen Kommentar schreiben") (<:p (<:as-is "Bitte beachten Sie, daß E-Mail-Adressen niemals @@ -328,8 +330,13 @@ nil)) (case *action* ((:index nil) - (mapc #'show-journal-entry - (select 'journal-entry :order-by '(([date] :desc)) :flatp t))) + (let ((number 0)) + (dolist (entry (select 'journal-entry + :order-by '(([date] :desc)) + :flatp t)) + (incf number) + (let ((*full-entry-view* (< number 5))) + (show-journal-entry entry))))) ((:view :post-comment :save-entry) (show-journal-entry (find-entry *post-number*) :comments-p t)))) #.(restore-sql-reader-syntax-state)) -- cgit v1.2.3