+ (<: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)
+ :around ((attribute standard-attribute) display object &rest args)
+ (declare (ignore args))
+ (display-html-attribute object attribute))
+
+
+(defun capture-description (attribute function)
+ (let ((obj (described-object (attribute-description attribute))))
+ (lambda (&rest args)
+ (dletf (((described-object attribute) obj))
+ (apply function args)))))
+
+(defun make-attribute-value-writer (attribute)
+ (let ((obj (described-object (attribute-description attribute)))
+ (value (attribute-value attribute)))
+ (lambda (val)
+ (dletf (((described-object attribute) obj))
+ (with-active-descriptions (editable)
+ (unless (and (unbound-slot-value-p value)
+ (equal "" val))
+ (setf (attribute-value attribute)
+ (parse-attribute-value attribute val))))))))
+
+
+(defmethod html-attribute-value (attribute)
+ (let ((val (attribute-value attribute)))
+ (if (unbound-slot-value-p val)
+ ""
+ val)))
+
+(defmethod display-html-attribute-editor (attribute editor)
+ (<ucw:input :type "text"
+ :reader (html-attribute-value attribute)
+ :writer (make-attribute-value-writer attribute)))
+
+(defmethod display-html-attribute-editor ((attribute slot-definition-attribute) editor)
+ (call-next-method))
+
+(defmethod display-html-attribute-editor (attribute (editor password-attribute-editor))
+ (<ucw:input :type "password"
+ :reader (html-attribute-value attribute)
+ :writer (make-attribute-value-writer attribute)))
+
+
+
+
+(define-layered-method display-attribute-editor
+ :in-layer #.(defining-description 'html-description) (attribute)
+ (display-html-attribute-editor attribute (attribute-editor attribute)))
+
+
+(define-layered-method display-html-attribute-value
+ :in-layer #.(defining-description 'editable) (object attribute)
+
+
+ (if (attribute-editp attribute)
+ (<:td
+ :class "lol-attribute-value"(display-attribute-editor attribute))
+ (call-next-method)))
+
+(define-layered-function display-html-description (description display object &optional next-method)
+ (:method (description display object &optional (next-method #'display-using-description))
+
+
+ (with-attributes (css-class dom-id) description
+
+
+ (<:table
+ :class (list (attribute-value css-class) "lol-description" "t")
+ :id (attribute-value dom-id)
+ (funcall next-method)
+ (<:br :class "clear")))))
+
+
+(define-layered-method display-html-description
+ :in-layer #.(defining-description 'inline) (description display object &optional next-method)
+ (with-attributes (css-class dom-id) description
+ (<:span
+ :class (list (attribute-value css-class) "lol-description")
+ :id (attribute-value dom-id)
+ (funcall next-method))))
+
+
+(define-display
+ :in-description html-description ((description t)
+ (display ucw-core:component)
+ object)
+ (display-html-description description display object (lambda ()
+ (call-next-method))))
+
+(define-layered-method display-html-attribute-value
+ (object (attribute list-attribute))
+ (let ((val (attribute-value attribute)))
+ (when (listp val)
+ (<:ul
+ (arnesi:dolist* (item (attribute-value attribute))
+
+ (dletf (((attribute-object attribute) item))
+ (<:li (apply #'display *display* item (slot-value attribute 'item-args)))))))))
\ No newline at end of file