-
-
Notifications
You must be signed in to change notification settings - Fork 38
/
static.clj
51 lines (44 loc) · 1.15 KB
/
static.clj
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
39
40
41
42
43
44
45
46
47
48
49
50
51
(ns example.static
(:require
[rum.core :as rum]))
(def signin-form
(rum/fragment
[:p "Email address:"]
[:form {:action "/api/signin-request" :method "post"}
[:input {:name "email" :type "email" :placeholder "Email"}]
[:button {:type "submit"} "Sign up/Sign in"]]))
(def home
[:html
[:head
[:meta {:charset "utf-8"}]
[:script {:src "/js/ensure-signed-out.js"}]]
[:body
signin-form]])
(def signin-sent
[:html [:head [:meta {:charset "utf-8"}]]
[:body
[:p "Sign-in link sent, please check your inbox."]
[:p "(Just kidding: click on the sign-in link that was printed to the console.)"]]])
(def signin-fail
[:html [:head [:meta {:charset "utf-8"}]]
[:body
[:p "Invalid sign-in token."]
signin-form]])
(def app
[:html
[:head
[:meta {:charset "utf-8"}]
[:script {:src "/js/ensure-signed-in.js"}]]
[:body
[:#app "Loading..."]
[:script {:src "/cljs/app/main.js"}]]])
(def not-found
[:html [:head [:meta {:charset "utf-8"}]]
[:body
[:p "Not found."]]])
(def pages
{"/" home
"/signin-sent/" signin-sent
"/signin-fail/" signin-fail
"/app/" app
"/404.html" not-found})