4 (defcomponent mewa-one-line-presentation
(mewa one-line-presentation
)
6 (:default-initargs
:attributes-getter
#'one-line-attributes-getter
))
8 (defmethod one-line-attributes-getter ((self mewa
))
9 (or (meta-model:list-keys
(instance self
))))
12 (defcomponent mewa-object-presentation
(mewa ucw
:object-presentation
) ())
14 (defcomponent two-column-presentation
(mewa-object-presentation) ())
16 (defmethod present ((pres two-column-presentation
))
18 (<:table
:class
(css-class pres
)
19 (loop for slot on
(slots pres
) by
#'cddr
21 (<:tr
:class
"presentation-slot-row"
22 (<:td
:class
"presentation-slot-label"
23 (<:as-html
(label (first slot
))))
24 (<:td
:class
"presentation-slot-value"
25 (present-slot (first slot
) (instance pres
)))
27 (<:td
:class
"presentation-slot-label"
28 (<:as-html
(label (second slot
))))
29 (<:td
:class
"presentation-slot-value"
30 (present-slot (second slot
) (instance pres
))))))
31 (render-options pres
(instance pres
))))
35 (defcomponent mewa-list-presentation
(mewa ucw
:list-presentation
)
36 ((ucw::instances
:accessor instances
:initarg
:instances
:initform nil
)
37 (instance :accessor instance
)
38 (select-label :accessor select-label
:initform
"select" :initarg
:select-label
)
39 (selectablep :accessor selectablep
:initform t
:initarg
:selectablep
)))
41 (defaction select-from-listing
((listing mewa-list-presentation
) object index
)
44 (defmethod render-list-row ((listing mewa-list-presentation
) object index
)
45 (<:tr
:class
"item-row"
46 (<:td
:align
"center" :valign
"top"
47 (when (ucw::editablep listing
)
48 (let ((object object
))
49 (<ucw
:input
:type
"submit"
50 :action
(edit-from-listing listing object index
)
51 :value
(ucw::edit-label listing
))))
53 (when (ucw::deleteablep listing
)
55 (<ucw
:input
:type
"submit"
56 :action
(delete-from-listing listing object index
)
57 :value
(ucw::delete-label listing
))))
58 (when (selectablep listing
)
60 (<ucw
:input
:type
"submit"
61 :action
(select-from-listing listing object index
)
62 :value
(select-label listing
)))))
63 (dolist (slot (slots listing
))
64 (<:td
:class
"data-cell" (present-slot slot object
)))
65 (<:td
:class
"index-number-cell")
68 (defmethod get-all-instances ((self mewa-list-presentation
))