all repos — honk @ 4122d9525c5e007a3543a9d993ae77b910520634

my fork of honk

views/honkpage.html (view raw)

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