all repos — honk @ 75d50653d5d11dce7a63f350e50ac937396ae18b

my fork of honk

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> {{ .Date.Local.Format "02 Jan 2006 15:04 -0700" }}</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<br>
 43<span class="left1em clip">
 44in reply to: <a href="{{ .RID }}" rel=noreferrer>{{ .RID }}</a>
 45</span>
 46{{ end }}
 47{{ end }}
 48<br>
 49{{ if $bonkcsrf }}
 50<span class="left1em clip">convoy: <a class="convoylink" href="/t?c={{ .Convoy }}">{{ .Convoy }}</a></span>
 51{{ end }}
 52</header>
 53<p>
 54<details class="noise" {{ .Open }} >
 55<summary class="noise">{{ .HTPrecis }}<p></summary>
 56<p>{{ .HTPrecis }}
 57<p class="content">{{ .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="{{ 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 }}
 64{{ end }}
 65{{ range .Donks }}
 66{{ if .Local }}
 67{{ if eq .Media "text/plain" }}
 68<p><a href="/d/{{ .XID }}">Attachment: {{ .Name }}</a>{{ if not (eq .Desc .Name) }} {{ .Desc }}{{ end }}
 69{{ else if eq .Media "application/pdf" }}
 70<p><a href="/d/{{ .XID }}">Attachment: {{ .Name }}</a>{{ if not (eq .Desc .Name) }} {{ .Desc }}{{ end }}
 71{{ else }}
 72{{ if $omitimages }}
 73<p><a href="/d/{{ .XID }}">Image: {{ .Name }}</a>{{ if not (eq .Desc .Name) }} {{ .Desc }}{{ end }}
 74{{ else }}
 75<p><img src="/d/{{ .XID }}" loading=lazy title="{{ .Desc }}" alt="{{ .Desc }}">
 76{{ end }}
 77{{ end }}
 78{{ else }}
 79{{ if .External }}
 80<p><a href="{{ .URL }}" rel=noreferrer>External Attachment: {{ .Name }}</a>{{ if not (eq .Desc .Name) }} {{ .Desc }}{{ end }}
 81{{ else }}
 82{{ if eq .Media "video/mp4" }}
 83<p><video controls src="{{ .URL }}">{{ .Name }}</video>
 84{{ else }}
 85<p><img src="{{ .URL }}" title="{{ .Desc }}" alt="{{ .Desc }}">
 86{{ end }}
 87{{ end }}
 88{{ end }}
 89{{ end }}
 90</details>
 91{{ end }}
 92{{ if and $bonkcsrf (not $IsPreview) }}
 93<p>
 94<details class="actions">
 95<summary>Actions</summary>
 96<div>
 97<p>
 98{{ if .Honk.Public }}
 99{{ if .Honk.IsBonked }}
100<button class="unbonk">unbonk</button>
101{{ else }}
102<button class="bonk">bonk</button>
103{{ end }}
104{{ else }}
105<button disabled>nope</button>
106{{ end }}
107<button class="honkback"><a href="/newhonk?rid={{ .Honk.XID }}">honk back</a></button>
108<button class="mute">mute</button>
109<button class="evenmore">even more</button>
110</div>
111<div id="evenmore{{ .Honk.ID }}" class="hide">
112<p>
113<button class="zonk">zonk</button>
114{{ if .Honk.IsAcked }}
115<button class="flogit-deack">deack</button>
116{{ else }}
117<button class="flogit-ack" >ack</button>
118{{ end }}
119{{ if .Honk.IsSaved }}
120<button class="flogit-unsave">unsave</button>
121{{ else }}
122<button class="flogit-save">save</button>
123{{ end }}
124{{ if .Honk.IsUntagged }}
125<button disabled>untagged</button>
126{{ else }}
127<button class="flogit-untag">untag me</button>
128{{ end }}
129<button><a href="/edit?xid={{ .Honk.XID }}">edit</a></button>
130{{ if not (eq .Badonk "none") }}
131{{ if .Honk.IsReacted }}
132<button disabled>badonked</button>
133{{ else }}
134<button class="flogit-react" >{{ .Badonk }}</button>
135{{ end }}
136{{ end }}
137</div>
138</details>
139<p>
140{{ end }}
141</article>