You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.1 KiB

5 years ago
{{ template "header.html" . }}
<div class="center">
<div class="info" id="infobox">
5 years ago
{{ if .Name }}
<p>{{ .Name }} <span style="margin-left:1em;"><a href="/u/{{ .Name }}/rss">rss</a></span>
{{ if .HonkCSRF }}
<div>
<form id="aboutform" action="/saveuser" method="POST">
<input type="hidden" name="CSRF" value="{{ .UserCSRF }}">
<textarea name="whatabout">{{ .RawWhatAbout }}</textarea>
<p>
<input type="submit" value="update">
</form>
</div>
{{ else }}
<p>{{ .WhatAbout }}
{{ end }}
{{ end }}
<p>{{ .ServerMessage }}
{{ if .HonkCSRF }}
{{ template "honkform.html" . }}
{{ end }}
</div>
5 years ago
<div>
{{ $BonkCSRF := .HonkCSRF }}
5 years ago
{{ range .Honks }}
{{ template "honk.html" map "Honk" . "Bonk" $BonkCSRF }}
5 years ago
{{ end }}
</div>
{{ if $BonkCSRF }}
<script>
function post(url, data) {
var x = new XMLHttpRequest()
x.open("POST", url)
x.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
x.send(data)
}
function bonk(el, xid) {
el.innerHTML = "bonked"
el.disabled = true
post("/bonk", "CSRF={{ $BonkCSRF }}&xid=" + xid)
}
function zonkit(el, xid) {
el.innerHTML = "zonked"
el.disabled = true
post("/zonkit", "CSRF={{ $BonkCSRF }}&xid=" + xid)
}
</script>
{{ end }}