X-Git-Url: https://git.hcoop.net/clinton/lisp-on-lines.git/blobdiff_plain/4e7631c95e2ad041f95c5c0377d9d5cf15df8658..5f0b37e7a9a8e95dd5a846bfa7896af5875b91f7:/src/mewa/presentations.lisp?ds=sidebyside diff --git a/src/mewa/presentations.lisp b/src/mewa/presentations.lisp index 230ead5..15f0e16 100644 --- a/src/mewa/presentations.lisp +++ b/src/mewa/presentations.lisp @@ -12,7 +12,20 @@ (or (meta-model:list-keys (instance self)))) ;;;objects -(defcomponent mewa-object-presentation (mewa ucw:object-presentation) ()) +(defcomponent mewa-object-presentation (mewa ucw:object-presentation) + ((ucw::instance :accessor instance :initarg :instance :initform nil))) + +(defmethod present ((pres mewa-object-presentation)) + (<:table :class (css-class pres) + (dolist (slot (slots pres)) + (<:tr :class "presentation-slot-row" + (present-slot-as-row pres slot)))) + (render-options pres (instance pres))) + +(defmethod present-slot-as-row ((pres mewa-object-presentation) (slot ucw::slot-presentation)) + (<:td :class "presentation-slot-label" (<:as-html (label slot))) + (<:td :class "presentation-slot-value" (present-slot slot (instance pres)))) + (defcomponent two-column-presentation (mewa-object-presentation) ()) @@ -39,7 +52,9 @@ ((ucw::instances :accessor instances :initarg :instances :initform nil) (instance :accessor instance) (select-label :accessor select-label :initform "select" :initarg :select-label) - (selectablep :accessor selectablep :initform t :initarg :selectablep))) + (selectablep :accessor selectablep :initform t :initarg :selectablep) + (ucw::deleteablep :accessor deletablep :initarg :deletablep :initform nil) + (viewablep :accessor viewablep :initarg :viewablep :initform nil))) (defaction select-from-listing ((listing mewa-list-presentation) object index) (answer object)) @@ -62,7 +77,12 @@ (let ((index index)) (