forked from linkeddata/gold
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplates.go
105 lines (96 loc) · 3.39 KB
/
templates.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
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
package gold
var (
// Apps contains a list of default apps that get server instead of RDF
Apps = map[string]string{
"tabulator": `<!DOCTYPE html>
<html id="docHTML">
<head>
<link type="text/css" rel="stylesheet" href="https://w3.scripts.mit.edu/tabulator/tabbedtab.css" />
<script type="text/javascript" src="https://w3.scripts.mit.edu/tabulator/js/mashup/mashlib.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function() {
$rdf.Fetcher.crossSiteProxyTemplate = document.origin + '/` + ProxyPath + `?uri={uri}';
var uri = window.location.href;
window.document.title = uri;
var kb = tabulator.kb;
var subject = kb.sym(uri);
tabulator.outline.GotoSubject(subject, true, undefined, true, undefined);
});
</script>
</head>
<body>
<div class="TabulatorOutline" id="DummyUUID">
<table id="outline"></table>
</div>
</body>
</html>`,
"newCert": `<!DOCTYPE html>
<html id="docHTML">
<body>
<form method="POST" action="/` + SystemPrefix + `/newCert">
<h2>Issue new certificate</h2>
Name: <input type="text" name="name">
WebID: <input type="text" name="webid">
<keygen id="spkacWebID" name="spkac" challenge="randomchars" keytype="rsa" hidden></keygen>
<input type="submit" value="Issue">
</form>
</body>
</html>`,
"accountRecovery": `<!DOCTYPE html>
<html id="docHTML">
<body>
<form method="POST">
What is your WebID?
<input type="text" name="webid">
<input type="submit" value="Recover account">
</form>
</body>
</html>`,
"401": `<!DOCTYPE html>
<html id="docHTML">
<head>
</head>
<body>
<h1>401 - oh noes, you need to authenticate!</h1>
<h2>Do you need a WebID? You can sign up for one at <a href="https://databox.me/" target="_blank">databox.me</a>.</h2>
<h2>Also, please visit the <a href="/` + SystemPrefix + `/accountRecovery">recovery page</a> in case you have lost access to your credentials.</h2>
</body>
</html>`,
"403": `<!DOCTYPE html>
<html id="docHTML">
<head>
</head>
<body>
<h1>403 - oh noes, access denied!</h1>
<h2>Please visit the <a href="/` + SystemPrefix + `/accountRecovery">recovery page</a> in case you have lost access to your credentials.</h2>
</body>
</html>`,
"404": `<!DOCTYPE html>
<html id="docHTML">
<head>
</head>
<body>
<h1>404 - oh noes, there's nothing here</h1>
</body>
</html>`,
}
// SMTPTemplates contains a list of templates for sending emails
SMTPTemplates = map[string]string{
"accountRecovery": `<p>Hello,</p>
<p>We have a received a request to recover you account, originating from <strong>{{.IP}}</strong>. Please ignore this email if you did not send this request.</p>
<p>Click the following link to recover your account: <a href="{{.Link}}" target="_blank">{{.Link}}</a></p>
<p>This email was generated automatically. No one will respond if you reply to it.</p>
<p>Sincerely,<br>
{{.From}}</p>
`,
"welcomeMail": `<p>Hello {{.Name}},</p>
<p>It looks like you have successfully created your WebID and Solid account on {{.Host}}. Congratulations!</p>
<p>Here are some useful things you can do right away:</p>
<p>* you can start browsing your files here: {{.AccountURI}}.</p>
<p>* you can manage your personal profile information here: {{.ProfileEditor}}</p>
<p>We would like to kindly remind you that we will not use your email address for any other purpose than allowing you to authenticate and/or recover your account credentials.</p>
<p>Best,</p>
<p>{{.Host}} team</p>
`,
}
)