diff options
author | colin <colin@cicadas.surf> | 2023-03-06 19:44:53 -0800 |
---|---|---|
committer | colin <colin@cicadas.surf> | 2023-03-06 19:44:53 -0800 |
commit | 187fce76197031dba1112bd6023b41166f039f3e (patch) | |
tree | 673514a59d4225b7773c6fc0edcd1e31a406de08 /src/views | |
parent | 36df81a7e3bb23d4cc347cc335fbd9b949a6af91 (diff) |
Add: adventure creation
Diffstat (limited to 'src/views')
-rw-r--r-- | src/views/components.lisp | 21 | ||||
-rw-r--r-- | src/views/player.lisp | 10 |
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)))) |