-
Notifications
You must be signed in to change notification settings - Fork 6
/
certificate.html
155 lines (130 loc) · 4.72 KB
/
certificate.html
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
{{if .Refresh}}
<meta http-equiv="refresh" content="{{.Refresh}}" />
{{end}}
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;700&display=swap"
rel="stylesheet"
/>
<link rel="stylesheet" href="static/styles.css" />
</head>
<body>
<div class="wrapper">
<img src="static/images/logo.svg" alt="Logo" width="220" height="191" />
<h1 class="mainTitle">Print Your Certificate</h1>
<div class="divider"></div>
<div>
{{if .Certificate}}
<h2>Hi, {{.Name}} <{{.Email}}>!</h2>
<p>Here is your certificate:</p>
<div class="panel">
<div class="content">{{template "certificate" .Certificate}}</div>
<img
src="static/images/certificate-icon.svg"
alt="An icon representing a certificate"
class="iconBottom"
/>
</div>
{{end}}
{{if .Refresh}}
<div class="success">The certificate will appear shortly, this page will reload itself.</div>
{{end}}
{{if .AlreadyPrinted}}
<div class="success">The certificate has already been printed.</div>
{{end}}
{{if .MarkedToBePrinted}}
<div class="success">The certificate is waiting to be printed.</div>
{{end}}
{{if .Message}}
<div class="error">{{.Message}}</div>
{{end}}
{{if .Error}}
<div class="error">
<p>{{.Error}}</p>
</div>
{{end}}
{{if .Certificate }}
<div>
{{if not .AlreadyPrinted}}
<form method="POST" action="/print">
<input name="certName" type="text" value="{{.CertName}}" hidden />
<input name="fetchKey" type="text" value="{{.FetchKey}}" hidden />
<button type="submit" class="constrain">Send to print</button>
</form>
<br />
<div class="divider"></div>
{{end}}
<form method="POST" action="/sign-guestbook">
<!--
<p>
Signing is much more fun using your certificate! <br />
The tarball download contains instructions. <br />
Signing with your cert will gain you a special badge on the guestbook! <br />
</p>
-->
<input name="certName" type="text" value="{{.CertName}}" hidden />
<input name="fetchKey" type="text" value="{{.FetchKey}}" hidden />
<button type="submit" class="constrain">
Sign the Guestbook!
</button>
</form>
<div class="divider"></div>
<form method="GET" action="/cert-manager-bundle.tar">
<input name="certName" type="text" value="{{.CertName}}" hidden />
<input name="fetchKey" type="text" value="{{.FetchKey}}" hidden />
<button type="submit" class="constrain">
Download Cert Bundle Tarball
</button>
</form>
<!--
<br />
<form method="GET" action="/download">
<input name="certName" type="text" value="{{.CertName}}" hidden />
<input name="fetchKey" type="text" value="{{.FetchKey}}" hidden />
<button type="submit" class="constrain">
Download PEM Certificate Chain
</button>
</form>
<br />
<form method="GET" action="/downloadpkey">
<input name="certName" type="text" value="{{.CertName}}" hidden />
<input name="fetchKey" type="text" value="{{.FetchKey}}" hidden />
<button type="submit" class="constrain">
Download PEM Private Key
</button>
</form>
-->
</div>
{{end}}
<div class="divider"></div>
<div>
<a href="/">
<button type="submit" class="constrain">Go back to the creation page</button>
</a>
</div>
{{if .Debug}}
<div class="divider"></div>
<pre>{{.Debug}}</pre>
{{end}}
<div class="divider"></div>
<footer>
<p>
Powered by <a href="https://cert-manager.io" target="_blank">cert-manager.io</a>
</p>
<p class="small">
Project proudly supported by
<a href="https://venafi.com" target="_blank">Venafi</a>
</p>
<p class="small">
Design by <a href="https://constantinchirila.com" target="_blank">Constantin Chirila</a>
</p>
</footer>
</div>
</div>
</body>
</html>