X-Git-Url: https://git.hcoop.net/clinton/lisp-on-lines.git/blobdiff_plain/4e2ecf695f074d4ed79c1099fa56b1d6fce08bfb..44108fd67c22992f320e2ea2424bab38a6547473:/src/mewa/slot-presentations.lisp diff --git a/src/mewa/slot-presentations.lisp b/src/mewa/slot-presentations.lisp index f501b71..2232ec1 100644 --- a/src/mewa/slot-presentations.lisp +++ b/src/mewa/slot-presentations.lisp @@ -10,6 +10,28 @@ (multiple-value-funcall->list #',(car form) ,@(cdr form)) ,@body)) + +;;;; ** Textarea Slot Presentation +;;;; This should really be in UCW. + +(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 ) @@ -143,18 +178,22 @@ When T, only the default value for primary keys and the joins are updated.")) (meta-model:sync-instance (instance (parent self)))) -(defmethod present-slot :around ((slot foreign-key-slot-presentation) instance) + +(defmethod present-slot :before ((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) (cond ((editablep slot) (render) (