aboutsummaryrefslogtreecommitdiffhomepage
path: root/site
diff options
context:
space:
mode:
Diffstat (limited to 'site')
-rw-r--r--site/home.lisp33
-rw-r--r--site/html.lisp22
-rw-r--r--site/login.lisp25
3 files changed, 39 insertions, 41 deletions
diff --git a/site/home.lisp b/site/home.lisp
index 0b02e0c..ebc644b 100644
--- a/site/home.lisp
+++ b/site/home.lisp
@@ -4,20 +4,19 @@
:using user-known
:get :route ""
:returns "text/html"
- :handle (page (:title "V A M P I R E")
- (:div :id "main"
- (:h1 "hey " (user-name user))
- (:br)
- (:div
- (:form :method "POST" :action (wknd:route-to 'destroy.session)
- (:button :type "submit" "Logout")))
- (:br)
- (:br)
- (:div
- (:form :method "POST" :action (wknd:route-to 'create.invite)
- (:p "Initiate an invitation...")
- (:button :type "submit" "Bite Someone")))
- (:br)
- (:h2 "Outstanding inBites:")
- (:ul (dolist (i (invites-by-maker user))
- (:li (key i)))))))
+ :handle
+ (page
+ "V A M P I R E"
+ (<div>
+ ($vcenter
+ (<div> (<h3> "hey " (user-name user))
+ (<form> (@ :method "POST" :action (wknd:route-to 'destroy.session))
+ (<button> (@ :type "submit") "Logout"))))
+ (<div>
+ (<form> (@ :method "POST" :action (wknd:route-to 'create.invite))
+ (<p> "Initiate an invitation...")
+ (<button> (@ :type "submit") "Bite Someone")))
+ (<h2> "Outstanding inBites:")
+ (apply #'<ul>
+ (mapcar (lambda (i) (<li> (key i)))
+ (invites-by-maker (user-with-name "alucard")))))))
diff --git a/site/html.lisp b/site/html.lisp
index d1d0f1a..4fdecd3 100644
--- a/site/html.lisp
+++ b/site/html.lisp
@@ -1,14 +1,16 @@
(in-package #:vampire)
-(defmacro page ((&key (title "") (csspath "/css/style.css")) &body body)
- `(spinneret:with-html-string
- (:doctype)
- (:head
- (:title ,title)
- (:meta :charset "UTF-8")
- (:meta :name "viewport" :content "width=device-width, initial-scale=1.0")
- (:link :rel "stylesheet" :href ,csspath))
- (:body
- ,@body)))
+(defun page (title &rest body)
+ (with-output-to-string (str)
+ (html
+ (<html>
+ (<head>
+ (<title> title)
+ (<meta> (@ :charset "UTF-8"))
+ (<meta> (@ :name "viewport" :content "width=device-width, initial-scale=1.0")))
+ (<body>
+ ($center
+ (<div> (@ :class "container") (apply 'eval body)))))
+ str)))
diff --git a/site/login.lisp b/site/login.lisp
index cb1f82f..6a6c8aa 100644
--- a/site/login.lisp
+++ b/site/login.lisp
@@ -6,17 +6,14 @@
:handle (login-page))
(defun login-page ()
- (page (:title "V A M P I R E ~ LOGIN")
- (:div (:h1 "I vant to suck your blood")
- (:form :method "POST" :action (wknd:route-to 'create.session)
- (:input :placeholder "Name" :name "name")
- (:br)
- (:input :placeholder "Password" :type "password" :name "password")
- (:br)
- (:button :type "submit" "Click to Login"))
- (:a :href (wknd:route-to 'new-account.html)
- "Become Undead"))))
-
-
-
-
+ (page
+ "V A M P I R E ~ LOGIN"
+ (<div> (@ :class "title")
+ (<h1> "I vant to suck your blood")
+ (<form> (@ :method "POST" :action (wknd:route-to 'create.session))
+ (<input> (@ :placeholder "Name" :name "name"))
+ (<input> (@ :placeholder "Password" :type "password" :name "password"))
+ (<button> (@ :type "submit") "Click to Login"))
+ ($center
+ (<a> (@ :href (wknd:route-to 'new-account.html))
+ "Hath thou been bitten? Click here to become one of us...")))))