views/honkpage.html (view raw)
1{{ template "header.html" . }}
2<main>
3<div class="info" id="infobox">
4<div id="srvmsg">
5{{ if .Name }}
6<p>{{ .Name }} <span style="margin-left:1em;"><a href="/u/{{ .Name }}/rss">rss</a></span>
7<p>{{ .WhatAbout }}
8{{ end }}
9<p>{{ .ServerMessage }}
10</div>
11{{ if .HonkCSRF }}
12{{ template "honkform.html" . }}
13<script>
14var csrftoken = {{ .HonkCSRF }}
15var honksforpage = { }
16var curpagestate = { name: "{{ .PageName }}", arg : "{{ .PageArg }}" }
17var tophid = { }
18tophid[curpagestate.name + ":" + curpagestate.arg] = "{{ .TopHID }}"
19var servermsgs = { }
20servermsgs[curpagestate.name + ":" + curpagestate.arg] = "{{ .ServerMessage }}"
21</script>
22<script src="/honkpage.js{{ .JSParam }}"></script>
23{{ end }}
24<script>
25function playit(elem, word, wordlist, xid) {
26 import('/wonk.js').then(module => {
27 makeaguess = module.makeaguess
28 module.addguesscontrols(elem, word, wordlist, xid)
29 })
30}
31</script>
32</div>
33{{ if and .HonkCSRF (not .IsPreview) }}
34<div class="info" id="refreshbox">
35<p><button onclick="refreshhonks(this)">refresh</button><span></span>
36<button onclick="oldestnewest(this)">scroll down</button>
37</div>
38{{ if eq .ServerMessage "one honk maybe more" }} <script> hideelement("refreshbox")</script> {{ end }}
39{{ end }}
40<div id="honksonpage">
41<div>
42{{ $BonkCSRF := .HonkCSRF }}
43{{ $IsPreview := .IsPreview }}
44{{ $MapLink := .MapLink }}
45{{ $Badonk := .User.Options.Reaction }}
46{{ $OmitImages := .User.Options.OmitImages }}
47{{ range .Honks }}
48{{ template "honk.html" map "Honk" . "MapLink" $MapLink "BonkCSRF" $BonkCSRF "IsPreview" $IsPreview "Badonk" $Badonk "OmitImages" $OmitImages }}
49{{ end }}
50</div>
51</div>
52</main>