This commit is contained in:
2026-08-23 14:13:18 -05:00
parent 789bf91eed
commit 866f243f1b
37 changed files with 1761 additions and 58 deletions
+50
View File
@@ -0,0 +1,50 @@
{{define "admin_artist_edit"}}{{template "header" .}}
<div class="card" style="max-width: 500px;">
<div class="card-body">
<h2 class="h6">Edit artist</h2>
<form method="post" action="/admin/artists/{{.Data.ID}}/edit" enctype="multipart/form-data">
{{template "csrf_field" .CSRFToken}}
<div class="mb-2">
<label class="form-label small">Name</label>
<input type="text" name="name" class="form-control form-control-sm" value="{{.Data.Name}}" required>
</div>
<div class="mb-2">
<label class="form-label small">Sort name</label>
<input type="text" name="sort_name" class="form-control form-control-sm" value="{{.Data.SortName}}">
</div>
<div class="mb-3">
<label class="form-label small">Biography</label>
<textarea name="bio" class="form-control form-control-sm" rows="4">{{.Data.Bio}}</textarea>
</div>
<hr>
<h3 class="h6">Photo</h3>
{{if .Data.CoverArtID.Valid}}
<img src="/cover-art/{{.Data.CoverArtID.String}}?size=150" style="width:100px;height:100px;border-radius:50%;object-fit:cover;" class="mb-2" alt="">
{{end}}
{{if .Data.PhotoManual}}
<p class="small text-body-secondary">This photo was set manually and will not be replaced by auto-fetch.</p>
<div class="form-check mb-2">
<input class="form-check-input" type="checkbox" name="remove_photo" value="1" id="remove_photo">
<label class="form-check-label" for="remove_photo">Remove custom photo (revert to auto-fetch)</label>
</div>
{{else}}
<p class="small text-body-secondary">No custom photo set{{if not .Data.MusicBrainzID}} (this artist has no MusicBrainz ID, so auto-fetch cannot run){{end}}.</p>
{{end}}
<div class="mb-2">
<label class="form-label small">Upload a photo</label>
<input type="file" name="photo_file" class="form-control form-control-sm" accept="image/*">
</div>
<div class="mb-3">
<label class="form-label small">...or set a photo URL</label>
<input type="url" name="photo_url" class="form-control form-control-sm" placeholder="https://example.com/photo.jpg">
</div>
<div class="mt-3">
<button type="submit" class="btn btn-primary btn-sm">Save</button>
<a href="/artists/{{.Data.ID}}" class="btn btn-sm btn-outline-secondary">Cancel</a>
</div>
</form>
</div>
</div>
{{template "footer" .}}{{end}}