Have got soft and hard deleting
This commit is contained in:
parent
aef3bb6a1e
commit
3ea5823ca0
27 changed files with 588 additions and 55 deletions
|
|
@ -1,17 +1,47 @@
|
|||
{{ $showingTrash := eq .req.Filter "deleted" }}
|
||||
<main class="container">
|
||||
<div class="my-4">
|
||||
<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 }}
|
||||
{{ if gt $i 0 }}<hr>{{ end }}
|
||||
<div class="my-4">
|
||||
{{ if $p.Title }}<h4 class="mb-3">{{ $p.Title }}</h4>{{ end }}
|
||||
{{ $p.Body | markdown }}
|
||||
<div class="mb-3">
|
||||
<a href="/sites/{{ $.site.ID }}/posts/{{ $p.ID }}/edit"
|
||||
class="link-secondary link-offset-2 link-underline link-underline-opacity-0 link-underline-opacity-75-hover">Edit</a>
|
||||
<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 }}">
|
||||
<div class="my-4">
|
||||
{{ if $p.Title }}<h4 class="mb-3">{{ $p.Title }}</h4>{{ end }}
|
||||
{{ $p.Body | markdown }}
|
||||
|
||||
{{ if $showingTrash }}
|
||||
<div class="mb-3">
|
||||
<a href="#" data-action="click->postlist#restorePost"
|
||||
class="link-secondary link-offset-2 link-underline link-underline-opacity-0 link-underline-opacity-75-hover">Restore</a>
|
||||
-
|
||||
<a href="#" data-action="click->postlist#deletePost" data-postlist-hard-delete-param="true"
|
||||
class="link-secondary link-offset-2 link-underline link-underline-opacity-0 link-underline-opacity-75-hover">Delete</a>
|
||||
</div>
|
||||
{{ else }}
|
||||
<div class="mb-3">
|
||||
<a href="/sites/{{ $.site.ID }}/posts/{{ $p.ID }}/edit"
|
||||
class="link-secondary link-offset-2 link-underline link-underline-opacity-0 link-underline-opacity-75-hover">Edit</a>
|
||||
-
|
||||
<a href="#" data-action="click->postlist#deletePost"
|
||||
class="link-secondary link-offset-2 link-underline link-underline-opacity-0 link-underline-opacity-75-hover">Delete</a>
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ if lt $i (sub (len $.posts) 1) }}<hr>{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
</main>
|
||||
Loading…
Add table
Add a link
Reference in a new issue