X-Git-Url: https://git.hcoop.net/clinton/lisp-on-lines.git/blobdiff_plain/19531fbd947da15a17f8e5557a1a1492eab2bca3..e0ae0cdefa99e9dc1b2e1938779558f1878c1864:/src/mewa/slot-presentations.lisp diff --git a/src/mewa/slot-presentations.lisp b/src/mewa/slot-presentations.lisp deleted file mode 100644 index 4d89895..0000000 --- a/src/mewa/slot-presentations.lisp +++ /dev/null @@ -1,153 +0,0 @@ -(in-package :it.bese.ucw) - - -(defslot-presentation clsql-wall-time-slot-presentation () - () - (:type-name clsql-sys:wall-time)) - -(defmethod presentation-slot-value ((slot clsql-wall-time-slot-presentation) instance) - (let ((date (call-next-method))) - (when date (multiple-value-bind (y m d) (clsql:time-ymd date) - (format nil "~a/~a/~a" m d y))))) - -(defmethod (setf presentation-slot-value) ((value string) (slot clsql-wall-time-slot-presentation) instance) - (setf (presentation-slot-value slot instance) (clsql:parse-date-time (remove #\Space value)))) - -(defmethod label :around ((slot clsql-wall-time-slot-presentation)) - (concatenate 'string (call-next-method) " (mm/dd/yyyy)")) - -(defmethod present-slot ((slot clsql-wall-time-slot-presentation) instance) - (let ((date (presentation-slot-value slot instance)) - (input-id (string (gensym)))) - (if (and date (not (editablep slot))) - (<:span (<:as-html date))) - (when (editablep slot) - ( " (foreign-instance slot) " from " instance ) - (let* ((i (foreign-instance slot)) - (pres (mewa::make-presentation - i - :type :one-line - :initargs (list - :global-properties - (list :editablep nil :linkedp nil))))) - (when (ucw::parent slot) (setf (component.place pres) (component.place (ucw::parent slot)))) - (flet ((render () (when i ( 0 (current slot)) - ;;what to do here is open to debate - (setf (current slot) (- (len slot)(number-to-display slot) )))) - - -(defmethod present-slot ((slot has-very-many-slot-presentation) instance) - ;;(<:as-html "isance: " instance) - (>")) - (call-next-method) - (<:as-html "total :" (len slot))) - -(defmethod get-foreign-instances :around ((slot has-very-many-slot-presentation) instance) - (let ((f (call-next-method))) - (setf (len slot) (length f)) - (setf (instances slot) f) - (loop for cons on (nthcdr (current slot) f) - for i from 0 upto (number-to-display slot) - collect (car cons)))) - -(defslot-presentation has-a-slot-presentation (one-of-presentation) - ((key :initarg :key :accessor key)) - (:type-name has-a)) - -(defmethod get-foreign-slot-value ((slot has-a-slot-presentation) (object t) (slot-name t)) - (slot-value object slot-name)) - -(defmethod present-slot ((slot has-a-slot-presentation) instance) - (<:as-html (presentation-slot-value slot instance)) - (if (editablep slot) - (