X-Git-Url: https://git.hcoop.net/clinton/lisp-on-lines.git/blobdiff_plain/d25124264c5fc11612eee640a7ef568ed08d7db6..d5e996b3f1e6f25053a3b13f661ab34697085c5c:/src/mewa/slot-presentations.lisp diff --git a/src/mewa/slot-presentations.lisp b/src/mewa/slot-presentations.lisp index 1454c53..82893a5 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" @@ -12,12 +12,11 @@ ;;;; ** 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)) + ((rows :initarg :rows :accessor rows :initform 25) + (columns :initarg :columns :accessor columns :initform 40) + (escape-html-p :initarg :escape-html-p :accessor escape-html-p :initform nil)) (:type-name text)) (defmethod present-slot ((slot text-slot-presentation) instance) @@ -26,8 +25,9 @@ :rows (rows slot) :cols (columns slot)) (if (escape-html-p slot) + (<:as-html (presentation-slot-value slot instance)) (<:as-is (presentation-slot-value slot instance)) - (<:as-html (presentation-slot-value slot instance))))) + ))) (defcomponent mewa-slot-presentation () @@ -68,7 +68,8 @@ When T, only the default value for primary keys and the joins are updated.") currency) (defslot-presentation clsql-wall-time-slot-presentation (mewa-relation-slot-presentation) - () + ((input-id :accessor input-id :initform (arnesi:random-string 10 arnesi:+ascii-alphabet+)) + (trigger-id :accessor trigger-id :initform (arnesi:random-string 10 arnesi:+ascii-alphabet+))) (:type-name clsql-sys:wall-time)) (defmethod presentation-slot-value ((slot clsql-wall-time-slot-presentation) instance) @@ -86,51 +87,62 @@ When T, only the default value for primary keys and the joins are updated.") (setf (presentation-slot-value slot instance) new-time )))) (defmethod label :around ((slot clsql-wall-time-slot-presentation)) - (concatenate 'string (call-next-method) " (mm/dd/yyyy)")) + (concatenate 'string (call-next-method) " (m/d/y)")) (defmethod present-slot ((slot clsql-wall-time-slot-presentation) instance) - (let ((date (presentation-slot-value slot instance)) - (input-id (string (gensym)))) + (let ((date (presentation-slot-value slot instance))) (if (and date (not (editablep slot))) - (<:span (<:as-html date))) + (<:as-html date)) (when (editablep slot) - ( (length (last-name x)) 0) - (strcat (last-name x) ", ") - " ") - (first-name x)" " (company-name x))) - :as-value (lambda (x) x) - :submit-on-click-p nil))) - (:type-name ajax-foreign-key)) - - -(defmethod shared-initialize :after ((slot ajax-foreign-key-slot-presentation) slots &rest args) - ;; If no search-slots than use the any slots of type string - (unless (search-slots slot) - (setf (search-slots slot) t) - (let ((l (live-search slot))) - (setf (lisp-on-lines::values-generator l) t)))) - - -(defmethod present-slot :around ((slot ajax-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) - - (>"))