Export LoL 3 symbols
[clinton/lisp-on-lines.git] / src / slot-presentations.lisp
index 89492aa..667e987 100644 (file)
@@ -239,7 +239,8 @@ Calendar.setup({
 
 
 (defmethod find-foreign-instances ((slot foreign-key-slot-presentation))
-  (clsql:select (class-name (class-of (meta-model:explode-foreign-key (instance slot) (slot-name slot))))))
+  (clsql:select (class-name (class-of (meta-model:explode-foreign-key (instance slot) (slot-name slot))))
+               :order-by (car (list-keys (instance slot)))))
 
 
 
@@ -301,7 +302,7 @@ Calendar.setup({
 
 (defmethod get-foreign-instances ((slot has-many-slot-presentation) instance)
   (sort (slot-value instance (slot-name slot)) #'<  
-       :key #'(lambda (x) (funcall (car (list-keys instance)) x))))
+       :key #'(lambda (x) (funcall (car (list-keys x)) x))))
 
 (defmethod lol::presentation-slot-value ((slot has-many-slot-presentation) instance)
   (get-foreign-instances slot instance))
@@ -429,10 +430,11 @@ Calendar.setup({
   (let ((instances (slot-value instance (slot-name slot)))
        new-instance)
     (<:ul
-     (<: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:"))
+     (<:li (<ucw:submit :action (add-to-many-to-many slot instance)
+                       
+                        :value "Add New"))
+     (<:li  (<ucw:submit :action (add-to-many-to-many slot instance new-instance)
+                        :value "Add:")
            (<ucw:select :accessor new-instance
                         (arnesi:dolist* (i (find-all-instances slot instance))
                           (<ucw:option
@@ -444,7 +446,7 @@ Calendar.setup({
                (<:as-html "(view) "))
        (<ucw:a :action (delete-relationship slot (second i) instance)
                (<:as-html "(remove) "))
-       (present-view ((car i) (list-view slot) (ucw::parent slot)))) ))))
+       (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)