(in-package :lisp-on-lines) ;TODO: get rid of this. (defun attribute.name (attribute) (attribute-name attribute)) ;;;; A few layers related to attributes (deflayer omit-nil-attributes) (defdisplay :in-layer omit-nil-attributes :around ((attribute standard-attribute) object) (when (attribute-value object attribute) (call-next-method))) ;;;; Labels (deflayer show-attribute-labels) (defattribute attribute-label (attribute) () (:default-properties :attribute nil)) (defdisplay ((label attribute-label) object) (<:label :class "lol-label" (<:as-html (or (label (attribute label)) (attribute-name (attribute label)) " ") " "))) (defvar *attribute-label-attribute* (make-instance 'attribute-label)) (defdisplay :in-layer show-attribute-labels :around ((attribute standard-attribute) object) (display-attribute *attribute-label-attribute* object :attribute attribute) (call-next-method)) (deflayer use-pretty-labels) (define-layered-method label :in-layer use-pretty-labels :around (standard-attribute) (let ((label (call-next-method))) (when label (string-capitalize (substitute #\Space #\- label))))) (deflayer inspect-attributes) (defdisplay :in-layer inspect-attributes :around ((attribute standard-attribute) object) (call-next-method) (