add blog index to admin dashboard
This commit is contained in:
parent
ee8bf6543e
commit
65366032fd
10 changed files with 603 additions and 91 deletions
33
admin/templates/html/blogs.html
Normal file
33
admin/templates/html/blogs.html
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
{{define "head"}}
|
||||
<title>Blog - ari melody 💫</title>
|
||||
<link rel="shortcut icon" href="/img/favicon.png" type="image/x-icon">
|
||||
<link rel="stylesheet" href="/admin/static/blog.css">
|
||||
{{end}}
|
||||
|
||||
{{define "content"}}
|
||||
<main>
|
||||
<header>
|
||||
<h1>Blog Posts <small>({{.TotalPosts}} total)</small></h2>
|
||||
<a class="button new" id="create-post">Create New</a>
|
||||
</header>
|
||||
|
||||
{{if .Collections}}
|
||||
<div class="blog-group">
|
||||
{{range .Collections}}
|
||||
{{if .Posts}}
|
||||
<div class="blog-collection">
|
||||
<h2>{{.Year}}</h2>
|
||||
{{range .Posts}}
|
||||
{{block "blogpost" .}}{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
{{else}}
|
||||
<p>There are no blog posts.</p>
|
||||
{{end}}
|
||||
</main>
|
||||
|
||||
<script type="module" src="/admin/static/blog.js"></script>
|
||||
{{end}}
|
||||
14
admin/templates/html/components/blog/blogpost.html
Normal file
14
admin/templates/html/components/blog/blogpost.html
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{{define "blogpost"}}
|
||||
<div class="blogpost">
|
||||
<h3 class="title"><a href="/admin/blogs/{{.ID}}">{{.Title}}</a>{{if not .Visible}} <small>(Not published)</small>{{end}}</h3>
|
||||
<p class="meta">
|
||||
<span class="author"><img src="/img/favicon.png" alt="{{.Author.Username}}'s avatar" width="32" height="32"/> {{.Author.Username}}</span>
|
||||
<span class="date">• {{.PrintDate}}</span>
|
||||
</p>
|
||||
<p class="description">{{.Description}}</p>
|
||||
<div class="actions">
|
||||
<a href="/admin/blogs/{{.ID}}">Edit</a>
|
||||
<a href="/blog/{{.ID}}">View</a>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
|
|
@ -27,7 +27,9 @@
|
|||
<div class="nav-item{{if eq .Path "/logs"}} active{{end}}">
|
||||
<a href="/admin/logs">logs</a>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<p class="section-label">music</p>
|
||||
<div class="nav-item{{if hasPrefix .Path "/releases"}} active{{end}}">
|
||||
<a href="/admin/music/releases/">releases</a>
|
||||
|
|
@ -38,6 +40,13 @@
|
|||
<div class="nav-item{{if hasPrefix .Path "/tracks"}} active{{end}}">
|
||||
<a href="/admin/music/tracks/">tracks</a>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<p class="section-label">blog</p>
|
||||
<div class="nav-item{{if hasPrefix .Path "/blogs"}} active{{end}}">
|
||||
<a href="/admin/blogs/">blog</a>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
<div class="flex-fill"></div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue