all repos — honk @ c73cedfe49b41428737f428a50241cfc72337a6e

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{{ with .Honk }}
  5<header>
  6{{ if $bonkcsrf }}
  7<a class="honkerlink" href="/h?xid={{ .Honker }}" data-xid="{{ .Honker }}">
  8{{ else }}
  9<a href="{{ .Honker }}" rel=noreferrer>
 10{{ end }}
 11<img alt="" src="/a?a={{ .Honker}}">
 12{{ if $bonkcsrf }} </a> {{ end }}
 13{{ if .Oonker }}
 14{{ if $bonkcsrf }}
 15<a class="honkerlink" href="/h?xid={{ .Oonker }}" data-xid="{{ .Oonker }}">
 16{{ else }}
 17<a href="{{ .Oonker }}" rel=noreferrer>
 18{{ end }}
 19<img alt="" src="/a?a={{ .Oonker}}">
 20{{ if $bonkcsrf }} </a> {{ end }}
 21{{ end }}
 22<p>
 23{{ if $bonkcsrf }}
 24<a class="honkerlink" href="/h?xid={{ .Honker }}" data-xid="{{ .Honker }}">{{ .Username }}</a>
 25{{ else }}
 26<a href="{{ .Honker }}" rel=noreferrer>{{ .Username }}</a>
 27{{ end }}
 28<span class="clip"><a href="{{ .URL }}" rel=noreferrer>{{ .What }}</a> {{ .Date.Local.Format "02 Jan 2006 15:04 -0700" }}</span>
 29{{ if .Oonker }}
 30<br>
 31<span style="margin-left: 1em;" class="clip">
 32{{ if $bonkcsrf }}
 33original: <a class="honkerlink" href="/h?xid={{ .Oonker }}" data-xid="{{ .Oonker }}">{{ .Oondle }}</a>
 34{{ else }}
 35original: <a href="{{ .Oonker }}" rel=noreferrer>{{ .Oondle }}</a>
 36{{ end }}
 37</span>
 38{{ else }}
 39{{ if .RID }}
 40<br>
 41<span style="margin-left: 1em;" class="clip">
 42in reply to: <a href="{{ .RID }}" rel=noreferrer>{{ .RID }}</a>
 43</span>
 44{{ end }}
 45{{ end }}
 46<br>
 47{{ if $bonkcsrf }}
 48<span style="margin-left: 1em;" class="clip">convoy: <a class="convoylink" href="/t?c={{ .Convoy }}">{{ .Convoy }}</a></span>
 49{{ else }}
 50<span style="margin-left: 1em;" class="clip">convoy: {{ .Convoy }}</span>
 51{{ end }}
 52</header>
 53<p>
 54<details class="noise" {{ .Open }} >
 55<summary>{{ .HTPrecis }}<p></summary>
 56<p>{{ .HTPrecis }}
 57<p>{{ .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="https://www.openstreetmap.org/?mlat={{ .Latitude }}&mlon={{ .Longitude}}#map=16/{{ .Latitude }}/{{ .Longitude }}" 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> {{ .Desc }}
 69{{ else if eq .Media "application/pdf" }}
 70<p><a href="/d/{{ .XID }}">Attachment: {{ .Name }}</a> {{ .Desc }}
 71{{ else }}
 72<p><img src="/d/{{ .XID }}" title="{{ .Desc }}" alt="{{ .Desc }}">
 73{{ end }}
 74{{ else }}
 75{{ if .XID }}
 76<p><a href="{{ .URL }}" rel=noreferrer>External Attachment: {{ .Name }}</a>
 77{{ else }}
 78{{ if eq .Media "video/mp4" }}
 79<p><video controls src="{{ .URL }}">{{ .Name }}</video>
 80{{ else }}
 81<p><img src="{{ .URL }}" title="{{ .Desc }}" alt="{{ .Desc }}">
 82{{ end }}
 83{{ end }}
 84{{ end }}
 85{{ end }}
 86</details>
 87{{ end }}
 88{{ if and $bonkcsrf (not $IsPreview) }}
 89<p>
 90<details class="actions">
 91<summary>Actions
 92</summary>
 93<div>
 94<p>
 95{{ if .Honk.Public }}
 96{{ if .Honk.IsBonked }}
 97<button onclick="return unbonk(this, '{{ .Honk.XID }}');">unbonk</button>
 98{{ else }}
 99<button onclick="return bonk(this, '{{ .Honk.XID }}');">bonk</button>
100{{ end }}
101{{ else }}
102<button disabled>nope</button>
103{{ end }}
104<button onclick="return showhonkform(this, '{{ .Honk.XID }}', '{{ .Honk.Handle }}');"><a href="/newhonk?rid={{ .Honk.XID }}">honk back</a></button>
105<button onclick="return muteit(this, '{{ .Honk.Convoy }}');">mute</button>
106<button onclick="return zonkit(this, '{{ .Honk.XID }}');">zonk</button>
107{{ if .Honk.IsAcked }}
108<button onclick="return flogit(this, 'deack', '{{ .Honk.XID }}');">deack</button>
109{{ else }}
110<button onclick="return flogit(this, 'ack', '{{ .Honk.XID }}');">ack</button>
111{{ end }}
112{{ if .Honk.IsSaved }}
113<button onclick="return flogit(this, 'unsave', '{{ .Honk.XID }}');">unsave</button>
114{{ else }}
115<button onclick="return flogit(this, 'save', '{{ .Honk.XID }}');">save</button>
116{{ end }}
117{{ if .Honk.IsUntagged }}
118<button disabled>untagged</button>
119{{ else }}
120<button onclick="return flogit(this, 'untag', '{{ .Honk.XID }}');">untag me</button>
121{{ end }}
122<button><a href="/edit?xid={{ .Honk.XID }}">edit</a></button>
123</div>
124</details>
125<p>
126{{ end }}
127</article>