- {{$track.Add $i 1}}
+ {{.Add $i 1}}
{{$track.Title}}
Delete
diff --git a/admin/releasehttp.go b/admin/releasehttp.go
index 7d098e6..cd73e98 100644
--- a/admin/releasehttp.go
+++ b/admin/releasehttp.go
@@ -145,7 +145,16 @@ func serveEditLinks(release *model.Release) http.Handler {
func serveEditTracks(release *model.Release) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "text/html")
- err := components["edittracks"].Execute(w, release)
+
+ type editTracksData struct {
+ Release *model.Release
+ Add func(a int, b int) int
+ }
+
+ err := components["edittracks"].Execute(w, editTracksData{
+ Release: release,
+ Add: func(a, b int) int { return a + b },
+ })
if err != nil {
fmt.Printf("Error rendering edit tracks component for %s: %s\n", release.ID, err)
http.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError)
diff --git a/admin/static/admin.css b/admin/static/admin.css
index a6e0bc2..877b5da 100644
--- a/admin/static/admin.css
+++ b/admin/static/admin.css
@@ -206,13 +206,13 @@ form {
width: 100%;
display: block;
}
-label {
+form label {
width: 100%;
margin: 1rem 0 .5rem 0;
display: block;
color: #10101080;
}
-input {
+form input {
margin: .5rem 0;
padding: .3rem .5rem;
display: block;
diff --git a/admin/static/edit-account.css b/admin/static/edit-account.css
index 37351b2..7a4d34a 100644
--- a/admin/static/edit-account.css
+++ b/admin/static/edit-account.css
@@ -5,10 +5,11 @@ div.card {
}
label {
- width: 100%;
- margin: 1rem 0 .5rem 0;
- display: block;
- color: #10101080;
+ width: auto;
+ margin: 0;
+ display: flex;
+ align-items: center;
+ color: inherit;
}
input {
width: min(20rem, calc(100% - 1rem));
diff --git a/admin/static/edit-release.css b/admin/static/edit-release.css
index 63d399e..aa70e34 100644
--- a/admin/static/edit-release.css
+++ b/admin/static/edit-release.css
@@ -228,12 +228,14 @@ dialog div.dialog-actions {
}
#editcredits .credit .credit-info .credit-attribute label {
+ width: auto;
+ margin: 0;
display: flex;
align-items: center;
}
#editcredits .credit .credit-info .credit-attribute input[type="text"] {
- margin-left: .25em;
+ margin: 0 0 0 .25em;
padding: .2em .4em;
flex-grow: 1;
font-family: inherit;
@@ -241,6 +243,9 @@ dialog div.dialog-actions {
border-radius: 4px;
color: inherit;
}
+#editcredits .credit .credit-info .credit-attribute input[type="checkbox"] {
+ margin: 0 .3em;
+}
#editcredits .credit .artist-name {
font-weight: bold;
@@ -369,8 +374,10 @@ dialog div.dialog-actions {
#editlinks td input[type="text"] {
width: calc(100% - .6em);
height: 100%;
+ margin: 0;
padding: 0 .3em;
border: none;
+ border-radius: 0;
outline: none;
cursor: pointer;
background: none;
diff --git a/model/track.go b/model/track.go
index d44c224..ca54ddd 100644
--- a/model/track.go
+++ b/model/track.go
@@ -12,6 +12,8 @@ type (
Description string `json:"description"`
Lyrics string `json:"lyrics" db:"lyrics"`
PreviewURL string `json:"previewURL" db:"preview_url"`
+
+ Number int
}
)