HOLY REFACTOR GOOD GRIEF (also finally started some CRUD work)

Signed-off-by: ari melody <ari@arimelody.me>
This commit is contained in:
ari melody 2024-08-02 22:48:26 +01:00
parent 1c310c9101
commit 442889340c
80 changed files with 1571 additions and 1330 deletions

55
views/admin/index.html Normal file
View file

@ -0,0 +1,55 @@
{{define "head"}}
<title>admin - ari melody 💫</title>
<link rel="shortcut icon" href="/img/favicon.png" type="image/x-icon">
{{end}}
{{define "content"}}
<header>
<img src="/img/favicon.png" alt="" class="icon">
<a href="/admin">home</a>
<a href="/admin/releases">releases</a>
<a href="/admin/artists">artists</a>
</header>
<main>
<h1>Releases</h1>
<div class="card releases">
{{range $Release := .Releases}}
<div class="release">
<div class="release-artwork">
<img src="{{$Release.Artwork}}" alt="" width="128" loading="lazy">
</div>
<div class="release-info">
<h3 class="release-title">{{$Release.Title}} <small>{{$Release.GetReleaseYear}}</small></h3>
<p class="release-artists">{{$Release.PrintArtists true true}}</p>
<p class="release-type-single">{{$Release.ReleaseType}}</p>
<div class="release-actions">
<a href="/admin/releases/{{$Release.ID}}">Edit</a>
<a href="/music/{{$Release.ID}}" target="_blank">Gateway</a>
</div>
</div>
</div>
{{end}}
{{if not .Releases}}
<p>There are no releases.</p>
{{end}}
</div>
<h1>Artists</h1>
<div class="card artists">
{{range $Artist := .Artists}}
<div class="artist">
<img src="https://arimelody.me/img/favicon.png" alt="" width="64" loading="lazy" class="artist-avatar">
<a href="/admin/artists/arimelody" class="artist-name">ari melody</a>
</div>
{{end}}
{{if not .Artists}}
<p>There are no artists.</p>
{{end}}
</div>
</main>
<script type="module" src="/admin/static/admin.js" defer></script>
{{end}}

22
views/admin/layout.html Normal file
View file

@ -0,0 +1,22 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
{{block "head" .}}{{end}}
<link rel="stylesheet" href="/admin/static/admin.css">
</head>
<body>
{{block "content" .}}
{{end}}
{{template "prideflag"}}
</body>
</html>

20
views/admin/login.html Normal file
View file

@ -0,0 +1,20 @@
{{define "head"}}
<title>admin - ari melody 💫</title>
<link rel="shortcut icon" href="/img/favicon.png" type="image/x-icon">
<style>
.discord {
color: #5865F2;
}
</style>
{{end}}
{{define "content"}}
<main>
<p>Log in with <a href="{{.}}" class="discord">Discord</a>.</p>
</main>
<script type="module" src="/admin/static/admin.js" defer></script>
{{end}}