beginnings of a test component.
[clinton/lisp-on-lines.git] / src / standard-attributes.lisp
index 10e3145..492a06b 100644 (file)
@@ -1,16 +1,51 @@
 (in-package :lisp-on-lines)
 
 (in-package :lisp-on-lines)
 
+;;;; Strings
+
+(defattribute string-attribute ()
+  ()
+  (:type-name string)
+  (:default-properties
+      :escape-html-p t))
+
+(defdisplay object (:description (string string-attribute))
+  (<:as-html "ASD")
+  (if (getp :escape-html-p)
+      (<:as-html (attribute-value object string))
+      (<:as-is (attribute-value object string))))
+
+
 (defattribute image ()
   ())
 
 (defattribute image ()
   ())
 
-(defdisplay (:description (image image))
+(defdisplay object (:description (buttons (eql 'image-editor-buttons)))
+  (<ucw:a :action (ok component object)
+         (<:as-html "select this image")))
+
+(defdisplay object (:description (image image))
   (<:img
   (<:img
-   :class (or (getp :class) "lol-image") 
+   :class (or (getp :css-class) "lol-image") 
    :src (arnesi:strcat
         (or (getp :prefix) "images/")
         (escape-as-uri
          (attribute-value object image)))))
 
    :src (arnesi:strcat
         (or (getp :prefix) "images/")
         (escape-as-uri
          (attribute-value object image)))))
 
+(defdisplay object (:description (image image)
+            :in-layer editor)
+  (<:div
+   :class "lol-image-thumbnails"
+   
+  (dolist* (i (or (getp :directory)
+                 (cl-fad:list-directory (strcat *default-pathname-defaults* "wwwroot/images/"))))
+    (<:div
+     :style "border: 1px solid black;width:100px;"
+     (<:img
+      :width "90px"
+      :src (strcat (or (getp :prefix) "images/")
+                  (file-namestring i)))
+     (display-using-description 'image-editor-buttons component (file-namestring i) properties))
+    (<:p :style "clear:both;"))))
+