all repos — honk @ 82641e81b2b76dbbf46fc9d2173b1999ab2cff7a

my fork of honk

views/honk.html (view raw)

 1<article class="honk {{ .Honk.Style }}" data-convoy="{{ .Honk.Convoy }}">
 2{{ $bonkcsrf := .BonkCSRF }}
 3{{ with .Honk }}
 4<header>
 5<img alt="" src="/a?a={{ .Honker}}">
 6{{ if .Oonker }}
 7<img alt="" src="/a?a={{ .Oonker}}">
 8{{ end }}
 9<p>
10{{ if $bonkcsrf }}
11<a href="/h?xid={{ .Honker }}" rel=noreferrer>{{ .Username }}</a>
12{{ else }}
13<a href="{{ .Honker }}" rel=noreferrer>{{ .Username }}</a>
14{{ end }}
15<span class="clip"><a href="{{ .URL }}" rel=noreferrer>{{ .What }}</a> {{ .Date.Format "02 Jan 2006 15:04" }}</span>
16{{ if .Oonker }}
17<br>
18<span style="margin-left: 1em;" class="clip">
19{{ if $bonkcsrf }}
20original: <a href="/h?xid={{ .Oonker }}" rel=noreferrer>{{ .Oondle }}</a>
21{{ else }}
22original: <a href="{{ .Oonker }}" rel=noreferrer>{{ .Oondle }}</a>
23{{ end }}
24</span>
25{{ else }}
26{{ if .RID }}
27<br>
28<span style="margin-left: 1em;" class="clip">
29in reply to: <a href="{{ .RID }}" rel=noreferrer>{{ .RID }}</a>
30</span>
31{{ end }}
32{{ end }}
33<br>
34{{ if $bonkcsrf }}
35<span style="margin-left: 1em;" class="clip">convoy: <a class="convoylink" href="/t?c={{ .Convoy }}">{{ .Convoy }}</a></span>
36{{ else }}
37<span style="margin-left: 1em;" class="clip">convoy: {{ .Convoy }}</span>
38{{ end }}
39</header>
40<p>
41<details class="noise" {{ .Open }} >
42<summary>{{ .Precis }}</summary>
43<p>{{ .Precis }}
44<p>{{ .HTML }}
45{{ range .Donks }}
46{{ if .Local }}
47{{ if eq .Media "text/plain" }}
48<p><a href="/d/{{ .XID }}">Attachment: {{ .Name }}</a>
49{{ else }}
50<p><img src="/d/{{ .XID }}" title="{{ .Desc }}" alt="{{ .Desc }}">
51{{ end }}
52{{ else }}
53{{ if .XID }}
54<p><a href="{{ .URL }}">External Attachment: {{ .Name }}</a>
55{{ else }}
56{{ if eq .Media "video/mp4" }}
57<p><video controls src="{{ .URL }}">{{ .Name }}</video>
58{{ else }}
59<p><img src="{{ .URL }}" title="{{ .Desc }}" alt="{{ .Desc }}">
60{{ end }}
61{{ end }}
62{{ end }}
63{{ end }}
64</details>
65{{ end }}
66{{ if $bonkcsrf }}
67<p>
68<details class="actions">
69<summary>Actions
70</summary>
71<div>
72<p>
73{{ if .Honk.Public }}
74{{ if .Honk.IsBonked }}
75<button onclick="unbonk(this, '{{ .Honk.XID }}');">unbonk</button>
76{{ else }}
77<button onclick="bonk(this, '{{ .Honk.XID }}');">bonk</button>
78{{ end }}
79{{ else }}
80<button disabled>nope</button>
81{{ end }}
82<button onclick="showhonkform(this, '{{ .Honk.XID }}', '{{ .Honk.Handle }}');">honk back</button>
83<button onclick="muteit(this, '{{ .Honk.Convoy }}');">mute</button>
84<button onclick="zonkit(this, '{{ .Honk.XID }}');">zonk</button>
85{{ if .Honk.IsAcked }}
86<button onclick="deackit(this, '{{ .Honk.XID }}');">deack</button>
87{{ else }}
88<button onclick="ackit(this, '{{ .Honk.XID }}');">ack</button>
89{{ end }}
90<button><a href="/edit?xid={{ .Honk.XID }}">edit</a></button>
91</div>
92</details>
93<p>
94{{ end }}
95</article>