note reporting added

This commit is contained in:
Christian Müller
2017-09-20 21:32:59 +02:00
parent 05cefcef88
commit 90f647c394
3 changed files with 40 additions and 0 deletions
+13
View File
@@ -18,8 +18,21 @@
<a href="/{{.ID}}/stats">statistics</a> &middot;
<a href="/{{.ID}}/edit">edit</a> &middot;
<a href="/{{.ID}}/export">export</a> &middot;
<a href="javascript:void(0)" onclick="report()">report abuse</a> &middot;
{{end}}
<a href="/TOS.md">terms of service</a>
<script>
function report() {
var resp = prompt("Please shortly explain the problem with this note.");
if (resp) {
var xhr = new XMLHttpRequest();
xhr.open('POST', '/{{.ID}}/report');
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xhr.send("report=" + encodeURIComponent(resp));
alert("Thank you!")
}
}
</script>
</footer>
</body>
</html>