all repos — honk @ 8f0c1c92424f7020d78b288a18664ff034804f38

my fork of honk

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{{ if .LocalJSParam }}
33<script src="/local.js{{ .LocalJSParam }}"></script>
34{{ end }}
35</div>
36{{ if and .HonkCSRF (not .IsPreview) }}
37<div class="info" id="refreshbox">
38<p><button onclick="refreshhonks(this)">refresh</button><span></span>
39<button onclick="oldestnewest(this)">scroll down</button>
40</div>
41{{ if eq .ServerMessage "one honk maybe more" }} <script> hideelement("refreshbox")</script> {{ end }}
42{{ end }}
43<div id="honksonpage">
44<div>
45{{ $BonkCSRF := .HonkCSRF }}
46{{ $IsPreview := .IsPreview }}
47{{ $MapLink := .MapLink }}
48{{ $Badonk := .User.Options.Reaction }}
49{{ $OmitImages := .User.Options.OmitImages }}
50{{ range .Honks }}
51{{ template "honk.html" map "Honk" . "MapLink" $MapLink "BonkCSRF" $BonkCSRF "IsPreview" $IsPreview "Badonk" $Badonk "OmitImages" $OmitImages }}
52{{ end }}
53</div>
54</div>
55</main>