all repos — honk @ e18c74cd26ba9bbf5a397e5da7b476b2992dbe8f

my fork of honk

views/honk.html (view raw)

  1<article class="honk {{ .Honk.Style }}" data-convoy="{{ .Honk.Convoy }}">
  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{{ if $bonkcsrf }} </a> {{ end }}
 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{{ if $bonkcsrf }} </a> {{ end }}
 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 style="margin-left: 1em;" class="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 style="margin-left: 1em;" class="clip">
 44in reply to: <a href="{{ .RID }}" rel=noreferrer>{{ .RID }}</a>
 45</span>
 46{{ end }}
 47{{ end }}
 48<br>
 49{{ if $bonkcsrf }}
 50<span style="margin-left: 1em;" class="clip">convoy: <a class="convoylink" href="/t?c={{ .Convoy }}">{{ .Convoy }}</a></span>
 51{{ else }}
 52<span style="margin-left: 1em;" class="clip">convoy: {{ .Convoy }}</span>
 53{{ end }}
 54</header>
 55<p>
 56<details class="noise" {{ .Open }} >
 57<summary>{{ .HTPrecis }}<p></summary>
 58<p>{{ .HTPrecis }}
 59<p>{{ .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 .XID }}
 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
 98</summary>
 99<div>
100<p>
101{{ if .Honk.Public }}
102{{ if .Honk.IsBonked }}
103<button onclick="return unbonk(this, '{{ .Honk.XID }}');">unbonk</button>
104{{ else }}
105<button onclick="return bonk(this, '{{ .Honk.XID }}');">bonk</button>
106{{ end }}
107{{ else }}
108<button disabled>nope</button>
109{{ end }}
110<button onclick="return showhonkform(this, '{{ .Honk.XID }}', '{{ .Honk.Handle }}');"><a href="/newhonk?rid={{ .Honk.XID }}">honk back</a></button>
111<button onclick="return muteit(this, '{{ .Honk.Convoy }}');">mute</button>
112<button onclick="return zonkit(this, '{{ .Honk.XID }}');">zonk</button>
113{{ if .Honk.IsAcked }}
114<button onclick="return flogit(this, 'deack', '{{ .Honk.XID }}');">deack</button>
115{{ else }}
116<button onclick="return flogit(this, 'ack', '{{ .Honk.XID }}');">ack</button>
117{{ end }}
118{{ if .Honk.IsSaved }}
119<button onclick="return flogit(this, 'unsave', '{{ .Honk.XID }}');">unsave</button>
120{{ else }}
121<button onclick="return flogit(this, 'save', '{{ .Honk.XID }}');">save</button>
122{{ end }}
123{{ if .Honk.IsUntagged }}
124<button disabled>untagged</button>
125{{ else }}
126<button onclick="return flogit(this, 'untag', '{{ .Honk.XID }}');">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 onclick="return flogit(this, 'react', '{{ .Honk.XID }}');">{{ .Badonk }}</button>
134{{ end }}
135{{ end }}
136</div>
137</details>
138<p>
139{{ end }}
140</article>