all repos — honk @ master

my fork of honk

views/honk.html (view raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
<article class="honk {{ .Honk.Style }}" data-convoy="{{ .Honk.Convoy }}">
{{ $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}}">
{{ if $bonkcsrf }} </a> {{ end }}
{{ 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}}">
{{ if $bonkcsrf }} </a> {{ end }}
{{ 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 }}">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>
{{ if .HTPrecis }}
<details class="noise">
<summary>{{ .HTPrecis }}<p></summary>
{{ end }}
<p class="content">{{ .HTML }}
{{ with .Time }}
<p>Time: {{ .StartTime.Local.Format "03:04PM EDT Mon Jan 02"}}
{{ if .Duration }}<br>Duration: {{ .Duration }}{{ end }}
{{ 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>{{ 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 }}
{{ else if eq .Media "application/pdf" }}
<p><a href="/d/{{ .XID }}">Attachment: {{ .Name }}</a>{{ if not (eq .Desc .Name) }} {{ .Desc }}{{ end }}
{{ else }}
{{ 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 }}">
{{ end }}
{{ end }}
{{ else }}
{{ if .External }}
<p><a href="{{ .URL }}" rel=noreferrer>External Attachment: {{ .Name }}</a>{{ if not (eq .Desc .Name) }} {{ .Desc }}{{ end }}
{{ else }}
{{ if eq .Media "video/mp4" }}
<p><video controls src="{{ .URL }}">{{ .Name }}</video>
{{ else }}
<p><img src="{{ .URL }}" title="{{ .Desc }}" alt="{{ .Desc }}">
{{ end }}
{{ end }}
{{ end }}
{{ end }}
</details>
{{ end }}
{{ if eq .Honk.What "wonked" }}
<p>
{{ if and $bonkcsrf .Honk.IsWonked }}
{{ .Honk.Guesses }}
<p>{{ .Honk.Noise }}
{{ else }}
<button onclick="return playit(this, '{{ .Honk.Noise }}', '{{ .Honk.Wonkles }}', '{{ .Honk.XID }}')">it's play time!</button>
{{ end }}
{{ end }}
{{ if and $bonkcsrf (not $IsPreview) }}
<p>
<details class="actions">
<summary>actions</summary>
<div>
<p>
{{ if .Honk.Public }}
{{ if .Honk.IsBonked }}
<button onclick="return unbonk(this, '{{ .Honk.XID }}');">unrepost</button>
{{ else }}
<button onclick="return bonk(this, '{{ .Honk.XID }}');">repost</button>
{{ end }}
{{ else }}
<button disabled>nope</button>
{{ end }}
<button onclick="return showhonkform(this, '{{ .Honk.XID }}', '{{ .Honk.Handles }}');"><a href="/newhonk?rid={{ .Honk.XID }}">reply</a></button>
<button onclick="return muteit(this, '{{ .Honk.Convoy }}');">mute</button>
<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>
{{ if .Honk.IsAcked }}
<button onclick="return flogit(this, 'deack', '{{ .Honk.XID }}');">deack</button>
{{ else }}
<button onclick="return flogit(this, 'ack', '{{ .Honk.XID }}');">ack</button>
{{ end }}
{{ if .Honk.IsSaved }}
<button onclick="return flogit(this, 'unsave', '{{ .Honk.XID }}');">unsave</button>
{{ else }}
<button onclick="return flogit(this, 'save', '{{ .Honk.XID }}');">save</button>
{{ end }}
{{ if .Honk.IsUntagged }}
<button disabled>untagged</button>
{{ else }}
<button onclick="return flogit(this, 'untag', '{{ .Honk.XID }}');">untag me</button>
{{ end }}
<button><a href="/edit?xid={{ .Honk.XID }}">edit</a></button>
{{ if not (eq .Badonk "none") }}
{{ if .Honk.IsReacted }}
<button disabled>badonked</button>
{{ else }}
<button onclick="return flogit(this, 'react', '{{ .Honk.XID }}');">{{ .Badonk }}</button>
{{ end }}
{{ end }}
</div>
</details>
<p>
{{ end }}
</article>