summaryrefslogtreecommitdiff
path: root/src/views
diff options
context:
space:
mode:
authorcolin <colin@cicadas.surf>2023-04-01 09:48:08 -0700
committercolin <colin@cicadas.surf>2023-04-01 09:48:08 -0700
commitcc3f850c514967ae2f9effef7e68e1d4965c6865 (patch)
tree6d0b52c3a65d53f247f4c8272667aca5a4e05bac /src/views
parent56a584ab1b13ff9510dd5145a778000169901a76 (diff)
Refactor to make cooperative hacking nicer
Diffstat (limited to 'src/views')
-rw-r--r--src/views/adventure.lisp14
-rw-r--r--src/views/components.lisp51
-rw-r--r--src/views/hazard.lisp4
-rw-r--r--src/views/hero.lisp17
-rw-r--r--src/views/player.lisp22
-rw-r--r--src/views/quest.lisp10
-rw-r--r--src/views/rumor.lisp4
7 files changed, 0 insertions, 122 deletions
diff --git a/src/views/adventure.lisp b/src/views/adventure.lisp
deleted file mode 100644
index 85d8e3d..0000000
--- a/src/views/adventure.lisp
+++ /dev/null
@@ -1,14 +0,0 @@
-;;;; views/adventure.lisp -- views of for adventure instances
-
-(in-package :dnd)
-
-(defrender :inline ((adventure adventure))
- (with-html
- (:a :href (urlpath adventure) (title adventure))))
-
-(defrender :option ((adventure adventure))
- (with-html
- (:option :value (uid adventure) (title adventure))))
-
-(defrender :list-item ((adventure adventure))
- (render :inline adventure))
diff --git a/src/views/components.lisp b/src/views/components.lisp
deleted file mode 100644
index bb9772d..0000000
--- a/src/views/components.lisp
+++ /dev/null
@@ -1,51 +0,0 @@
-;;;; views/components.lisp -- reusable components
-
-(in-package :dnd)
-
-;;; LIST DATA
-
-(defrender :list ((data list) (class "listview") (item-class "listitem"))
- "A catch all for rendering lists of renderable data items as unordered
-lists. CLASS is the lass string for the containing list. ITEM-CLASS is
-the class string for the contained list items."
- (with-html
- (:ol :class class
- (dolist (item data)
- (:li :class item-class (render :list-item item))))))
-
-(defrender :horiz-list ((data list) (class "hlistview") (item-class "listitem"))
- (with-html
- (:ol :class class
- (dolist (item data)
- (:li :class item-class (render :list-item item))))))
-
-(defrender :select ((data list) name class)
- (with-html
- (when data
- (:select :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
-
-(defun navbar ()
- (with-html
- (:nav :class "navbar" :aria-label "Navigation"
- (:div :class "logo" :aria-label "DND logo" "DND")
- (:ul :class "nav-links" :aria-label "Nav links"
- (:li (:a :href "/hero" :aria-label "Hero profile" "🧝"))
- (:li (:a :href "/inventory" :aria-label "Inventory" "🎒"))
- (:li (:a :href "/quests" :aria-label "Quests" "📜"))
- (:li (:a :href "/tavern" :aria-label "Tavern" "🍺"))))))
-
diff --git a/src/views/hazard.lisp b/src/views/hazard.lisp
deleted file mode 100644
index a842c6f..0000000
--- a/src/views/hazard.lisp
+++ /dev/null
@@ -1,4 +0,0 @@
-;;;; hazard.lisp -- views of hazard insances
-
-(in-package :dnd)
-
diff --git a/src/views/hero.lisp b/src/views/hero.lisp
deleted file mode 100644
index 90c2803..0000000
--- a/src/views/hero.lisp
+++ /dev/null
@@ -1,17 +0,0 @@
-;;;; views/hero.lisp
-
-(in-package :dnd)
-
-(defrender :list-item ((hero hero))
- (with-html
- (:p
- (render :link-to hero)
- (a:when-let (quest (quest hero))
- (:span "who's quest is to")
- (:span (render :link-to quest))))))
-
-
-(defrender :link-to ((hero hero))
- (with-html
- (:a :href (urlpath hero)
- (unique-name hero) "the" (hero-class hero) (hero-title hero))))
diff --git a/src/views/player.lisp b/src/views/player.lisp
deleted file mode 100644
index 9150626..0000000
--- a/src/views/player.lisp
+++ /dev/null
@@ -1,22 +0,0 @@
-;;;; views/player.lisp
-
-(in-package :dnd)
-
-(defrender :details ((player player))
- (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))))
-
-(defrender :list-item ((player player))
- (with-html
- (nickname player)))
diff --git a/src/views/quest.lisp b/src/views/quest.lisp
deleted file mode 100644
index b289d76..0000000
--- a/src/views/quest.lisp
+++ /dev/null
@@ -1,10 +0,0 @@
-;;;; views/quest.lisp
-
-(in-package :dnd)
-
-
-
-(defrender :link-to ((quest quest))
- (with-html
- (:a :href (urlpath quest)
- (name quest))))
diff --git a/src/views/rumor.lisp b/src/views/rumor.lisp
deleted file mode 100644
index 90f56ae..0000000
--- a/src/views/rumor.lisp
+++ /dev/null
@@ -1,4 +0,0 @@
-;;;; views/rumor.lisp
-
-(in-package :dnd)
-