diff options
Diffstat (limited to 'src/views')
-rw-r--r-- | src/views/hero.lisp | 16 | ||||
-rw-r--r-- | src/views/quest.lisp | 6 |
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)))) |