beginnings of a test component.
[clinton/lisp-on-lines.git] / src / standard-attributes.lisp
CommitLineData
7733a777
DC
1(in-package :lisp-on-lines)
2
9af22ce3
DC
3;;;; Strings
4
5(defattribute string-attribute ()
6 ()
7 (:type-name string)
8 (:default-properties
9 :escape-html-p t))
10
11(defdisplay object (:description (string string-attribute))
12 (<:as-html "ASD")
13 (if (getp :escape-html-p)
14 (<:as-html (attribute-value object string))
15 (<:as-is (attribute-value object string))))
16
17
7733a777
DC
18(defattribute image ()
19 ())
20
87e47dd6 21(defdisplay object (:description (buttons (eql 'image-editor-buttons)))
60a24293
DC
22 (<ucw:a :action (ok component object)
23 (<:as-html "select this image")))
24
87e47dd6 25(defdisplay object (:description (image image))
7733a777 26 (<:img
60a24293 27 :class (or (getp :css-class) "lol-image")
7733a777
DC
28 :src (arnesi:strcat
29 (or (getp :prefix) "images/")
30 (escape-as-uri
31 (attribute-value object image)))))
32
87e47dd6 33(defdisplay object (:description (image image)
60a24293
DC
34 :in-layer editor)
35 (<:div
36 :class "lol-image-thumbnails"
37
38 (dolist* (i (or (getp :directory)
39 (cl-fad:list-directory (strcat *default-pathname-defaults* "wwwroot/images/"))))
40 (<:div
41 :style "border: 1px solid black;width:100px;"
42 (<:img
43 :width "90px"
44 :src (strcat (or (getp :prefix) "images/")
45 (file-namestring i)))
46 (display-using-description 'image-editor-buttons component (file-namestring i) properties))
47 (<:p :style "clear:both;"))))
48
7733a777
DC
49
50
51
52
53