From 6460c439effcc70efa79d74850500484b484a855 Mon Sep 17 00:00:00 2001 From: drewc Date: Mon, 13 Jun 2005 15:32:37 -0700 Subject: [PATCH] Added a two column presentation object. i suppose it could be extended to N colums without to much trouble. darcs-hash:20050613223237-39164-5aa13a3c6819f99846070eb6b5abf177e44d6769.gz --- src/mewa/presentations.lisp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/mewa/presentations.lisp b/src/mewa/presentations.lisp index 3763c27..62d70e8 100644 --- a/src/mewa/presentations.lisp +++ b/src/mewa/presentations.lisp @@ -11,6 +11,26 @@ ;;;objects (defcomponent mewa-object-presentation (mewa ucw:object-presentation) ()) +(defcomponent two-column-presentation (mewa-object-presentation) ()) + +(defmethod present ((pres two-column-presentation)) + + (<:table :class (css-class pres) + (loop for slot on (slots pres) by #'cddr + do + (<:tr :class "presentation-slot-row" + (<:td :class "presentation-slot-label" + (<:as-html (label (first slot)))) + (<:td :class "presentation-slot-value" + (present-slot (first slot) (instance pres))) + (when (second slot) + (<:td :class "presentation-slot-label" + (<:as-html (label (second slot)))) + (<:td :class "presentation-slot-value" + (present-slot (second slot) (instance pres)))))) + (render-options pres (instance pres)))) + + ;;;lists (defcomponent mewa-list-presentation (mewa ucw:list-presentation) ((instances :accessor instances :initarg :instances :initform nil) -- 2.20.1