all repos — honk @ masto

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<form action="/q" method="GET" id="searchform">
 6<input type="text" name="q" autocomplete=off size=10 id="searchbox" placeholder="search">
 7  {{ if .Name }}
 8  <script>
 9    const searchBox = document.getElementById('searchbox');
10    const searchForm = document.getElementById('searchform');
11
12    searchForm.addEventListener('submit', function(event) {
13      event.preventDefault();
14
15      let query = searchBox.value;
16      let newQuery = query + ' @self';
17
18      searchBox.value = newQuery;
19
20      searchForm.submit();
21    });
22  </script>
23  {{ end }}
24</form>
25<div>
26{{ if .Name }}
27<p>{{ .Name }} <span class="left1em"><a href="/u/{{ .Name }}/rss">rss</a></span>
28<p>{{ .WhatAbout }}
29{{ end }}
30{{ .ServerMessage }}
31</div>
32</div>
33{{ if .HonkCSRF }}
34{{ template "honkform.html" . }}
35<script src="/honkpage.js{{ .JSParam }}" defer data-csrf="{{ .HonkCSRF }}" data-pagename="{{ .PageName }}" data-pagearg="{{ .PageArg }}" data-tophid="{{ .TopHID }}" data-srvmsg="{{ .ServerMessage }}"></script>
36{{ end }}
37{{ if .LocalJSParam }}
38<script src="/local.js{{ .LocalJSParam }}" defer></script>
39{{ end }}
40</div>
41{{ if and .HonkCSRF (not .IsPreview) }}
42<div class="info" id="refreshbox">
43<p><button id="honkrefresher" class="refresh">refresh</button><span></span>
44<button id="newerscroller" class="scrolldown">scroll down</button>
45</div>
46{{ end }}
47<div id="honksonpage">
48<div>
49{{ $BonkCSRF := .HonkCSRF }}
50{{ $IsPreview := .IsPreview }}
51{{ $MapLink := .MapLink }}
52{{ $Badonk := .User.Options.Reaction }}
53{{ $OmitImages := .User.Options.OmitImages }}
54{{ $UserURL := .User.URL }}
55{{ range .Honks }}
56{{ template "honk.html" map "Honk" . "MapLink" $MapLink "BonkCSRF" $BonkCSRF "IsPreview" $IsPreview "Badonk" $Badonk "OmitImages" $OmitImages "UserURL" $UserURL }}
57{{ end }}
58</div>
59</div>
60</main>