blob: 5ddb8b920fc28472373bb82115005cd596c30d7d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
;;;; pages/tavern.lisp -- enter the tavern
(in-package :dnd)
;;; PAGES & PAGE CLASSES
(defclass/std tavern ()
((player adventures)))
(defrender t ((tavern tavern))
(with-page (:title "A Bustling Tavern")
(let ((player (player tavern)))
(render :details player)
(when (player-heroes player)
(:h4 "Your Heroes:")
(render :list (player-heroes player)))
(when (adventures tavern)
(:h4 "All Adventures:")
(render :list (adventures tavern))))))
;;; ENDPONT HELPERS
;;; ENDPOINT DEFINTIONS
(defendpoint* :get "/tavern" () ()
(with-session (me)
(render (page-render-mode)
(make-instance 'tavern
:player me
:adventures (all-adventures)))))
|