views/honk.html (view raw)
1<article class="honk {{ .Honk.Style }}" data-convoy="{{ .Honk.Convoy }}">
2{{ $bonkcsrf := .BonkCSRF }}
3{{ $IsPreview := .IsPreview }}
4{{ with .Honk }}
5<header>
6{{ if $bonkcsrf }}
7<a class="honkerlink" href="/h?xid={{ .Honker }}" data-xid="{{ .Honker }}">
8{{ else }}
9<a href="{{ .Honker }}" rel=noreferrer>
10{{ end }}
11<img alt="" src="/a?a={{ .Honker}}">
12{{ if $bonkcsrf }} </a> {{ end }}
13{{ if .Oonker }}
14{{ if $bonkcsrf }}
15<a class="honkerlink" href="/h?xid={{ .Oonker }}" data-xid="{{ .Oonker }}">
16{{ else }}
17<a href="{{ .Oonker }}" rel=noreferrer>
18{{ end }}
19<img alt="" src="/a?a={{ .Oonker}}">
20{{ if $bonkcsrf }} </a> {{ end }}
21{{ end }}
22<p>
23{{ if $bonkcsrf }}
24<a class="honkerlink" href="/h?xid={{ .Honker }}" data-xid="{{ .Honker }}">{{ .Username }}</a>
25{{ else }}
26<a href="{{ .Honker }}" rel=noreferrer>{{ .Username }}</a>
27{{ end }}
28<span class="clip"><a href="{{ .URL }}" rel=noreferrer>{{ .What }}</a> {{ .Date.Format "02 Jan 2006 15:04" }}</span>
29{{ if .Oonker }}
30<br>
31<span style="margin-left: 1em;" class="clip">
32{{ if $bonkcsrf }}
33original: <a class="honkerlink" href="/h?xid={{ .Oonker }}" data-xid="{{ .Oonker }}">{{ .Oondle }}</a>
34{{ else }}
35original: <a href="{{ .Oonker }}" rel=noreferrer>{{ .Oondle }}</a>
36{{ end }}
37</span>
38{{ else }}
39{{ if .RID }}
40<br>
41<span style="margin-left: 1em;" class="clip">
42in reply to: <a href="{{ .RID }}" rel=noreferrer>{{ .RID }}</a>
43</span>
44{{ end }}
45{{ end }}
46<br>
47{{ if $bonkcsrf }}
48<span style="margin-left: 1em;" class="clip">convoy: <a class="convoylink" href="/t?c={{ .Convoy }}">{{ .Convoy }}</a></span>
49{{ else }}
50<span style="margin-left: 1em;" class="clip">convoy: {{ .Convoy }}</span>
51{{ end }}
52</header>
53<p>
54<details class="noise" {{ .Open }} >
55<summary>{{ .HTPrecis }}<p></summary>
56<p>{{ .HTPrecis }}
57<p>{{ .HTML }}
58{{ with .Time }}
59<p>Time: {{ .StartTime.Local.Format "03:04PM EDT Mon Jan 02"}}
60{{ if .Duration }}<br>Duration: {{ .Duration }}{{ end }}
61{{ end }}
62{{ with .Place }}
63<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 }}
64{{ end }}
65{{ range .Donks }}
66{{ if .Local }}
67{{ if eq .Media "text/plain" }}
68<p><a href="/d/{{ .XID }}">Attachment: {{ .Name }}</a>
69{{ else }}
70<p><img src="/d/{{ .XID }}" title="{{ .Desc }}" alt="{{ .Desc }}">
71{{ end }}
72{{ else }}
73{{ if .XID }}
74<p><a href="{{ .URL }}" rel=noreferrer>External Attachment: {{ .Name }}</a>
75{{ else }}
76{{ if eq .Media "video/mp4" }}
77<p><video controls src="{{ .URL }}">{{ .Name }}</video>
78{{ else }}
79<p><img src="{{ .URL }}" title="{{ .Desc }}" alt="{{ .Desc }}">
80{{ end }}
81{{ end }}
82{{ end }}
83{{ end }}
84</details>
85{{ end }}
86{{ if and $bonkcsrf (not $IsPreview) }}
87<p>
88<details class="actions">
89<summary>Actions
90</summary>
91<div>
92<p>
93{{ if .Honk.Public }}
94{{ if .Honk.IsBonked }}
95<button onclick="return unbonk(this, '{{ .Honk.XID }}');">unbonk</button>
96{{ else }}
97<button onclick="return bonk(this, '{{ .Honk.XID }}');">bonk</button>
98{{ end }}
99{{ else }}
100<button disabled>nope</button>
101{{ end }}
102<button onclick="return showhonkform(this, '{{ .Honk.XID }}', '{{ .Honk.Handle }}');"><a href="/newhonk?rid={{ .Honk.XID }}">honk back</a></button>
103<button onclick="return muteit(this, '{{ .Honk.Convoy }}');">mute</button>
104<button onclick="return zonkit(this, '{{ .Honk.XID }}');">zonk</button>
105{{ if .Honk.IsAcked }}
106<button onclick="return flogit(this, 'deack', '{{ .Honk.XID }}');">deack</button>
107{{ else }}
108<button onclick="return flogit(this, 'ack', '{{ .Honk.XID }}');">ack</button>
109{{ end }}
110{{ if .Honk.IsSaved }}
111<button onclick="return flogit(this, 'unsave', '{{ .Honk.XID }}');">unsave</button>
112{{ else }}
113<button onclick="return flogit(this, 'save', '{{ .Honk.XID }}');">save</button>
114{{ end }}
115<button onclick="return flogit(this, 'desub', '{{ .Honk.XID }}');">desub</button>
116<button><a href="/edit?xid={{ .Honk.XID }}">edit</a></button>
117</div>
118</details>
119<p>
120{{ end }}
121</article>