all repos — honk @ b81e0b79ea9edc40a3c42b53e2daa91084ff54b1

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