honk/views/honk.html

142 lines
4.9 KiB
HTML
Raw Permalink Normal View History

<article class="honk {{ .Honk.Style }}" data-convoy="{{ .Honk.Convoy }}">
2019-06-20 21:15:50 +02:00
{{ $bonkcsrf := .BonkCSRF }}
{{ $IsPreview := .IsPreview }}
{{ $maplink := .MapLink }}
2020-05-08 22:15:06 +02:00
{{ $omitimages := .OmitImages }}
2019-04-09 13:59:33 +02:00
{{ with .Honk }}
2019-04-29 01:16:24 +02:00
<header>
2019-10-07 02:42:53 +02:00
{{ if $bonkcsrf }}
<a class="honkerlink" href="/h?xid={{ .Honker }}" data-xid="{{ .Honker }}">
{{ else }}
<a href="{{ .Honker }}" rel=noreferrer>
{{ end }}
2019-09-09 20:09:50 +02:00
<img alt="" src="/a?a={{ .Honker}}">
2019-10-07 02:42:53 +02:00
{{ if $bonkcsrf }} </a> {{ end }}
2019-07-02 04:12:44 +02:00
{{ if .Oonker }}
2019-10-07 02:42:53 +02:00
{{ if $bonkcsrf }}
<a class="honkerlink" href="/h?xid={{ .Oonker }}" data-xid="{{ .Oonker }}">
{{ else }}
<a href="{{ .Oonker }}" rel=noreferrer>
{{ end }}
2019-09-09 20:09:50 +02:00
<img alt="" src="/a?a={{ .Oonker}}">
2019-10-07 02:42:53 +02:00
{{ if $bonkcsrf }} </a> {{ end }}
2019-07-02 04:12:44 +02:00
{{ end }}
<p>
{{ if $bonkcsrf }}
<a class="honkerlink" href="/h?xid={{ .Honker }}" data-xid="{{ .Honker }}">{{ .Username }}</a>
{{ else }}
<a href="{{ .Honker }}" rel=noreferrer>{{ .Username }}</a>
{{ end }}
<span class="clip"><a href="{{ .URL }}" rel=noreferrer>{{ .What }}</a> {{ .Date.Local.Format "02 Jan 2006 15:04 -0700" }}</span>
{{ if .Oonker }}
<br>
2019-06-03 05:57:36 +02:00
<span style="margin-left: 1em;" class="clip">
2019-07-10 05:41:13 +02:00
{{ if $bonkcsrf }}
2019-10-07 02:42:53 +02:00
original: <a class="honkerlink" href="/h?xid={{ .Oonker }}" data-xid="{{ .Oonker }}">{{ .Oondle }}</a>
2019-07-10 05:41:13 +02:00
{{ else }}
original: <a href="{{ .Oonker }}" rel=noreferrer>{{ .Oondle }}</a>
{{ end }}
</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 }}
2019-09-16 21:15:32 +02:00
<span style="margin-left: 1em;" class="clip">convoy: <a class="convoylink" href="/t?c={{ .Convoy }}">{{ .Convoy }}</a></span>
2019-06-20 21:15:50 +02:00
{{ end }}
2019-04-29 01:16:24 +02:00
</header>
2019-07-10 20:36:14 +02:00
<p>
<details class="noise" {{ .Open }} >
2019-10-01 04:28:53 +02:00
<summary>{{ .HTPrecis }}<p></summary>
2019-09-18 21:08:50 +02:00
<p>{{ .HTPrecis }}
<p>{{ .HTML }}
{{ with .Time }}
2019-10-03 03:04:44 +02:00
<p>Time: {{ .StartTime.Local.Format "03:04PM EDT Mon Jan 02"}}
2019-10-03 06:11:02 +02:00
{{ if .Duration }}<br>Duration: {{ .Duration }}{{ end }}
{{ end }}
2019-09-28 06:12:50 +02:00
{{ 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>{{ end }}
2019-09-28 06:12:50 +02:00
{{ end }}
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>{{ if not (eq .Desc .Name) }} {{ .Desc }}{{ end }}
{{ else if eq .Media "application/pdf" }}
<p><a href="/d/{{ .XID }}">Attachment: {{ .Name }}</a>{{ if not (eq .Desc .Name) }} {{ .Desc }}{{ end }}
2019-04-15 16:04:41 +02:00
{{ else }}
2020-05-08 22:15:06 +02:00
{{ if $omitimages }}
<p><a href="/d/{{ .XID }}">Image: {{ .Name }}</a>{{ if not (eq .Desc .Name) }} {{ .Desc }}{{ end }}
{{ else }}
<p><img src="/d/{{ .XID }}" title="{{ .Desc }}" alt="{{ .Desc }}">
2019-04-09 13:59:33 +02:00
{{ end }}
2020-05-08 22:15:06 +02:00
{{ end }}
{{ else }}
{{ if .External }}
<p><a href="{{ .URL }}" rel=noreferrer>External Attachment: {{ .Name }}</a>{{ if not (eq .Desc .Name) }} {{ .Desc }}{{ end }}
2019-05-31 06:24:18 +02:00
{{ else }}
{{ if eq .Media "video/mp4" }}
<p><video controls src="{{ .URL }}">{{ .Name }}</video>
2019-05-31 06:24:18 +02:00
{{ else }}
<p><img src="{{ .URL }}" title="{{ .Desc }}" alt="{{ .Desc }}">
2019-05-31 06:24:18 +02:00
{{ end }}
{{ end }}
{{ end }}
2019-04-09 13:59:33 +02:00
{{ end }}
2019-07-10 20:36:14 +02:00
</details>
2019-04-15 16:04:41 +02:00
{{ end }}
{{ if and $bonkcsrf (not $IsPreview) }}
2019-04-09 13:59:33 +02:00
<p>
2019-07-10 20:36:14 +02:00
<details class="actions">
2020-05-08 22:26:12 +02:00
<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-08-24 02:43:30 +02:00
{{ if .Honk.IsBonked }}
<button onclick="return unbonk(this, '{{ .Honk.XID }}');">unbonk</button>
2019-08-24 02:43:30 +02:00
{{ else }}
<button onclick="return bonk(this, '{{ .Honk.XID }}');">bonk</button>
2019-08-24 02:43:30 +02:00
{{ end }}
{{ else }}
<button disabled>nope</button>
{{ end }}
2020-08-05 21:33:27 +02:00
<button onclick="return showhonkform(this, '{{ .Honk.XID }}', '{{ .Honk.Handles }}');"><a href="/newhonk?rid={{ .Honk.XID }}">honk back</a></button>
<button onclick="return muteit(this, '{{ .Honk.Convoy }}');">mute</button>
2020-05-08 22:26:12 +02:00
<button onclick="return showelement('evenmore{{ .Honk.ID }}')">even more</button>
</div>
<div id="evenmore{{ .Honk.ID }}" style="display:none">
<p>
<button onclick="return zonkit(this, '{{ .Honk.XID }}');">zonk</button>
2019-08-19 06:01:00 +02:00
{{ if .Honk.IsAcked }}
<button onclick="return flogit(this, 'deack', '{{ .Honk.XID }}');">deack</button>
2019-08-19 06:01:00 +02:00
{{ else }}
<button onclick="return flogit(this, 'ack', '{{ .Honk.XID }}');">ack</button>
2019-10-11 22:03:17 +02:00
{{ end }}
{{ if .Honk.IsSaved }}
<button onclick="return flogit(this, 'unsave', '{{ .Honk.XID }}');">unsave</button>
2019-10-11 22:03:17 +02:00
{{ else }}
<button onclick="return flogit(this, 'save', '{{ .Honk.XID }}');">save</button>
2019-08-19 06:01:00 +02:00
{{ end }}
{{ if .Honk.IsUntagged }}
<button disabled>untagged</button>
{{ else }}
2019-10-31 08:21:46 +01:00
<button onclick="return flogit(this, 'untag', '{{ .Honk.XID }}');">untag me</button>
{{ end }}
2019-09-17 00:00:13 +02:00
<button><a href="/edit?xid={{ .Honk.XID }}">edit</a></button>
{{ if not (eq .Badonk "none") }}
2020-01-24 00:08:15 +01:00
{{ if .Honk.IsReacted }}
2020-02-07 18:01:30 +01:00
<button disabled>badonked</button>
2020-01-24 00:08:15 +01:00
{{ else }}
<button onclick="return flogit(this, 'react', '{{ .Honk.XID }}');">{{ .Badonk }}</button>
{{ end }}
2020-02-07 17:57:00 +01:00
{{ end }}
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>