views/honk.html (view raw)
1<article class="honk {{ .Honk.Style }}" data-convoy="{{ .Honk.Convoy }}" data-hname="{{ .Honk.Handles }}" data-xid="{{ .Honk.XID }}" data-id="{{ .Honk.ID }}">
2{{ $bonkcsrf := .BonkCSRF }}
3{{ $IsPreview := .IsPreview }}
4{{ $maplink := .MapLink }}
5{{ $omitimages := .OmitImages }}
6{{ with .Honk }}
7<header>
8{{ if $bonkcsrf }}
9<a class="honkerlink" href="/h?xid={{ .Honker }}" data-xid="{{ .Honker }}">
10{{ else }}
11<a href="{{ .Honker }}" rel=noreferrer>
12{{ end }}
13<img alt="" src="/a?a={{ .Honker}}">
14</a>
15{{ if .Oonker }}
16{{ if $bonkcsrf }}
17<a class="honkerlink" href="/h?xid={{ .Oonker }}" data-xid="{{ .Oonker }}">
18{{ else }}
19<a href="{{ .Oonker }}" rel=noreferrer>
20{{ end }}
21<img alt="" src="/a?a={{ .Oonker}}">
22</a>
23{{ end }}
24<p>
25{{ if $bonkcsrf }}
26<a class="honkerlink" href="/h?xid={{ .Honker }}" data-xid="{{ .Honker }}">{{ .Username }}</a>
27{{ else }}
28<a href="{{ .Honker }}" rel=noreferrer>{{ .Username }}</a>
29{{ end }}
30<span class="clip"><a href="{{ .URL }}" rel=noreferrer>{{ .What }}</a> <span style="float: right;" title='{{ .Date.Local.Format "02 Jan 2006 15:04" }}' id="honkdate">{{ .DatePretty }}</span> </span>
31{{ if .Oonker }}
32<br>
33<span class="left1em clip">
34{{ if $bonkcsrf }}
35original: <a class="honkerlink" href="/h?xid={{ .Oonker }}" data-xid="{{ .Oonker }}">{{ .Oondle }}</a>
36{{ else }}
37original: <a href="{{ .Oonker }}" rel=noreferrer>{{ .Oondle }}</a>
38{{ end }}
39</span>
40{{ else }}
41{{ if .RID }}
42<span style="float:right; margin-right: .3em;" class="clip">
43<a href="{{ .RID }}" rel=noreferrer>parent</a>
44·
45</span>
46{{ end }}
47{{ end }}
48{{ if $bonkcsrf }}
49<span style="float:right; margin-right: .3em;" class="clip"><a class="convoylink" href="/t?c={{ .Convoy }}">convoy</a>
50·
51</span>
52{{ end }}
53</header>
54<p>
55{{ if .HTPrecis }}
56<details class="noise">
57<summary>{{ .HTPrecis }}<p></summary>
58{{ end }}
59<p class="content">{{ .HTML }}
60{{ with .Time }}
61<p>Time: {{ .StartTime.Local.Format "03:04PM EDT Mon Jan 02"}}
62{{ if .Duration }}<br>Duration: {{ .Duration }}{{ end }}
63{{ end }}
64{{ with .Place }}
65<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 }}
66{{ end }}
67{{ range .Donks }}
68{{ if .Local }}
69{{ if eq .Media "text/plain" }}
70<p><a href="/d/{{ .XID }}">Attachment: {{ .Name }}</a>{{ if not (eq .Desc .Name) }} {{ .Desc }}{{ end }}
71{{ else if eq .Media "application/pdf" }}
72<p><a href="/d/{{ .XID }}">Attachment: {{ .Name }}</a>{{ if not (eq .Desc .Name) }} {{ .Desc }}{{ end }}
73{{ else }}
74{{ if $omitimages }}
75<p><a href="/d/{{ .XID }}">Image: {{ .Name }}</a>{{ if not (eq .Desc .Name) }} {{ .Desc }}{{ end }}
76{{ else }}
77<p><img src="/d/{{ .XID }}" title="{{ .Desc }}" alt="{{ .Desc }}">
78{{ end }}
79{{ end }}
80{{ else }}
81{{ if .External }}
82<p><a href="{{ .URL }}" rel=noreferrer>External Attachment: {{ .Name }}</a>{{ if not (eq .Desc .Name) }} {{ .Desc }}{{ end }}
83{{ else }}
84{{ if eq .Media "video/mp4" }}
85<p><video controls src="{{ .URL }}">{{ .Name }}</video>
86{{ else }}
87<p><img src="{{ .URL }}" title="{{ .Desc }}" alt="{{ .Desc }}">
88{{ end }}
89{{ end }}
90{{ end }}
91{{ end }}
92</details>
93{{ end }}
94{{ if and $bonkcsrf (not $IsPreview) }}
95<p>
96<details class="actions">
97<summary>Actions</summary>
98<div>
99<p>
100{{ if .Honk.Public }}
101{{ if .Honk.IsBonked }}
102<button class="unbonk">unbonk</button>
103{{ else }}
104<button class="bonk">bonk</button>
105{{ end }}
106{{ else }}
107<button disabled>nope</button>
108{{ end }}
109<button class="honkback"><a href="/newhonk?rid={{ .Honk.XID }}">reply</a></button>
110<button class="mute">mute</button>
111<button class="evenmore">even more</button>
112</div>
113<div id="evenmore{{ .Honk.ID }}" class="hide">
114<p>
115<button class="zonk">zonk</button>
116{{ if .Honk.IsAcked }}
117<button class="flogit-deack">deack</button>
118{{ else }}
119<button class="flogit-ack" >ack</button>
120{{ end }}
121{{ if .Honk.IsSaved }}
122<button class="flogit-unsave">unsave</button>
123{{ else }}
124<button class="flogit-save">save</button>
125{{ end }}
126{{ if .Honk.IsUntagged }}
127<button disabled>untagged</button>
128{{ else }}
129<button class="flogit-untag">untag me</button>
130{{ end }}
131<button><a href="/edit?xid={{ .Honk.XID }}">edit</a></button>
132{{ if not (eq .Badonk "none") }}
133{{ if .Honk.IsReacted }}
134<button disabled>badonked</button>
135{{ else }}
136<button class="flogit-react" >{{ .Badonk }}</button>
137{{ end }}
138{{ end }}
139</div>
140</details>
141<p>
142{{ end }}
143</article>