X-Git-Url: https://git.hcoop.net/clinton/lisp-on-lines.git/blobdiff_plain/8e6e6b5651e88009c62f5502b4fabdf2919e0b4f..38a016c7ea89d37ea32cfeb8d1e30033c9e3d614:/src/mewa/slot-presentations.lisp diff --git a/src/mewa/slot-presentations.lisp b/src/mewa/slot-presentations.lisp index db5de2e..bbbc1a9 100644 --- a/src/mewa/slot-presentations.lisp +++ b/src/mewa/slot-presentations.lisp @@ -1,4 +1,4 @@ -(in-package :it.bese.ucw) +(in-package :mewa) (defun multiple-value-funcall->list (function &rest args) "The function to be called by m-v-bf" @@ -10,6 +10,25 @@ (multiple-value-funcall->list #',(car form) ,@(cdr form)) ,@body)) + +;;;; ** Textarea Slot Presentation + +(defslot-presentation text-slot-presentation () + ((rows :initarg :rows :accessor rows :initform nil) + (columns :initarg :columns :accessor columns :initform nil) + (html-contentp :initarg :escape-html-p :accessor escape-html-p :initform nil)) + (:type-name text)) + +(defmethod present-slot ((slot text-slot-presentation) instance) + (if (editablep slot) + ( " (foreign-instance slot) " from " instance ) @@ -138,23 +181,21 @@ When T, only the default value for primary keys and the joins are updated.")) (:default-initargs)) (defaction view-instance ((self component) instance &rest initargs) - (call-component (parent self) (apply #'mewa:make-presentation instance initargs)) + (call-component (ucw::parent self) (apply #'mewa:make-presentation instance initargs)) ;; the viewed instance could have been changed/deleted, so we sync this instance - (meta-model:sync-instance (instance (parent self)))) + (meta-model:sync-instance (instance (ucw::parent self)))) -(defmethod present-slot :around ((slot foreign-key-slot-presentation) instance) +(defmethod present-slot :around ((slot foreign-key-slot-presentation) instance) (setf (foreign-instance slot) (when (presentation-slot-value slot instance) (meta-model:explode-foreign-key instance (slot-name slot)))) - (flet ((render () (when (foreign-instance slot)(call-next-method)))) - (if (slot-boundp slot 'place) + (if (slot-boundp slot 'ucw::place) (cond ((editablep slot) - (render) (>")) @@ -267,3 +310,10 @@ When T, only the default value for primary keys and the joins are updated.")) (setf (instance (presentation slot)) (presentation-slot-value slot instance)) (present (presentation slot))) (<:as-html "--")))) + + + + + + +