summaryrefslogtreecommitdiff
path: root/src/views
diff options
context:
space:
mode:
Diffstat (limited to 'src/views')
-rw-r--r--src/views/components.lisp21
-rw-r--r--src/views/player.lisp10
2 files changed, 30 insertions, 1 deletions
diff --git a/src/views/components.lisp b/src/views/components.lisp
index 95ed062..de4cc5c 100644
--- a/src/views/components.lisp
+++ b/src/views/components.lisp
@@ -17,7 +17,26 @@ the class string for the contained list items."
(with-html
(:ol :class class
(dolist (item data)
- (:li :calss item-class (render :list-item item))))))
+ (:li :class item-class (render :list-item item))))))
+
+(defrender :select ((data list) (multiple "false") name class)
+ (with-html
+ (when data
+ (:select :multiple multiple
+ :name (or name (format nil "select-~a" (class-of (first data))))
+ :class (or class (format nil "select ~a" (class-of (first data))))
+ (dolist (item data)
+ (render :option item))))))
+
+(defrender :checkboxes ((data list) id class)
+ (with-html
+ (when data
+ (:div :class (or class (format nil "checkboxes ~a" (class-of (first data))))
+ :id (or id (format nil "checkboxes-~a" (class-of (first data))))
+ (dolist (item data)
+ (render :checkbox item)
+ (:br))))))
+
;;;; PAGE ELEMENTS
diff --git a/src/views/player.lisp b/src/views/player.lisp
index 087848e..5a3d074 100644
--- a/src/views/player.lisp
+++ b/src/views/player.lisp
@@ -6,3 +6,13 @@
(with-html
(:div :class "player details"
(:h3 "Welcome " (nickname player)))))
+
+(defrender :option ((player player))
+ (with-html
+ (:option :value (uid player) (nickname player))))
+
+
+(defrender :checkbox ((player player))
+ (with-html
+ (:input :type "checkbox" :id (uid player) :name "POSSIBLE-SEER" :value (uid player))
+ (:label :for (uid player) (nickname player))))