-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmpl.go
48 lines (42 loc) · 1002 Bytes
/
tmpl.go
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
package main
import (
"html/template"
)
var userInfoTemplate = template.Must(template.New("").Parse(`
<html><body>
This app is now authenticated to access your Google user info. Your details are:<br />
{{.}}
</body></html>
`))
type ErrorPage struct {
Code int
Message interface{}
}
var errorTemplate = template.Must(template.New("").Parse(`
<html><body>
<h2>This app is crashed with error:</h2>
<h2>Code: {{.Code}}<br>
Message: «{{.Message}}»
</h2>
<a href="/">return to main page</a>
</body></html>
`))
type LoginPage struct {
GoogleUrl string
Admin string
}
var loginTemplate = template.Must(template.New("").Parse(`
<!DOCTYPE html>
<html>
<head><title>Login page</title></head>
<body>
<div style="text-align: center; font-size: 80%; font-family: Arial, sans-serif">
<p><a href="{{.GoogleUrl}}">Log in</a> with your Google account</p>
<p style="margin-top: 3em">
For access, contact with <a href="{{.Admin}}">administrator</a>.
</p>
:D
</div>
</body>
</html>
`))