summaryrefslogtreecommitdiff
path: root/src/views
diff options
context:
space:
mode:
authorcolin <colin@cicadas.surf>2023-03-07 18:36:45 -0800
committercolin <colin@cicadas.surf>2023-03-07 18:36:45 -0800
commite2a60e8d2b8e41bcd2c9a39d8e2210f701b92353 (patch)
tree91a8e68115fcbc506c9952161a1a8f37315b16cf /src/views
parenteea0da373349349b4d25dd4bc116a9c9eb04fb98 (diff)
Add: growing an app skeleton
Diffstat (limited to 'src/views')
-rw-r--r--src/views/hero.lisp16
-rw-r--r--src/views/quest.lisp6
2 files changed, 17 insertions, 5 deletions
diff --git a/src/views/hero.lisp b/src/views/hero.lisp
index 31fa169..90c2803 100644
--- a/src/views/hero.lisp
+++ b/src/views/hero.lisp
@@ -4,8 +4,14 @@
(defrender :list-item ((hero hero))
(with-html
- (with-slots (name quest) hero
- (:p name "the" (hero-class hero) (hero-title hero)
- (when quest
- (:span "who is off in on a quest: ")
- (:span (render :inline quest)))))))
+ (: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/quest.lisp b/src/views/quest.lisp
index 0312dba..b289d76 100644
--- a/src/views/quest.lisp
+++ b/src/views/quest.lisp
@@ -2,3 +2,9 @@
(in-package :dnd)
+
+
+(defrender :link-to ((quest quest))
+ (with-html
+ (:a :href (urlpath quest)
+ (name quest))))