tracks can be edited! + major template overhaul
This commit is contained in:
parent
99b6a21179
commit
63122eb428
21 changed files with 674 additions and 221 deletions
|
@ -1,5 +1,5 @@
|
|||
{{define "head"}}
|
||||
<title>editing {{.Title}} - ari melody 💫</title>
|
||||
<title>Editing {{.Title}} - ari melody 💫</title>
|
||||
<link rel="shortcut icon" href="{{.GetArtwork}}" type="image/x-icon">
|
||||
|
||||
<link rel="stylesheet" href="/admin/static/edit-release.css">
|
||||
|
@ -129,7 +129,7 @@
|
|||
{{end}}
|
||||
</div>
|
||||
|
||||
<div class="card-title">
|
||||
<div class="card-title" id="tracks">
|
||||
<h2>Tracklist ({{len .Tracks}})</h2>
|
||||
<a class="button edit"
|
||||
href="/admin/release/{{.ID}}/edittracks"
|
||||
|
@ -163,6 +163,18 @@
|
|||
{{end}}
|
||||
</div>
|
||||
|
||||
<div class="card-title">
|
||||
<h2>Danger Zone</h2>
|
||||
</div>
|
||||
<div class="card danger">
|
||||
<p>
|
||||
Clicking the button below will delete this release.
|
||||
This action is <strong>irreversible</strong>.
|
||||
You will be prompted to confirm this decision.
|
||||
</p>
|
||||
<button class="delete" id="delete">Delete Release</button>
|
||||
</div>
|
||||
|
||||
</main>
|
||||
|
||||
<script type="module" src="/admin/static/edit-release.js" defer></script>
|
||||
|
|
68
admin/views/edit-track.html
Normal file
68
admin/views/edit-track.html
Normal file
|
@ -0,0 +1,68 @@
|
|||
{{define "head"}}
|
||||
<title>Editing Track - ari melody 💫</title>
|
||||
|
||||
<link rel="stylesheet" href="/admin/static/edit-track.css">
|
||||
{{end}}
|
||||
|
||||
{{define "content"}}
|
||||
<main>
|
||||
<h1>Editing Track "{{.Title}}"</h1>
|
||||
|
||||
<div id="track" data-id="{{.ID}}">
|
||||
<div class="track-info">
|
||||
<p class="track-title-header">Title</p>
|
||||
<h2 class="track-title">
|
||||
<input type="text" id="title" name="Title" value="{{.Title}}">
|
||||
</h2>
|
||||
|
||||
<h2>Description</h2>
|
||||
<textarea
|
||||
name="Description"
|
||||
value="{{.Description}}"
|
||||
placeholder="No description provided."
|
||||
rows="5"
|
||||
id="description"
|
||||
>{{.Description}}</textarea>
|
||||
|
||||
<h2>Lyrics</h2>
|
||||
<textarea
|
||||
name="Lyrics"
|
||||
value="{{.Lyrics}}"
|
||||
placeholder="There are no lyrics."
|
||||
rows="5"
|
||||
id="lyrics"
|
||||
>{{.Lyrics}}</textarea>
|
||||
|
||||
<div class="track-actions">
|
||||
<button type="submit" class="save" id="save" disabled>Save</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-title">
|
||||
<h2>Featured in</h2>
|
||||
</div>
|
||||
<div class="card releases">
|
||||
{{if .Release}}
|
||||
{{block "release" .Release}}{{end}}
|
||||
{{else}}
|
||||
<p>This track isn't bound to a release.</p>
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
<div class="card-title">
|
||||
<h2>Danger Zone</h2>
|
||||
</div>
|
||||
<div class="card danger">
|
||||
<p>
|
||||
Clicking the button below will delete this track.
|
||||
This action is <strong>irreversible</strong>.
|
||||
You will be prompted to confirm this decision.
|
||||
</p>
|
||||
<button class="delete" id="delete">Delete Track</button>
|
||||
</div>
|
||||
|
||||
</main>
|
||||
|
||||
<script type="module" src="/admin/static/edit-track.js" defer></script>
|
||||
{{end}}
|
|
@ -1,5 +1,5 @@
|
|||
{{define "head"}}
|
||||
<title>admin - ari melody 💫</title>
|
||||
<title>Admin - ari melody 💫</title>
|
||||
<link rel="shortcut icon" href="/img/favicon.png" type="image/x-icon">
|
||||
<link rel="stylesheet" href="/admin/static/index.css">
|
||||
{{end}}
|
||||
|
@ -12,28 +12,8 @@
|
|||
<a href="/admin/createrelease" class="create-btn" id="create-release">Create New</a>
|
||||
</div>
|
||||
<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}}
|
||||
{{if not $Release.Visible}}(hidden){{end}}
|
||||
</small>
|
||||
</h3>
|
||||
<p class="release-artists">{{$Release.PrintArtists true true}}</p>
|
||||
<p class="release-type-single">{{$Release.ReleaseType}}
|
||||
({{len $Release.Tracks}} track{{if not (eq (len $Release.Tracks) 1)}}s{{end}})</p>
|
||||
<div class="release-actions">
|
||||
<a href="/admin/release/{{$Release.ID}}">Edit</a>
|
||||
<a href="/music/{{$Release.ID}}" target="_blank">Gateway</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{range .Releases}}
|
||||
{{block "release" .}}{{end}}
|
||||
{{end}}
|
||||
{{if not .Releases}}
|
||||
<p>There are no releases.</p>
|
||||
|
@ -66,14 +46,13 @@
|
|||
{{range $Track := .Tracks}}
|
||||
<div class="track">
|
||||
<h2 class="track-title">
|
||||
{{$Track.Title}}
|
||||
<a href="/admin/track/{{$Track.ID}}">{{$Track.Title}}</a>
|
||||
{{if $Track.Release}}
|
||||
<small class="track-album">{{$Track.Release.Title}}</small>
|
||||
{{else}}
|
||||
<small class="track-album empty">(no release)</small>
|
||||
{{end}}
|
||||
</h2>
|
||||
<p class="track-id">{{$Track.ID}}</p>
|
||||
{{if $Track.Description}}
|
||||
<p class="track-description">{{$Track.Description}}</p>
|
||||
{{else}}
|
||||
|
|
|
@ -23,8 +23,7 @@
|
|||
</nav>
|
||||
</header>
|
||||
|
||||
{{block "content" .}}
|
||||
{{end}}
|
||||
{{block "content" .}}{{end}}
|
||||
|
||||
{{template "prideflag"}}
|
||||
</body>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{{define "head"}}
|
||||
<title>login - ari melody 💫</title>
|
||||
<title>Login - ari melody 💫</title>
|
||||
<link rel="shortcut icon" href="/img/favicon.png" type="image/x-icon">
|
||||
|
||||
<style>
|
||||
|
@ -15,21 +15,18 @@ a.discord {
|
|||
|
||||
{{define "content"}}
|
||||
<main>
|
||||
|
||||
{{if .Token}}
|
||||
|
||||
<meta http-equiv="refresh" content="5;url=/admin/" />
|
||||
<meta name="token" content="{{.Token}}" />
|
||||
<p>
|
||||
Logged in successfully.
|
||||
You should be redirected to <a href="/admin">/admin</a> in 5 seconds.
|
||||
<script>
|
||||
const token = document.querySelector("meta[name=token]").content;
|
||||
localStorage.setItem("arime-token", btoa(token));
|
||||
</script>
|
||||
</p>
|
||||
{{else}}
|
||||
<p>Log in with <a href="{{.DiscordURI}}" class="discord">Discord</a>.</p>
|
||||
{{end}}
|
||||
|
||||
{{else}}
|
||||
|
||||
<p>Log in with <a href="{{.DiscordURI}}" class="discord">Discord</a>.</p>
|
||||
|
||||
{{end}}
|
||||
</main>
|
||||
{{end}}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{{define "head"}}
|
||||
<title>admin - ari melody 💫</title>
|
||||
<title>Admin - ari melody 💫</title>
|
||||
<link rel="shortcut icon" href="/img/favicon.png" type="image/x-icon">
|
||||
|
||||
<style>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue