all repos — honk @ a7b12f7cc706b4ad652a52e489019a7f301754a1

my fork of honk

views/honkpage.html (view raw)

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