mirror of
https://github.com/acaloiaro/garbagespeak.com
synced 2026-07-21 18:29:08 +00:00
46 lines
1.1 KiB
HTML
46 lines
1.1 KiB
HTML
<div class="posts">
|
|
{{ $apiBaseURL := .ApiBaseUrl }}
|
|
{{range .Posts}}
|
|
<article class="post on-list">
|
|
<h1 class="post-title">{{ .Title }}</h1>
|
|
<div class="post-meta">
|
|
{{- with .Username -}}
|
|
<span>Submitter: {{ . }}</span>
|
|
{{- end -}}
|
|
{{- with .CreatedAt -}}
|
|
<time class="post-date">
|
|
{{- .Format "2006-01-02" -}}
|
|
</time>
|
|
{{- end -}}
|
|
{{if .Url}}<a href={{ .Url }}>Link</a>{{ end }}
|
|
{{ if eq .OwnerID.String $.UserID }}
|
|
<a href="#"
|
|
hx-get="{{ $apiBaseURL }}/garbage/{{ .ID }}/edit"
|
|
hx-target="#content"
|
|
hx-swap="outerHTML">Edit</a>
|
|
{{ end }}
|
|
</div>
|
|
|
|
|
|
<div class="post-content">
|
|
{{ .Content }}
|
|
</div>
|
|
|
|
<br/>
|
|
<div class="post-meta">
|
|
{{ if .Metadata.tags }}
|
|
<span>tags</span>
|
|
<span>
|
|
{{ range .Metadata.tags }}
|
|
{{- . -}},
|
|
{{ end }}
|
|
</span>
|
|
{{ end }}
|
|
</div>
|
|
</article>
|
|
{{end}}
|
|
</div>
|
|
|
|
{{- with .Alert -}}
|
|
<div id="alert" remove-me="5s" class="alert">{{ . }}</div>
|
|
{{ end }}
|