X-Git-Url: https://git.hcoop.net/clinton/lisp-on-lines.git/blobdiff_plain/e0ae0cdefa99e9dc1b2e1938779558f1878c1864..599c2ea6caf671406348215e3242dc7feef13a50:/src/presentations.lisp diff --git a/src/presentations.lisp b/src/presentations.lisp index 82f18e3..b463210 100644 --- a/src/presentations.lisp +++ b/src/presentations.lisp @@ -1,21 +1,15 @@ -(in-package :mewa) +(declaim (optimize (speed 0) (space 3) (safety 0))) +(in-package :lisp-on-lines) - - (defun split-list (n list) - (loop for cons on list - by #'(lambda (x) (nthcdr n x)) - if (< 0 n) - collect (loop for atom in cons - repeat n - collect atom) - else return nil)) +(defmethod render ((self mewa)) + (lol::present self)) (defaction edit-instance ((self mewa)) (call-presentation (instance self) :type :editor)) ;;;one-line objects -(defcomponent mewa-one-line-presentation (mewa one-line-presentation) +(defcomponent mewa-one-line-presentation (mewa lol::one-line-presentation) () (:default-initargs :attributes-getter #'one-line-attributes-getter @@ -26,7 +20,7 @@ (meta-model::list-keys (instance self)))) ;;;objects -(defcomponent mewa-object-presentation (mewa object-presentation) +(defcomponent mewa-object-presentation (mewa lol::object-presentation) ((instance :accessor instance :initarg :instance :initform nil))) (defcomponent mewa-viewer (mewa-object-presentation) @@ -47,7 +41,7 @@ (dolist (slot (slots pres)) (<:tr :class "presentation-slot-row" (present-slot-as-row pres slot)))) - (render-options pres (instance pres))) + (render-options pres (instance pres))) (defmethod present-slot-as-row ((pres mewa-object-presentation) (slot slot-presentation)) (<:td :class "presentation-slot-label" (<:as-html (label slot))) @@ -112,8 +106,7 @@ :value "view")))) (dolist (slot (slots listing)) (<:td :class "data-cell" (present-slot slot object))) - (<:td :class "index-number-cell") - )) + (<:td :class "index-number-cell"))) (defmethod get-all-instances ((self mewa-list-presentation)) (instances self)) @@ -126,7 +119,7 @@ (defgeneric search-expr (criteria instance) (:documentation "Return ready to apply criteria. - What to do with it is backend dependent.")) + to do with What it is backend dependent.")) (defmacro def-search-expr (((self criteria-type)) (model-expr &body body)) `(defmethod search-expr ((,self ,criteria-type) instance) @@ -207,8 +200,6 @@ (defmethod find-default-criteria (c mewa-string-slot-presentation) 'string-contains) - - (defmethod render-criteria ((res response) (s mewa-presentation-search)) (setf (criteria-input s) "") (<:ul