Commit f5c9d3db authored by amirouche's avatar amirouche

web: replace '/template' with '/sxml'

parent ecb3b9ff
......@@ -17,7 +17,6 @@ send patches to amirouche+dev@hypermove.net.
* ROADMAP
** 0.0 blog engine
*** easy: in procedure names replace /template with /sxml
*** easy: add navigation form on every page
*** easy: Add transactions to all queries
*** easy: Add autotools (see gnunet-guile2)
......
......@@ -258,7 +258,7 @@ exec guile -L $(pwd) -e '(@ (web) main)' -s "$0" "$@"
;;; signin
(define (signin/template values errors)
(define (signin/sxml values errors)
(template "signin"
`(form (@ (method "POST"))
(h2 "Sign in")
......@@ -275,7 +275,7 @@ exec guile -L $(pwd) -e '(@ (web) main)' -s "$0" "$@"
,(form/submit "submit"))))
(define (route/signin/get request)
(sxml->response (signin/template '() '())))
(sxml->response (signin/sxml '() '())))
(define (required value)
(and (or (not value)
......@@ -319,13 +319,13 @@ exec guile -L $(pwd) -e '(@ (web) main)' -s "$0" "$@"
(cookies `((token . ,token))))
(redirect "/" #:cookies cookies))
(sxml->response
(signin/template form `(("username" . "wrong username?")
(signin/sxml form `(("username" . "wrong username?")
("password" . "wrong password?"))))))
(sxml->response (signin/template form errors))))))
(sxml->response (signin/sxml form errors))))))
;;; signup
(define (signup/template values errors)
(define (signup/sxml values errors)
(template "signup"
`(form (@ (method "POST"))
(h2 "Sign up")
......@@ -348,7 +348,7 @@ exec guile -L $(pwd) -e '(@ (web) main)' -s "$0" "$@"
(define (route/signup/get request)
(sxml->response (signup/template '() '())))
(sxml->response (signup/sxml '() '())))
(define (username-valid? username)
(and (or (not username)
......@@ -446,7 +446,7 @@ user vertex"
(car (ref form "username"))
(car (ref form "password")))
(redirect "/signin"))
(sxml->response (signup/template form errors))))))
(sxml->response (signup/sxml form errors))))))
(define (router app request body)
(log-debug "~a ~a" (request-method request) (uri-path (request-uri request)))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment