all repos — honk @ 36f3f3f5a152e856e2f495155825a1e05e0522cc

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 topxid = { }
34topxid[curpagestate.name + ":" + curpagestate.arg] = "{{ .TopXID }}"
35var servermsgs = { }
36servermsgs[curpagestate.name + ":" + curpagestate.arg] = "{{ .ServerMessage }}"
37
38</script>
39<script src="/honkpage.js{{ .JSParam }}"></script>
40{{ end }}