1 (in-package :lisp-on-lines
)
3 ;;;;; Wrap a display in "back buttons"
4 (deflayer wrap-back-buttons
)
6 (defvar *back-buttons-wrapped-p
* nil
)
9 :in-layer wrap-back-buttons
:around
11 (if *back-buttons-wrapped-p
*
13 (let ((*back-buttons-wrapped-p
* t
))
15 (<ucw
:a
:class
"wiz-button previous" :action
(ok self t
)
16 (<:as-html
"Go Back"))
17 (<:div
:style
"clear:both;"
19 (<ucw
:a
:class
"wiz-button previous" :action
(ok self t
)
20 (<:as-html
"Go Back")))))
22 ;;;; Wrap an object display in with a link to the object
26 (defvar *link-wrapped-p
* nil
)
28 (define-layered-class description
29 :in-layer wrap-link
()
30 ((link :initarg
:link
:initform nil
:special t
:accessor link
)))
33 :in-layer wrap-link
:around
(description object
)
34 (let ((link (link description
)))
36 (with-inactive-layers (wrap-link)
39 (let ((*link-wrapped-p
* t
))
40 (<ucw
:a
:action
(call-display self object link
)
41 (call-next-method)))))))
46 (define-layered-class description
47 :in-layer wrap-form
()
48 ((form-buttons :initarg
:form-buttons
:initform nil
:special t
:accessor form-buttons
)))
51 (defdisplay ((description (eql 'standard-form-buttons
)) description-object
)
52 (macrolet ((submit (&key action value
)
54 :action
(funcall ,action
)
57 (loop for button in
(form-buttons description-object
)
59 (let ((button button
))
60 (with-properties (button)
61 (let ((action (.get
:action
)))
62 (submit :value
(.get
:value
)
67 (defdisplay :in-layer wrap-form
:around
(description object
)
69 :action
(refresh-component self
)
70 (with-inactive-layers (wrap-form)
73 (display-attribute 'standard-form-buttons description
))))
80 (define-layered-class description
82 ((div-attributes :accessor div-attributes
:initarg
:div
:special t
:initform nil
)))
84 (defdisplay :in-layer wrap-div
:around
(description object
)
85 (let ((args (div-attributes description
)))
86 (with-inactive-layers (wrap-div)
87 (yaclml::funcall-with-tag
90 (call-next-method))))))