File tree 3 files changed +63
-0
lines changed
3 files changed +63
-0
lines changed Original file line number Diff line number Diff line change @@ -190,6 +190,41 @@ table#professional-experience tr + tr td {
190
190
padding-top : 0.75rem ;
191
191
}
192
192
193
+ /* spinner used while waiting for fetch, see https://loading.io/css/ */
194
+
195
+ .loading-spinner {
196
+ color : # 961c1c ;
197
+ }
198
+ .lds-dual-ring ,
199
+ .lds-dual-ring : after {
200
+ box-sizing : border-box;
201
+ }
202
+ .lds-dual-ring {
203
+ display : inline-block;
204
+ width : 80px ;
205
+ height : 80px ;
206
+ }
207
+ .lds-dual-ring : after {
208
+ content : " " ;
209
+ display : block;
210
+ width : 64px ;
211
+ height : 64px ;
212
+ margin : 8px ;
213
+ border-radius : 50% ;
214
+ border : 6.4px solid currentColor;
215
+ border-color : currentColor transparent currentColor transparent;
216
+ animation : lds-dual-ring 1.2s linear infinite;
217
+ }
218
+ @keyframes lds-dual-ring {
219
+ 0% {
220
+ transform : rotate (0deg );
221
+ }
222
+ 100% {
223
+ transform : rotate (360deg );
224
+ }
225
+ }
226
+
227
+
193
228
/* footer */
194
229
195
230
# main {
Original file line number Diff line number Diff line change
1
+ ---
2
+ layout : default
3
+ title : Form Submissions
4
+ ---
5
+
6
+ This table shows form submissions over the last 30 days:
7
+ <div id =" form-submissions " ><div class =" lds-dual-ring " ></div ></div >
8
+
9
+ <script >
10
+ fetch (" /secure/api/form" , {
11
+ method: " GET" ,
12
+ headers: {
13
+ " accept" : " application/json" ,
14
+ " content-type" : " application/json" ,
15
+ },
16
+ })
17
+ .then (res => res .json ())
18
+ .then (submissions => {
19
+ const table = document .createElement (" table" );
20
+ submissions .forEach (row => {
21
+ const tr = table .insertRow ();
22
+ const td = tr .insertCell ();
23
+ td .innerHTML = row .submission_id ;
24
+ });
25
+ document .getElementById (" form-submissions" ).innerHTML = table;
26
+ });
27
+ </script >
Original file line number Diff line number Diff line change @@ -3,4 +3,5 @@ layout: default
3
3
title : " Secure area: index"
4
4
---
5
5
6
+ - [ (Contact) form submissions] ( form-submissions )
6
7
- [ Token generator (for urgent contact form)] ( token-generator )
You can’t perform that action at this time.
0 commit comments