garbagespeak.com/partials/posts.html

43 lines
956 B
HTML
Raw Normal View History

2023-07-25 19:48:30 +00:00
<div class="posts">
2023-07-29 19:26:45 +00:00
{{ $apiBaseURL := .ApiBaseUrl }}
2023-07-25 19:48:30 +00:00
{{range .Posts}}
<article class="post on-list">
2023-07-29 19:26:45 +00:00
<h1 class="post-title"><a href={{ .Url }}>{{ .Title }}</a></h1>
2023-07-25 19:48:30 +00:00
<div class="post-meta">
2023-07-29 16:36:24 +00:00
{{- with .Username -}}
2023-07-29 19:26:45 +00:00
<span>Submitter:&nbsp;{{ . }}</span>
2023-07-25 19:48:30 +00:00
{{- end -}}
2023-07-25 20:32:04 +00:00
{{ if .Metadata.tags }}
2023-07-29 19:26:45 +00:00
<span>
2023-07-25 20:32:04 +00:00
{{ range .Metadata.tags }}
2023-07-29 16:36:24 +00:00
{{- . -}},
2023-07-25 19:48:30 +00:00
{{ end }}
</span>
{{ end }}
2023-07-29 16:36:24 +00:00
{{- with .CreatedAt -}}
<time class="post-date">
{{- .Format "2006-01-02" -}}
</time>
{{- end -}}
2023-07-29 19:26:45 +00:00
{{ if $.LoggedIn }}
<a href="#"
hx-get="{{ $apiBaseURL }}/garbage/{{ .ID }}/edit"
hx-target="#content"
hx-swap="outerHTML">Edit</a>
{{ end }}
2023-07-25 19:48:30 +00:00
</div>
<div class="post-content">
{{ .Content }}
</div>
</article>
{{end}}
</div>
2023-07-28 01:14:38 +00:00
{{- with .Alert -}}
<div id="alert" remove-me="5s" class="alert">{{ . }}</div>
{{ end }}