all repos — honk @ 31c306a1332b6f1f4b259ce8651aa32677102176

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