:documentation
"When nil, the instance is syncronised with the database.
When T, only the default value for primary keys and the joins are updated.")
- (show-label-p :accessor show-label-p :initarg :show-label-p :initform t))
+ (show-label-p :accessor show-label-p :initarg :show-label-p :initform t)
+ (creatablep :accessor creatablep :initarg :creatablep :initform t))
(:documentation "The superclass of all Mewa slot presentations"))
;;;; this has to be in the eval when i would think
:linkedp t
:editablep nil)))
(<:as-html string))))
- (<:table
+ (<:table :cellpadding 10
(<:tr
(<:th) ;empty col for (view) link
(dolist (s (slots presentation))
:initargs
`(:attributes ,(attributes slot)))
))))
- (<ucw:submit :action (create-record-on-foreign-key slot instance) :value "Add New" :style "display:inline"))
+ (when (creatablep slot)
+ (<ucw:submit :action (create-record-on-foreign-key slot instance) :value "Add New" :style "display:inline")))
(if (presentation-slot-value slot instance)
(progn
(lol:present
(let ((instances (slot-value instance (slot-name slot)))
new-instance)
(<:ul
- (<:li (<ucw:a :action (add-on-many-to-many slot instance)
- (<:as-html "Add New")))
+ (<:li (<ucw:button :action (add-to-many-to-many slot instance)
+ (<:as-html "Add New")))
(<:li (<ucw:button :action (add-to-many-to-many slot instance new-instance)
(<:as-html "Add:"))
(<ucw:select :accessor new-instance
(<:as-html "(remove) "))
(present-view ((car i) (list-view slot) (ucw::parent slot)))) ))))
+
(defaction add-to-many-to-many ((slot many-to-many-slot-presentation) instance &optional foreign-instance)
+ ;;;; First things first, we sync.
+ (sync-instance instance)
(let* (new
(imd (getf (meta-model::find-slot-metadata instance (slot-name slot))
:db-info))
(sync-instance instance)
c)))
-
-
-
-
-
-
-
-