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 class="honkerlink" href="/h?xid={{ .Honker }}" data-xid="{{ .Honker }}">{{ .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 class="honkerlink" href="/h?xid={{ .Oonker }}">{{ .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>{{ .HTPrecis }}<p></summary>
43<p>{{ .HTPrecis }}
44<p>{{ .HTML }}
45{{ with .Time }}
46<p>Time: {{ .StartTime.Local.Format "03:04PM EDT Mon Jan 02"}}
47{{ if .Duration }}<br>Duration: {{ .Duration }}{{ end }}
48{{ end }}
49{{ with .Place }}
50<p>Location: {{ with .Url }}<a href="{{ . }}" rel=noreferrer>{{ end }}{{ .Name }}{{ if .Url }}</a>{{ end }}{{ if or .Latitude .Longitude }} <a href="https://www.openstreetmap.org/?mlat={{ .Latitude }}&mlon={{ .Longitude}}#map=16/{{ .Latitude }}/{{ .Longitude }}" rel=noreferrer>{{ .Latitude }} {{ .Longitude }}</a>{{ end }}
51{{ end }}
52{{ range .Donks }}
53{{ if .Local }}
54{{ if eq .Media "text/plain" }}
55<p><a href="/d/{{ .XID }}">Attachment: {{ .Name }}</a>
56{{ else }}
57<p><img src="/d/{{ .XID }}" title="{{ .Desc }}" alt="{{ .Desc }}">
58{{ end }}
59{{ else }}
60{{ if .XID }}
61<p><a href="{{ .URL }}">External Attachment: {{ .Name }}</a>
62{{ else }}
63{{ if eq .Media "video/mp4" }}
64<p><video controls src="{{ .URL }}">{{ .Name }}</video>
65{{ else }}
66<p><img src="{{ .URL }}" title="{{ .Desc }}" alt="{{ .Desc }}">
67{{ end }}
68{{ end }}
69{{ end }}
70{{ end }}
71</details>
72{{ end }}
73{{ if $bonkcsrf }}
74<p>
75<details class="actions">
76<summary>Actions
77</summary>
78<div>
79<p>
80{{ if .Honk.Public }}
81{{ if .Honk.IsBonked }}
82<button onclick="unbonk(this, '{{ .Honk.XID }}');">unbonk</button>
83{{ else }}
84<button onclick="bonk(this, '{{ .Honk.XID }}');">bonk</button>
85{{ end }}
86{{ else }}
87<button disabled>nope</button>
88{{ end }}
89<button onclick="showhonkform(this, '{{ .Honk.XID }}', '{{ .Honk.Handle }}');">honk back</button>
90<button onclick="muteit(this, '{{ .Honk.Convoy }}');">mute</button>
91<button onclick="zonkit(this, '{{ .Honk.XID }}');">zonk</button>
92{{ if .Honk.IsAcked }}
93<button onclick="deackit(this, '{{ .Honk.XID }}');">deack</button>
94{{ else }}
95<button onclick="ackit(this, '{{ .Honk.XID }}');">ack</button>
96{{ end }}
97<button><a href="/edit?xid={{ .Honk.XID }}">edit</a></button>
98</div>
99</details>
100<p>
101{{ end }}
102</article>