all repos — honk @ a45d05c6b519c07e8c410dc3f75045e2ee3b72a3

my fork of honk

views/honk.html (view raw)

  1<article id="{{ .Honk.ShortXID }}" class="honk {{ .Honk.Style }}" data-convoy="{{ .Honk.Convoy }}" data-hname="{{ .Honk.Handles }}" data-xid="{{ .Honk.XID }}" data-id="{{ .Honk.ID }}">
  2  {{ $bonkcsrf := .BonkCSRF }}
  3  {{ $IsPreview := .IsPreview }}
  4  {{ $maplink := .MapLink }}
  5  {{ $omitimages := .OmitImages }}
  6  {{ with .Honk }}
  7  <header>
  8    {{ if $bonkcsrf }}
  9    <a class="honkerlink" href="/h?xid={{ .Honker }}" data-xid="{{ .Honker }}">
 10      {{ else }}
 11      <a href="{{ .Honker }}" rel=noreferrer>
 12        {{ end }}
 13        <img alt="" src="/a?a={{ .Honker}}">
 14      </a>
 15      {{ if .Oonker }}
 16      {{ if $bonkcsrf }}
 17      <a class="honkerlink" href="/h?xid={{ .Oonker }}" data-xid="{{ .Oonker }}">
 18        {{ else }}
 19        <a href="{{ .Oonker }}" rel=noreferrer>
 20          {{ end }}
 21          <img alt="" src="/a?a={{ .Oonker}}">
 22        </a>
 23        {{ end }}
 24        {{ if $bonkcsrf }}
 25        <a class="honkerlink" href="/h?xid={{ .Honker }}" data-xid="{{ .Honker }}">{{ .Username }}</a>
 26        {{ else }}
 27        <a href="{{ .Honker }}" rel=noreferrer>{{ .Username }}</a>
 28        {{ end }}
 29        <span style="display:inline-block;"><a href="{{ .URL }}" rel=noreferrer>{{ .What }}</a></span>
 30        <ul class="honkmeta">
 31          <li><span><a class="convoylink" href="/t?c={{ .Convoy }}#{{ .ShortXID }}">convoy</a></span>
 32
 33            {{ if .Oonker }}
 34            <li><span>
 35                {{ if $bonkcsrf }}
 36                <a class="honkerlink" href="/h?xid={{ .Oonker }}" data-xid="{{ .Oonker }}">original</a>
 37                {{ else }}
 38                <a href="{{ .Oonker }}" rel=noreferrer>original</a>
 39                {{ end }}
 40              </span></li>
 41              {{ else }}
 42              {{ if .RID }}
 43              <li><span><a href="{{ .RID }}" rel=noreferrer>parent</a></span>
 44                {{ end }}
 45                {{ end }}
 46                {{ if $bonkcsrf }}
 47                <li><span title='{{ .Date.Local.Format "02 Jan 2006 15:04" }}' id="honkdate">{{ .DatePretty }}</span>
 48        </ul>
 49        {{ end }}
 50  </header>
 51  <p>
 52  <details class="noise" {{ with .Open }}{{.}}{{end}}>
 53    <summary class="noise">{{ .HTPrecis }}<p></summary>
 54    <p>{{ .HTPrecis }}
 55    <p class="content">{{ .HTML }}
 56    {{ if .Link }}
 57    <p><a href="{{ .Link }}">{{ or .LegalName .Link }}</a>
 58    {{ end }}
 59    {{ with .Time }}
 60    <p>Time: {{ .StartTime.Local.Format "03:04PM MST Mon Jan 02"}}
 61    {{ if .Duration }}<br>Duration: {{ .Duration }}{{ end }}</p>
 62    {{ end }}
 63    {{ with .Place }}
 64    <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 }}
 65    {{ end }}
 66    {{ range .Donks }}
 67    {{ if eq .Media "text/plain" }}
 68    <p><a href="/d/{{ .XID }}">Attachment: {{ .Name }}</a>{{ if not (eq .Desc .Name) }} {{ .Desc }}{{ end }} ({{ .Meta.Length }})</p>
 69    {{ else if eq .Media "application/pdf" }}
 70    <p><a href="/d/{{ .XID }}">Attachment: {{ .Name }}</a>{{ if not (eq .Desc .Name) }} {{ .Desc }}{{ end }} ({{ .Meta.Length }})</p>
 71    {{ else }}
 72    {{ if $omitimages }}
 73    <p><a href="/d/{{ .XID }}">Image: {{ .Name }}</a>{{ if not (eq .Desc .Name) }} {{ .Desc }}{{ end }} ({{.Meta.Width}}x{{.Meta.Height}} {{ .Meta.Length }})</p>
 74    {{ else }}
 75    {{ if .Local }}
 76    <img class="donk donklink" src="/d/{{ .XID }}" loading=lazy title="{{ .Desc }}" alt="{{ .Desc }}" width="{{.Meta.Width}}" height="{{.Meta.Height}}">
 77    {{ else if .External }}
 78    <p><img src="{{ .URL }}" title="{{ .Desc }}" alt="{{ .Desc }}"></p>
 79    {{ end }}
 80    {{ end }}
 81    {{ end }}
 82    {{ if eq .Media "video/mp4" }}
 83    <p><video controls src="{{ .URL }}">{{ .Name }}</video></p>
 84    {{ end }}
 85    {{ end }}
 86  </details>
 87  {{ end }}
 88  {{ if and $bonkcsrf (not $IsPreview) }}
 89  <p>
 90  <details class="actions">
 91    <summary>actions</summary>
 92    <div>
 93      <p>
 94      {{ if .Honk.Public }}
 95      {{ if .Honk.IsBonked }}
 96      <button class="unbonk">unbonk</button>
 97      {{ else }}
 98      <button class="bonk">bonk</button>
 99      {{ end }}
100      {{ else }}
101      <button disabled>nope</button>
102      {{ end }}
103      <button class="honkback"><a href="/newhonk?rid={{ .Honk.XID }}">reply</a></button>
104      <button class="mute">mute</button>
105      <button class="evenmore">even more</button>
106    </div>
107    <div id="evenmore{{ .Honk.ID }}" class="hide">
108      <p>
109      <button class="zonk">zonk</button>
110      {{ if .Honk.IsAcked }}
111      <button class="flogit-deack">deack</button>
112      {{ else }}
113      <button class="flogit-ack" >ack</button>
114      {{ end }}
115      {{ if .Honk.IsSaved }}
116      <button class="flogit-unsave">unsave</button>
117      {{ else }}
118      <button class="flogit-save">save</button>
119      {{ end }}
120      {{ if .Honk.IsUntagged }}
121      <button disabled>untagged</button>
122      {{ else }}
123      <button class="flogit-untag">untag me</button>
124      {{ end }}
125      {{ if eq .Honk.Honker .UserURL }}
126      <button><a href="/edit?xid={{ .Honk.XID }}">edit</a></button>
127      {{ else }}
128      <button disabled>nope</button>
129      {{ end }}
130      {{ if not (eq .Badonk "none") }}
131      {{ if .Honk.IsReacted }}
132      <button disabled>badonked</button>
133      {{ else }}
134      <button class="flogit-react" >{{ .Badonk }}</button>
135      {{ end }}
136      {{ end }}
137    </div>
138  </details>
139  <p>
140  {{ end }}
141</article>