add handler, html templates, Makefile and migrations

This commit is contained in:
Philipp 2021-08-29 16:37:20 +02:00
commit a06e8db2ff
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: 276B613AF9DBE9C3
22 changed files with 1001 additions and 0 deletions

28
templates/threads.html Normal file
View file

@ -0,0 +1,28 @@
<!DOCTYPE html>
{{define "header"}}
<h1 class="mb-0">Explore threads</h1>
{{end}}
{{define "content"}}
{{range .Threads}}
<div class="card mb-4">
<div class="card-body">
<a href="#" class="d-block card-title text-body mt-1 h5">
{{.Title}}
</a>
<p class="card-text">{{.Description}}</p>
<a href="/threads/{{.ID}}" class="btn btn-primary">Browse Thread</a>
</div>
</div>
{{end}}
{{end}}
{{define "sidebar"}}
<div class="card mb-4">
<div class="card-body">
<h5 class="card-title">Create a new thread</h5>
<p class="card-text">Start a new community on goddit and share experiences.</p>
<a href="/threads/new" class="btn btn-primary btn-block">Create Thread</a>
</div>
</div>
{{end}}