- Have got upload images appearing in the post list - Allowed for deleting uploads - Allowed for seeing the upload progress - Fixed the setting of upload properties like the MIME type - Removed the stripe exif logic with just re-encoding PNGs and JPEGs by loading them and saving them
63 lines
2.6 KiB
HTML
63 lines
2.6 KiB
HTML
{{ $showingTrash := eq .req.Filter "deleted" }}
|
|
<main class="container">
|
|
<div class="my-4 d-flex justify-content-between align-items-baseline">
|
|
<a href="/sites/{{ .site.ID }}/posts/new" class="btn btn-success">New Post</a>
|
|
|
|
<div>
|
|
<div class="btn-group" role="group" aria-label="First group">
|
|
{{ if $showingTrash }}
|
|
<a href="/sites/{{ .site.ID }}/posts" type="button" class="btn btn-secondary" title="Trash">🗑️</a>
|
|
{{ else }}
|
|
<a href="/sites/{{ .site.ID }}/posts?filter=deleted" type="button" class="btn btn-outline-secondary" title="Trash">🗑️</a>
|
|
{{ end }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{{ range $i, $p := .posts }}
|
|
<div data-controller="postlist"
|
|
data-postlist-site-id-value="{{ $p.SiteID }}"
|
|
data-postlist-post-id-value="{{ $p.ID }}"
|
|
data-postlist-nano-summary-value="{{ $p.NanoSummary }}"
|
|
class="postlist">
|
|
<div class="my-4 post">
|
|
{{ if $p.Title }}<h4 class="mb-3">{{ $p.Title }}</h4>{{ end }}
|
|
{{ markdown $p.Body $.site }}
|
|
|
|
<div class="mb-3 d-flex align-items-center">
|
|
{{ if eq .State 1 }}
|
|
<span class="text-muted">{{ $.user.FormatTime .UpdatedAt }}</span> <span class="ms-3 badge text-primary-emphasis bg-primary-subtle border border-primary-subtle">Draft</span>
|
|
{{ else }}
|
|
<span class="text-muted">{{ $.user.FormatTime .PublishedAt }}</span>
|
|
{{ end }}
|
|
</div>
|
|
|
|
<div class="mb-3 d-flex align-items-center">
|
|
{{ if $showingTrash }}
|
|
<span>
|
|
<a href="#" data-action="click->postlist#restorePost" class="btn btn-outline-secondary btn-sm">Restore</a>
|
|
<a href="#" data-action="click->postlist#deletePost" data-postlist-hard-delete-param="true"
|
|
class="btn btn-outline-danger btn-sm">Delete</a>
|
|
</span>
|
|
{{ else }}
|
|
<span>
|
|
<a href="/sites/{{ $.site.ID }}/posts/{{ $p.ID }}/"
|
|
class="btn btn-outline-secondary btn-sm">Edit</a>
|
|
<a href="#" data-action="click->postlist#deletePost"
|
|
class="btn btn-outline-secondary btn-sm">Trash</a>
|
|
</span>
|
|
{{ end }}
|
|
</div>
|
|
</div>
|
|
{{ if lt $i (sub (len $.posts) 1) }}<hr>{{ end }}
|
|
</div>
|
|
{{ else }}
|
|
<div class="h4 m-3 text-center">
|
|
{{ if $showingTrash }}
|
|
<div class="position-absolute top-50 start-50 translate-middle">🗑️<br>Trash is empty.</div>
|
|
{{ else }}
|
|
<div class="position-absolute top-50 start-50 translate-middle">🌱<br>No posts yet. Better get writing!</div>
|
|
{{ end }}
|
|
</div>
|
|
{{ end }}
|
|
</main> |