all repos — honk @ 181a2352b21afa2e40190a05ab8c260d8eb498dc

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" {{ with .Open }}{{.}}{{end}}>
 55<summary class="noise">{{ .HTPrecis }}<p></summary>
 56<p>{{ .HTPrecis }}
 57<p class="content">{{ .HTML }}
 58{{ if .Link }}
 59<p><a href="{{ .Link }}">{{ or .LegalName .Link }}</a>
 60{{ end }}
 61{{ with .Time }}
 62<p>Time: {{ .StartTime.Local.Format "03:04PM MST Mon Jan 02"}}
 63{{ if .Duration }}<br>Duration: {{ .Duration }}{{ end }}</p>
 64{{ end }}
 65{{ with .Place }}
 66<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></p>{{ end }}
 67{{ end }}
 68{{ range .Donks }}
 69{{ if .Local }}
 70{{ if eq .Media "text/plain" }}
 71<p><a href="/d/{{ .XID }}">Attachment: {{ .Name }}</a>{{ if not (eq .Desc .Name) }} {{ .Desc }}{{ end }}</p>
 72{{ else if eq .Media "application/pdf" }}
 73<p><a href="/d/{{ .XID }}">Attachment: {{ .Name }}</a>{{ if not (eq .Desc .Name) }} {{ .Desc }}{{ end }}</p>
 74{{ else }}
 75{{ if $omitimages }}
 76<p><a href="/d/{{ .XID }}">Image: {{ .Name }}</a>{{ if not (eq .Desc .Name) }} {{ .Desc }}{{ end }}</p>
 77{{ else }}
 78<img class="donk donklink" src="/d/{{ .XID }}" loading=lazy title="{{ .Desc }}" alt="{{ .Desc }}">
 79{{ end }}
 80{{ end }}
 81{{ else }}
 82{{ if .External }}
 83<p><a href="{{ .URL }}" rel=noreferrer>External Attachment: {{ .Name }}</a>{{ if not (eq .Desc .Name) }} {{ .Desc }}{{ end }}</p>
 84{{ else }}
 85{{ if eq .Media "video/mp4" }}
 86<p><video controls src="{{ .URL }}">{{ .Name }}</video></p>
 87{{ else }}
 88<p><img src="{{ .URL }}" title="{{ .Desc }}" alt="{{ .Desc }}"></p>
 89{{ end }}
 90{{ end }}
 91{{ end }}
 92{{ end }}
 93</details>
 94{{ end }}
 95{{ if and $bonkcsrf (not $IsPreview) }}
 96<p>
 97<details class="actions">
 98<summary>Actions</summary>
 99<div>
100<p>
101{{ if .Honk.Public }}
102{{ if .Honk.IsBonked }}
103<button class="unbonk">unbonk</button>
104{{ else }}
105<button class="bonk">bonk</button>
106{{ end }}
107{{ else }}
108<button disabled>nope</button>
109{{ end }}
110<button class="honkback"><a href="/newhonk?rid={{ .Honk.XID }}">honk back</a></button>
111<button class="mute">mute</button>
112<button class="evenmore">even more</button>
113</div>
114<div id="evenmore{{ .Honk.ID }}" class="hide">
115<p>
116<button class="zonk">zonk</button>
117{{ if .Honk.IsAcked }}
118<button class="flogit-deack">deack</button>
119{{ else }}
120<button class="flogit-ack" >ack</button>
121{{ end }}
122{{ if .Honk.IsSaved }}
123<button class="flogit-unsave">unsave</button>
124{{ else }}
125<button class="flogit-save">save</button>
126{{ end }}
127{{ if .Honk.IsUntagged }}
128<button disabled>untagged</button>
129{{ else }}
130<button class="flogit-untag">untag me</button>
131{{ end }}
132{{ if eq .Honk.Honker .UserURL }}
133<button><a href="/edit?xid={{ .Honk.XID }}">edit</a></button>
134{{ else }}
135<button disabled>nope</button>
136{{ end }}
137{{ if not (eq .Badonk "none") }}
138{{ if .Honk.IsReacted }}
139<button disabled>badonked</button>
140{{ else }}
141<button class="flogit-react" >{{ .Badonk }}</button>
142{{ end }}
143{{ end }}
144</div>
145</details>
146<p>
147{{ end }}
148</article>