arimelody.me/admin/views/edit-release.html

144 lines
5.3 KiB
HTML
Raw Normal View History

{{define "head"}}
<title>editing {{.Title}} - ari melody 💫</title>
<link rel="shortcut icon" href="{{.GetArtwork}}" type="image/x-icon">
<link rel="stylesheet" href="/admin/static/release.css">
{{end}}
{{define "content"}}
<main>
<div id="release" data-id="{{.ID}}">
<div class="release-artwork">
<img src="{{.Artwork}}" alt="" width="256" loading="lazy" id="artwork">
</div>
<div class="release-info">
<h1 class="release-title">
<!-- <input type="text" name="Title" value="{{.Title}}"> -->
<span id="title" editable="true">{{.Title}}</span>
<small>{{.GetReleaseYear}}</small>
</h1>
<table>
<tr>
<td>Artists</td>
<td>{{.PrintArtists true true}}</td>
</tr>
<tr>
<td>Type</td>
<td>
{{$t := .ReleaseType}}
<select name="Type" id="type">
<option value="single" {{if eq $t "single"}}selected{{end}}>
Single
</option>
<option value="album" {{if eq $t "album"}}selected{{end}}>
Album
</option>
<option value="ep" {{if eq $t "ep"}}selected{{end}}>
EP
</option>
<option value="compilation" {{if eq $t "compilation"}}selected{{end}}>
Compilation
</option>
</select>
</td>
</tr>
<tr>
<td>Description</td>
<td>
<textarea
name="Description"
value="{{.Description}}"
placeholder="No description provided."
rows="3"
id="description"
>{{.Description}}</textarea>
</td>
</tr>
<tr>
<td>Release Date</td>
<td>
<input type="datetime-local" name="Release Date" id="release-date" value="{{.TextReleaseDate}}">
</td>
</tr>
<tr>
<td>Buy Name</td>
<td>
<input type="text" name="Buy Name" id="buyname" value="{{.Buyname}}">
</td>
</tr>
<tr>
<td>Buy Link</td>
<td>
<input type="text" name="Buy Link" id="buylink" value="{{.Buylink}}">
</td>
</tr>
<tr>
<td>Visible</td>
<td>
<select name="Visibility" id="visibility">
<option value="true" {{if .Visible}}selected{{end}}>True</option>
<option value="false" {{if not .Visible}}selected{{end}}>False</option>
</select>
</td>
</tr>
</table>
<div class="release-actions">
<a href="/music/{{.ID}}" class="button">Gateway</a>
<button type="submit" class="save" id="save" disabled>Save</button>
</div>
</div>
</div>
<div class="card-title">
<h2>Credits ({{len .Credits}})</h2>
<button id="update-credits" class="edit">Edit</button>
</div>
<div class="card credits">
{{range $Credit := .Credits}}
<div class="credit">
<img src="{{$Credit.Artist.GetAvatar}}" alt="" width="64" loading="lazy" class="artist-avatar">
<div class="credit-info">
<p class="artist-name"><a href="/admin/artists/{{$Credit.Artist.ID}}">{{$Credit.Artist.Name}}</a></p>
<p class="artist-role">
{{$Credit.Role}}
{{if $Credit.Primary}}
<small>(Primary)</small>
{{end}}
</p>
</div>
</div>
{{end}}
{{if not .Credits}}
<p>There are no credits.</p>
{{end}}
</div>
<div class="card-title">
<h2>Tracklist ({{len .Tracks}})</h2>
<button id="update-tracks" class="edit">Edit</button>
</div>
<div class="card tracks">
{{range $Track := .Tracks}}
<div class="track" data-id="{{$Track.ID}}">
<h2 class="track-title">{{$Track.Number}}. {{$Track.Title}}</h2>
<p class="track-id">{{$Track.ID}}</p>
{{if $Track.Description}}
<p class="track-description">{{$Track.Description}}</p>
{{else}}
<p class="track-description empty">No description provided.</p>
{{end}}
{{if $Track.Lyrics}}
<p class="track-lyrics">{{$Track.Lyrics}}</p>
{{else}}
<p class="track-lyrics empty">There are no lyrics.</p>
{{end}}
</div>
{{end}}
</div>
</main>
<script type="module" src="/admin/static/edit-release.js" defer></script>
{{end}}