load external content
Anirudh Oppiliappan x@icyphox.sh
Mon, 12 Aug 2024 20:55:25 +0300
1 files changed,
138 insertions(+),
143 deletions(-)
jump to
M
views/honk.html
→
views/honk.html
@@ -1,146 +1,141 @@
<article id="{{ .Honk.ShortXID }}" class="honk {{ .Honk.Style }}" data-convoy="{{ .Honk.Convoy }}" data-hname="{{ .Honk.Handles }}" data-xid="{{ .Honk.XID }}" data-id="{{ .Honk.ID }}"> -{{ $bonkcsrf := .BonkCSRF }} -{{ $IsPreview := .IsPreview }} -{{ $maplink := .MapLink }} -{{ $omitimages := .OmitImages }} -{{ with .Honk }} -<header> -{{ if $bonkcsrf }} -<a class="honkerlink" href="/h?xid={{ .Honker }}" data-xid="{{ .Honker }}"> -{{ else }} -<a href="{{ .Honker }}" rel=noreferrer> -{{ end }} -<img alt="" src="/a?a={{ .Honker}}"> -</a> -{{ if .Oonker }} -{{ if $bonkcsrf }} -<a class="honkerlink" href="/h?xid={{ .Oonker }}" data-xid="{{ .Oonker }}"> -{{ else }} -<a href="{{ .Oonker }}" rel=noreferrer> -{{ end }} -<img alt="" src="/a?a={{ .Oonker}}"> -</a> -{{ end }} -{{ if $bonkcsrf }} -<a class="honkerlink" href="/h?xid={{ .Honker }}" data-xid="{{ .Honker }}">{{ .Username }}</a> -{{ else }} -<a href="{{ .Honker }}" rel=noreferrer>{{ .Username }}</a> -{{ end }} -<span style="display:inline-block;"><a href="{{ .URL }}" rel=noreferrer>{{ .What }}</a></span> -<ul class="honkmeta"> - <li><span><a class="convoylink" href="/t?c={{ .Convoy }}#{{ .ShortXID }}">convoy</a></span> + {{ $bonkcsrf := .BonkCSRF }} + {{ $IsPreview := .IsPreview }} + {{ $maplink := .MapLink }} + {{ $omitimages := .OmitImages }} + {{ with .Honk }} + <header> + {{ if $bonkcsrf }} + <a class="honkerlink" href="/h?xid={{ .Honker }}" data-xid="{{ .Honker }}"> + {{ else }} + <a href="{{ .Honker }}" rel=noreferrer> + {{ end }} + <img alt="" src="/a?a={{ .Honker}}"> + </a> + {{ if .Oonker }} + {{ if $bonkcsrf }} + <a class="honkerlink" href="/h?xid={{ .Oonker }}" data-xid="{{ .Oonker }}"> + {{ else }} + <a href="{{ .Oonker }}" rel=noreferrer> + {{ end }} + <img alt="" src="/a?a={{ .Oonker}}"> + </a> + {{ end }} + {{ if $bonkcsrf }} + <a class="honkerlink" href="/h?xid={{ .Honker }}" data-xid="{{ .Honker }}">{{ .Username }}</a> + {{ else }} + <a href="{{ .Honker }}" rel=noreferrer>{{ .Username }}</a> + {{ end }} + <span style="display:inline-block;"><a href="{{ .URL }}" rel=noreferrer>{{ .What }}</a></span> + <ul class="honkmeta"> + <li><span><a class="convoylink" href="/t?c={{ .Convoy }}#{{ .ShortXID }}">convoy</a></span> -{{ if .Oonker }} - <li><span> -{{ if $bonkcsrf }} -<a class="honkerlink" href="/h?xid={{ .Oonker }}" data-xid="{{ .Oonker }}">original</a> -{{ else }} -<a href="{{ .Oonker }}" rel=noreferrer>original</a> -{{ end }} - </span></li> -{{ else }} -{{ if .RID }} - <li><span><a href="{{ .RID }}" rel=noreferrer>parent</a></span> -{{ end }} -{{ end }} -{{ if $bonkcsrf }} -<li><span title='{{ .Date.Local.Format "02 Jan 2006 15:04" }}' id="honkdate">{{ .DatePretty }}</span> -</ul> -{{ end }} -</header> -<p> -<details class="noise" {{ with .Open }}{{.}}{{end}}> -<summary class="noise">{{ .HTPrecis }}<p></summary> -<p>{{ .HTPrecis }} -<p class="content">{{ .HTML }} -{{ if .Link }} -<p><a href="{{ .Link }}">{{ or .LegalName .Link }}</a> -{{ end }} -{{ with .Time }} -<p>Time: {{ .StartTime.Local.Format "03:04PM MST Mon Jan 02"}} -{{ if .Duration }}<br>Duration: {{ .Duration }}{{ end }}</p> -{{ end }} -{{ with .Place }} -<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 }} -{{ end }} -{{ range .Donks }} -{{ if .Local }} -{{ if eq .Media "text/plain" }} -<p><a href="/d/{{ .XID }}">Attachment: {{ .Name }}</a>{{ if not (eq .Desc .Name) }} {{ .Desc }}{{ end }} ({{ .Meta.Length }})</p> -{{ else if eq .Media "application/pdf" }} -<p><a href="/d/{{ .XID }}">Attachment: {{ .Name }}</a>{{ if not (eq .Desc .Name) }} {{ .Desc }}{{ end }} ({{ .Meta.Length }})</p> -{{ else }} -{{ if $omitimages }} -<p><a href="/d/{{ .XID }}">Image: {{ .Name }}</a>{{ if not (eq .Desc .Name) }} {{ .Desc }}{{ end }} ({{.Meta.Width}}x{{.Meta.Height}} {{ .Meta.Length }})</p> -{{ else }} -<img class="donk donklink" src="/d/{{ .XID }}" loading=lazy title="{{ .Desc }}" alt="{{ .Desc }}" width="{{.Meta.Width}}" height="{{.Meta.Height}}"> -{{ end }} -{{ end }} -{{ else }} -{{ if .External }} -<p><a href="{{ .URL }}" rel=noreferrer>External Attachment: {{ .Name }}</a>{{ if not (eq .Desc .Name) }} {{ .Desc }}{{ end }}</p> -{{ else }} -{{ if eq .Media "video/mp4" }} -<p><video controls src="{{ .URL }}">{{ .Name }}</video></p> -{{ else }} -<p><img src="{{ .URL }}" title="{{ .Desc }}" alt="{{ .Desc }}"></p> -{{ end }} -{{ end }} -{{ end }} -{{ end }} -</details> -{{ end }} -{{ if and $bonkcsrf (not $IsPreview) }} -<p> -<details class="actions"> -<summary>actions</summary> -<div> -<p> -{{ if .Honk.Public }} -{{ if .Honk.IsBonked }} -<button class="unbonk">unbonk</button> -{{ else }} -<button class="bonk">bonk</button> -{{ end }} -{{ else }} -<button disabled>nope</button> -{{ end }} -<button class="honkback"><a href="/newhonk?rid={{ .Honk.XID }}">reply</a></button> -<button class="mute">mute</button> -<button class="evenmore">even more</button> -</div> -<div id="evenmore{{ .Honk.ID }}" class="hide"> -<p> -<button class="zonk">zonk</button> -{{ if .Honk.IsAcked }} -<button class="flogit-deack">deack</button> -{{ else }} -<button class="flogit-ack" >ack</button> -{{ end }} -{{ if .Honk.IsSaved }} -<button class="flogit-unsave">unsave</button> -{{ else }} -<button class="flogit-save">save</button> -{{ end }} -{{ if .Honk.IsUntagged }} -<button disabled>untagged</button> -{{ else }} -<button class="flogit-untag">untag me</button> -{{ end }} -{{ if eq .Honk.Honker .UserURL }} -<button><a href="/edit?xid={{ .Honk.XID }}">edit</a></button> -{{ else }} -<button disabled>nope</button> -{{ end }} -{{ if not (eq .Badonk "none") }} -{{ if .Honk.IsReacted }} -<button disabled>badonked</button> -{{ else }} -<button class="flogit-react" >{{ .Badonk }}</button> -{{ end }} -{{ end }} -</div> -</details> -<p> -{{ end }} + {{ if .Oonker }} + <li><span> + {{ if $bonkcsrf }} + <a class="honkerlink" href="/h?xid={{ .Oonker }}" data-xid="{{ .Oonker }}">original</a> + {{ else }} + <a href="{{ .Oonker }}" rel=noreferrer>original</a> + {{ end }} + </span></li> + {{ else }} + {{ if .RID }} + <li><span><a href="{{ .RID }}" rel=noreferrer>parent</a></span> + {{ end }} + {{ end }} + {{ if $bonkcsrf }} + <li><span title='{{ .Date.Local.Format "02 Jan 2006 15:04" }}' id="honkdate">{{ .DatePretty }}</span> + </ul> + {{ end }} + </header> + <p> + <details class="noise" {{ with .Open }}{{.}}{{end}}> + <summary class="noise">{{ .HTPrecis }}<p></summary> + <p>{{ .HTPrecis }} + <p class="content">{{ .HTML }} + {{ if .Link }} + <p><a href="{{ .Link }}">{{ or .LegalName .Link }}</a> + {{ end }} + {{ with .Time }} + <p>Time: {{ .StartTime.Local.Format "03:04PM MST Mon Jan 02"}} + {{ if .Duration }}<br>Duration: {{ .Duration }}{{ end }}</p> + {{ end }} + {{ with .Place }} + <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 }} + {{ end }} + {{ range .Donks }} + {{ if eq .Media "text/plain" }} + <p><a href="/d/{{ .XID }}">Attachment: {{ .Name }}</a>{{ if not (eq .Desc .Name) }} {{ .Desc }}{{ end }} ({{ .Meta.Length }})</p> + {{ else if eq .Media "application/pdf" }} + <p><a href="/d/{{ .XID }}">Attachment: {{ .Name }}</a>{{ if not (eq .Desc .Name) }} {{ .Desc }}{{ end }} ({{ .Meta.Length }})</p> + {{ else }} + {{ if $omitimages }} + <p><a href="/d/{{ .XID }}">Image: {{ .Name }}</a>{{ if not (eq .Desc .Name) }} {{ .Desc }}{{ end }} ({{.Meta.Width}}x{{.Meta.Height}} {{ .Meta.Length }})</p> + {{ else }} + {{ if .Local }} + <img class="donk donklink" src="/d/{{ .XID }}" loading=lazy title="{{ .Desc }}" alt="{{ .Desc }}" width="{{.Meta.Width}}" height="{{.Meta.Height}}"> + {{ else if .External }} + <p><img src="{{ .URL }}" title="{{ .Desc }}" alt="{{ .Desc }}"></p> + {{ end }} + {{ end }} + {{ end }} + {{ if eq .Media "video/mp4" }} + <p><video controls src="{{ .URL }}">{{ .Name }}</video></p> + {{ end }} + {{ end }} + </details> + {{ end }} + {{ if and $bonkcsrf (not $IsPreview) }} + <p> + <details class="actions"> + <summary>actions</summary> + <div> + <p> + {{ if .Honk.Public }} + {{ if .Honk.IsBonked }} + <button class="unbonk">unbonk</button> + {{ else }} + <button class="bonk">bonk</button> + {{ end }} + {{ else }} + <button disabled>nope</button> + {{ end }} + <button class="honkback"><a href="/newhonk?rid={{ .Honk.XID }}">reply</a></button> + <button class="mute">mute</button> + <button class="evenmore">even more</button> + </div> + <div id="evenmore{{ .Honk.ID }}" class="hide"> + <p> + <button class="zonk">zonk</button> + {{ if .Honk.IsAcked }} + <button class="flogit-deack">deack</button> + {{ else }} + <button class="flogit-ack" >ack</button> + {{ end }} + {{ if .Honk.IsSaved }} + <button class="flogit-unsave">unsave</button> + {{ else }} + <button class="flogit-save">save</button> + {{ end }} + {{ if .Honk.IsUntagged }} + <button disabled>untagged</button> + {{ else }} + <button class="flogit-untag">untag me</button> + {{ end }} + {{ if eq .Honk.Honker .UserURL }} + <button><a href="/edit?xid={{ .Honk.XID }}">edit</a></button> + {{ else }} + <button disabled>nope</button> + {{ end }} + {{ if not (eq .Badonk "none") }} + {{ if .Honk.IsReacted }} + <button disabled>badonked</button> + {{ else }} + <button class="flogit-react" >{{ .Badonk }}</button> + {{ end }} + {{ end }} + </div> + </details> + <p> + {{ end }} </article>