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