honk/views/honk.html

79 lines
2.1 KiB
HTML
Raw Normal View History

<article class="honk {{ .Honk.What }} {{ and (not .Honk.Public) "limited" }}" data-convoy="{{ .Honk.Convoy }}">
2019-06-20 21:15:50 +02:00
{{ $bonkcsrf := .BonkCSRF }}
2019-04-09 13:59:33 +02:00
{{ with .Honk }}
2019-04-29 01:16:24 +02:00
<header>
2019-04-16 23:11:04 +02:00
<img alt="avatar" src="/a?a={{ .Honker}}">
2019-07-02 04:12:44 +02:00
{{ if .Oonker }}
<img alt="avatar" src="/a?a={{ .Oonker}}">
{{ end }}
<p>
{{ if $bonkcsrf }}
<a href="/h?xid={{ .Honker }}" rel=noreferrer>{{ .Username }}</a>
{{ else }}
<a href="{{ .Honker }}" rel=noreferrer>{{ .Username }}</a>
{{ end }}
<span class="clip"><a href="{{ .URL }}" rel=noreferrer>{{ .What }}</a> {{ .Date.Format "02 Jan 2006 15:04" }}</span>
{{ if .Oonker }}
<br>
2019-06-03 05:57:36 +02:00
<span style="margin-left: 1em;" class="clip">
2019-07-05 19:07:59 +02:00
original: {{ .Oondle }}
</span>
{{ else }}
2019-04-16 23:11:04 +02:00
{{ if .RID }}
<br>
2019-06-03 05:57:36 +02:00
<span style="margin-left: 1em;" class="clip">
2019-04-16 23:11:04 +02:00
in reply to: <a href="{{ .RID }}" rel=noreferrer>{{ .RID }}</a>
</span>
{{ end }}
{{ end }}
<br>
2019-06-20 21:15:50 +02:00
{{ if $bonkcsrf }}
<span style="margin-left: 1em;" class="clip">convoy: <a href="/t?c={{ .Convoy }}">{{ .Convoy }}</a></span>
{{ else }}
<span style="margin-left: 1em;" class="clip">convoy: {{ .Convoy }}</span>
{{ end }}
2019-04-29 01:16:24 +02:00
</header>
<div class="noise">
<p>{{ .HTML }}
2019-04-09 13:59:33 +02:00
{{ range .Donks }}
{{ if .Local }}
2019-04-15 16:04:41 +02:00
{{ if eq .Media "text/plain" }}
<p><a href="/d/{{ .XID }}">Attachment: {{ .Name }}</a>
{{ else }}
2019-04-09 13:59:33 +02:00
<p><a href="/d/{{ .XID }}"><img src="/d/{{ .XID }}" title="{{ .URL }}"></a>
{{ end }}
{{ else }}
2019-05-31 06:24:18 +02:00
{{ if .XID }}
<p><a href="{{ .URL }}">External Attachment: {{ .Name }}</a>
2019-05-31 06:24:18 +02:00
{{ else }}
{{ if eq .Media "video/mp4" }}
<p><a href="{{ .URL }}"><video controls src="{{ .URL }}">{{ .Name }}</video></a>
{{ else }}
<p><a href="{{ .URL }}"><img src="{{ .URL }}" title="{{ .Name }}"></a>
{{ end }}
{{ end }}
{{ end }}
2019-04-09 13:59:33 +02:00
{{ end }}
</div>
2019-04-15 16:04:41 +02:00
{{ end }}
2019-06-20 21:15:50 +02:00
{{ if $bonkcsrf }}
2019-04-09 13:59:33 +02:00
<p>
<details>
<summary>Actions
</summary>
2019-04-26 15:07:13 +02:00
<div>
2019-06-02 21:33:01 +02:00
<p>
{{ if .Honk.Public }}
2019-06-16 00:46:00 +02:00
<button onclick="bonk(this, '{{ .Honk.XID }}');">bonk</button>
{{ else }}
<button disabled>nope</button>
{{ end }}
<button onclick="showhonkform(this, '{{ .Honk.XID }}', '{{ .Honk.Handle }}');">tonk</button>
2019-06-16 00:46:00 +02:00
<button onclick="muteit(this, '{{ .Honk.Convoy }}');">mute</button>
<button onclick="zonkit(this, '{{ .Honk.XID }}');">zonk</button>
2019-04-26 15:07:13 +02:00
</div>
</details>
2019-04-26 15:07:13 +02:00
<p>
2019-04-09 13:59:33 +02:00
{{ end }}
2019-04-29 01:16:24 +02:00
</article>