add releases page; fix HUGE static file perf regression
This commit is contained in:
parent
31fd5da44b
commit
065a34a744
20 changed files with 233 additions and 73 deletions
30
admin/templates/html/artists.html
Normal file
30
admin/templates/html/artists.html
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
{{define "head"}}
|
||||
<title>Artists - ari melody 💫</title>
|
||||
<link rel="shortcut icon" href="/img/favicon.png" type="image/x-icon">
|
||||
<link rel="stylesheet" href="/admin/static/index.css">
|
||||
{{end}}
|
||||
|
||||
{{define "content"}}
|
||||
<main>
|
||||
<h1>Artists</h1>
|
||||
|
||||
<div class="card-header">
|
||||
<h2><a href="/admin/artists/">Artists</a></h2>
|
||||
<a class="button new" id="create-artist">Create New</a>
|
||||
</div>
|
||||
{{if .Artists}}
|
||||
<div class="artists-group">
|
||||
{{range $Artist := .Artists}}
|
||||
<div class="artist">
|
||||
<img src="{{$Artist.GetAvatar}}" alt="" width="64" loading="lazy" class="artist-avatar">
|
||||
<a href="/admin/artists/{{$Artist.ID}}" class="artist-name">{{$Artist.Name}}</a>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
{{else}}
|
||||
<p>There are no artists.</p>
|
||||
{{end}}
|
||||
</main>
|
||||
|
||||
<script type="module" src="/admin/static/admin.js"></script>
|
||||
{{end}}
|
||||
|
|
@ -7,7 +7,7 @@
|
|||
{{range $Artist := .Artists}}
|
||||
<li class="new-artist"
|
||||
data-id="{{$Artist.ID}}"
|
||||
hx-get="/admin/release/{{$.ReleaseID}}/newcredit/{{$Artist.ID}}"
|
||||
hx-get="/admin/releases/{{$.ReleaseID}}/newcredit/{{$Artist.ID}}"
|
||||
hx-target="#editcredits ul"
|
||||
hx-swap="beforeend"
|
||||
>
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@
|
|||
<h2>Editing: Credits</h2>
|
||||
<a id="add-credit"
|
||||
class="button new"
|
||||
href="/admin/release/{{.ID}}/addcredit"
|
||||
hx-get="/admin/release/{{.ID}}/addcredit"
|
||||
href="/admin/releases/{{.ID}}/addcredit"
|
||||
hx-get="/admin/releases/{{.ID}}/addcredit"
|
||||
hx-target="body"
|
||||
hx-swap="beforeend"
|
||||
>Add</a>
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
</div>
|
||||
<div class="release-info">
|
||||
<h3 class="release-title">
|
||||
<a href="/admin/release/{{.ID}}">{{.Title}}</a>
|
||||
<a href="/admin/releases/{{.ID}}">{{.Title}}</a>
|
||||
<small>
|
||||
<span title="{{.PrintReleaseDate}}">{{.ReleaseDate.Year}}</span>
|
||||
{{if not .Visible}}(hidden){{end}}
|
||||
|
|
@ -13,9 +13,9 @@
|
|||
</h3>
|
||||
<p class="release-artists">{{.PrintArtists true true}}</p>
|
||||
<p class="release-type-single">{{.ReleaseType}}
|
||||
(<a href="/admin/release/{{.ID}}#tracks">{{len .Tracks}} track{{if not (eq (len .Tracks) 1)}}s{{end}}</a>)</p>
|
||||
(<a href="/admin/releases/{{.ID}}#tracks">{{len .Tracks}} track{{if not (eq (len .Tracks) 1)}}s{{end}}</a>)</p>
|
||||
<div class="release-actions">
|
||||
<a href="/admin/release/{{.ID}}">Edit</a>
|
||||
<a href="/admin/releases/{{.ID}}">Edit</a>
|
||||
<a href="/music/{{.ID}}" target="_blank">Gateway <img class="icon" src="/img/external-link.svg"/></a>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
</li>
|
||||
<li class="new-track"
|
||||
data-id="{{$Track.ID}}"
|
||||
hx-get="/admin/release/{{$.ReleaseID}}/newtrack/{{$Track.ID}}"
|
||||
hx-get="/admin/releases/{{$.ReleaseID}}/newtrack/{{$Track.ID}}"
|
||||
hx-target="#edittracks ul"
|
||||
hx-swap="beforeend"
|
||||
>
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@
|
|||
<h2>Editing: Tracks</h2>
|
||||
<a id="add-track"
|
||||
class="button new"
|
||||
href="/admin/release/{{.Release.ID}}/addtrack"
|
||||
hx-get="/admin/release/{{.Release.ID}}/addtrack"
|
||||
href="/admin/releases/{{.Release.ID}}/addtrack"
|
||||
hx-get="/admin/releases/{{.Release.ID}}/addtrack"
|
||||
hx-target="body"
|
||||
hx-swap="beforeend"
|
||||
>Add</a>
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@
|
|||
<div class="credit">
|
||||
<img src="{{.Release.Artwork}}" alt="" width="64" loading="lazy" class="release-artwork">
|
||||
<div class="credit-info">
|
||||
<h3 class="credit-name"><a href="/admin/release/{{.Release.ID}}">{{.Release.Title}}</a></h3>
|
||||
<h3 class="credit-name"><a href="/admin/releases/{{.Release.ID}}">{{.Release.Title}}</a></h3>
|
||||
<p class="credit-artists">{{.Release.PrintArtists true true}}</p>
|
||||
<p class="artist-role">
|
||||
Role: {{.Role}}
|
||||
|
|
|
|||
|
|
@ -101,8 +101,8 @@
|
|||
<div class="card-header">
|
||||
<h2>Credits <small>({{len .Release.Credits}} total)</small></h2>
|
||||
<a class="button edit"
|
||||
href="/admin/release/{{.Release.ID}}/editcredits"
|
||||
hx-get="/admin/release/{{.Release.ID}}/editcredits"
|
||||
href="/admin/releases/{{.Release.ID}}/editcredits"
|
||||
hx-get="/admin/releases/{{.Release.ID}}/editcredits"
|
||||
hx-target="body"
|
||||
hx-swap="beforeend"
|
||||
>Edit</a>
|
||||
|
|
@ -111,7 +111,7 @@
|
|||
<div class="credit">
|
||||
<img src="{{.Artist.GetAvatar}}" alt="" width="64" loading="lazy" class="artist-avatar">
|
||||
<div class="credit-info">
|
||||
<p class="artist-name"><a href="/admin/artist/{{.Artist.ID}}">{{.Artist.Name}}</a></p>
|
||||
<p class="artist-name"><a href="/admin/artists/{{.Artist.ID}}">{{.Artist.Name}}</a></p>
|
||||
<p class="artist-role">
|
||||
{{.Role}}
|
||||
{{if .Primary}}
|
||||
|
|
@ -130,8 +130,8 @@
|
|||
<div class="card-header">
|
||||
<h2>Links ({{len .Release.Links}})</h2>
|
||||
<a class="button edit"
|
||||
href="/admin/release/{{.Release.ID}}/editlinks"
|
||||
hx-get="/admin/release/{{.Release.ID}}/editlinks"
|
||||
href="/admin/releases/{{.Release.ID}}/editlinks"
|
||||
hx-get="/admin/releases/{{.Release.ID}}/editlinks"
|
||||
hx-target="body"
|
||||
hx-swap="beforeend"
|
||||
>Edit</a>
|
||||
|
|
@ -147,8 +147,8 @@
|
|||
<div class="card-header" id="tracks">
|
||||
<h2>Tracklist ({{len .Release.Tracks}})</h2>
|
||||
<a class="button edit"
|
||||
href="/admin/release/{{.Release.ID}}/edittracks"
|
||||
hx-get="/admin/release/{{.Release.ID}}/edittracks"
|
||||
href="/admin/releases/{{.Release.ID}}/edittracks"
|
||||
hx-get="/admin/releases/{{.Release.ID}}/edittracks"
|
||||
hx-target="body"
|
||||
hx-swap="beforeend"
|
||||
>Edit</a>
|
||||
|
|
@ -157,7 +157,7 @@
|
|||
<div class="track" data-id="{{$track.ID}}">
|
||||
<h2 class="track-title">
|
||||
<span class="track-number">{{.Add $i 1}}</span>
|
||||
<a href="/admin/track/{{$track.ID}}">{{$track.Title}}</a>
|
||||
<a href="/admin/tracks/{{$track.ID}}">{{$track.Title}}</a>
|
||||
</h2>
|
||||
|
||||
<h3>Description</h3>
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
{{range $Artist := .Artists}}
|
||||
<div class="artist">
|
||||
<img src="{{$Artist.GetAvatar}}" alt="" width="64" loading="lazy" class="artist-avatar">
|
||||
<a href="/admin/artist/{{$Artist.ID}}" class="artist-name">{{$Artist.Name}}</a>
|
||||
<a href="/admin/artists/{{$Artist.ID}}" class="artist-name">{{$Artist.Name}}</a>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
|
|
@ -51,7 +51,7 @@
|
|||
{{range $Track := .Tracks}}
|
||||
<div class="track">
|
||||
<h2 class="track-title">
|
||||
<a href="/admin/track/{{$Track.ID}}">{{$Track.Title}}</a>
|
||||
<a href="/admin/tracks/{{$Track.ID}}">{{$Track.Title}}</a>
|
||||
</h2>
|
||||
{{if $Track.Description}}
|
||||
<p class="track-description">{{$Track.GetDescriptionHTML}}</p>
|
||||
|
|
|
|||
|
|
@ -28,14 +28,14 @@
|
|||
</div>
|
||||
<hr>
|
||||
<p class="section-label">music</p>
|
||||
<div class="nav-item{{if eq .Path "/releases"}} active{{end}}">
|
||||
<a href="/admin/releases">releases</a>
|
||||
<div class="nav-item{{if hasPrefix .Path "/releases"}} active{{end}}">
|
||||
<a href="/admin/releases/">releases</a>
|
||||
</div>
|
||||
<div class="nav-item{{if eq .Path "/artists"}} active{{end}}">
|
||||
<a href="/admin/artists">artists</a>
|
||||
<div class="nav-item{{if hasPrefix .Path "/artists"}} active{{end}}">
|
||||
<a href="/admin/artists/">artists</a>
|
||||
</div>
|
||||
<div class="nav-item{{if eq .Path "/tracks"}} active{{end}}">
|
||||
<a href="/admin/tracks">tracks</a>
|
||||
<div class="nav-item{{if hasPrefix .Path "/tracks"}} active{{end}}">
|
||||
<a href="/admin/tracks/">tracks</a>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
|
|
|
|||
22
admin/templates/html/releases.html
Normal file
22
admin/templates/html/releases.html
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{{define "head"}}
|
||||
<title>Releases - ari melody 💫</title>
|
||||
<link rel="shortcut icon" href="/img/favicon.png" type="image/x-icon">
|
||||
<link rel="stylesheet" href="/admin/static/index.css">
|
||||
{{end}}
|
||||
|
||||
{{define "content"}}
|
||||
<main>
|
||||
<div class="card-header">
|
||||
<h1><a href="/admin/releases/">Releases</a></h1>
|
||||
<a class="button new" id="create-release">Create New</a>
|
||||
</div>
|
||||
{{range .Releases}}
|
||||
{{block "release" .}}{{end}}
|
||||
{{end}}
|
||||
{{if not .Releases}}
|
||||
<p>There are no releases.</p>
|
||||
{{end}}
|
||||
</main>
|
||||
|
||||
<script type="module" src="/admin/static/admin.js"></script>
|
||||
{{end}}
|
||||
40
admin/templates/html/tracks.html
Normal file
40
admin/templates/html/tracks.html
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
{{define "head"}}
|
||||
<title>Releases - ari melody 💫</title>
|
||||
<link rel="shortcut icon" href="/img/favicon.png" type="image/x-icon">
|
||||
<link rel="stylesheet" href="/admin/static/index.css">
|
||||
{{end}}
|
||||
|
||||
{{define "content"}}
|
||||
<main>
|
||||
<h1>Releases</h1>
|
||||
|
||||
<div class="card-header">
|
||||
<h2><a href="/admin/tracks/">Tracks</a></h2>
|
||||
<a class="button new" id="create-track">Create New</a>
|
||||
</div>
|
||||
<p><em>"Orphaned" tracks that have not yet been bound to a release.</em></p>
|
||||
<br>
|
||||
{{range $Track := .Tracks}}
|
||||
<div class="track">
|
||||
<h2 class="track-title">
|
||||
<a href="/admin/tracks/{{$Track.ID}}">{{$Track.Title}}</a>
|
||||
</h2>
|
||||
{{if $Track.Description}}
|
||||
<p class="track-description">{{$Track.GetDescriptionHTML}}</p>
|
||||
{{else}}
|
||||
<p class="track-description empty">No description provided.</p>
|
||||
{{end}}
|
||||
{{if $Track.Lyrics}}
|
||||
<p class="track-lyrics">{{$Track.GetLyricsHTML}}</p>
|
||||
{{else}}
|
||||
<p class="track-lyrics empty">There are no lyrics.</p>
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
{{if not .Artists}}
|
||||
<p>There are no artists.</p>
|
||||
{{end}}
|
||||
</main>
|
||||
|
||||
<script type="module" src="/admin/static/admin.js"></script>
|
||||
{{end}}
|
||||
Loading…
Add table
Add a link
Reference in a new issue