garbagespeak.com/partials/garbage/list.html

49 lines
1.1 KiB
HTML

<div class="posts">
{{range .Posts}}
<article class="post on-list">
<h1 class="post-title">{{ .Title }}</h1>
<div class="post-meta">
{{- with .Username -}}
<span>Submitter:&nbsp;{{ . }}</span>
{{- end -}}
{{- with .CreatedAt -}}
<time class="post-date">
{{- .Format "2006-01-02" -}}
</time>
{{- end -}}
<a href="#"
hx-get="{{ $.ApiBaseUrl }}/garbage/{{ .ID }}"
hx-push-url="{{ $.ApiBaseUrl }}/garbage/{{ .ID }}"
hx-target="#content">Link</a>
{{ 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 }}