Added user authentication
This commit is contained in:
parent
d7e7af5a10
commit
cb54057305
40 changed files with 710 additions and 218 deletions
|
|
@ -3,18 +3,18 @@
|
|||
</div>
|
||||
|
||||
{{range .posts}}
|
||||
{{if .Title}}
|
||||
<h3>{{.Title}}</h3>
|
||||
{{end}}
|
||||
|
||||
<div class="post">
|
||||
{{if .Title}}
|
||||
<h3>{{.Title}}</h3>
|
||||
{{end}}
|
||||
|
||||
{{.Body | markdown}}
|
||||
|
||||
<div>
|
||||
<a href="/sites/{{$.site.ID}}/posts/{{.ID}}">Edit</a>
|
||||
<a href="/sites/{{$.site.ID}}/posts/{{.ID}}">Edit</a> |
|
||||
<a hx-delete="/sites/{{$.site.ID}}/posts/{{.ID}}" hx-confirm="Delete post?" hx-target="closest .post" href="#">Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
{{else}}
|
||||
<p>No posts yet</p>
|
||||
{{end}}
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
{{- $postTarget := printf "/sites/%v/posts" .site.ID -}}
|
||||
{{- if .post.ID -}}
|
||||
{{- if (ne .post.ID 0) -}}
|
||||
{{- $postTarget = printf "/sites/%v/posts/%v" .site.ID .post.ID -}}
|
||||
{{- end -}}
|
||||
<form method="post" action="{{$postTarget}}" class="post-form">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue