X-Git-Url: https://git.hcoop.net/clinton/lisp-on-lines.git/blobdiff_plain/2548f0540da69973512f1827b2bfd2360470bb27..8032a7fe4b6d2470476115b307c105b93c4100e5:/src/ucw/html-description.lisp diff --git a/src/ucw/html-description.lisp b/src/ucw/html-description.lisp index 4ec32cc..94a8add 100644 --- a/src/ucw/html-description.lisp +++ b/src/ucw/html-description.lisp @@ -4,11 +4,10 @@ (defvar *escape-html* t) -(defmethod generic-format ((display lol-ucw:component) string &rest args) +(defmethod generic-format ((display ucw-core:component) string &rest args) (<:as-html (with-output-to-string (stream) (apply #'call-next-method stream string args)))) - (define-description html-description () ()) @@ -25,6 +24,7 @@ ((css-class :accessor attribute-css-class :initform "lol-attribute") (dom-id :accessor attribute-dom-id :initform nil) + (value-tag :accessor attribute-html-tag :initform nil :initarg :html-tag) (display-empty-label :accessor attribute-display-empty-label-p :initarg :display-empty-label-p :initform t))) (define-layered-class standard-attribute @@ -48,26 +48,26 @@ (object attribute) (let ((label (attribute-label attribute))) (when label - (<:as-html - (with-output-to-string (*display*) - (display-attribute-label attribute))))))) + (<:as-html (display-attribute-label attribute)))))) (define-layered-function display-html-attribute-value (object attribute) (:method (object attribute) + (<:td - :class "lol-attribute-value" - (<:as-html - (display-attribute-value attribute)))) + :class "lol-attribute-value" + (<:as-html + (display-attribute-value attribute)))) (:method :in-layer #.(defining-description 'inline) (object attribute) (display-attribute-value attribute))) + (define-layered-function display-html-attribute (object attribute) (:method (object attribute) (<:tr - :class (attribute-css-class attribute) + :class (format nil "~A lol-attribute" (attribute-css-class attribute)) (when (attribute-dom-id attribute) :id (attribute-dom-id attribute)) (display-html-attribute-label object attribute) @@ -80,8 +80,10 @@ :class (attribute-css-class attribute) (when (attribute-dom-id attribute) :id (attribute-dom-id attribute)) - (display-html-attribute-label object attribute) - (display-html-attribute-value object attribute)))) + (<:span :class "lol-attribute-label" + (display-html-attribute-label object attribute)) + (<:span :class "lol-attribute-value" + (display-html-attribute-value object attribute))))) (define-layered-method display-using-description :in-layer #.(defining-description 'html-description) @@ -115,7 +117,7 @@ val))) (defmethod display-html-attribute-editor (attribute editor) - (