Merge pull request #2297 from evazion/feat-artist-check
Link to artist entries when artist name is taken.
This commit is contained in:
@@ -55,11 +55,18 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
$.get("/artists.json?name=" + artist_name,
|
$.get("/artists.json?name=" + artist_name,
|
||||||
function(data) {
|
function(artists) {
|
||||||
if (data.length) {
|
$("check-name-result").empty();
|
||||||
$("#check-name-result").html("Taken");
|
|
||||||
|
if (artists.length) {
|
||||||
|
$("#check-name-result").text("Taken: ");
|
||||||
|
|
||||||
|
$.map(artists.slice(0, 5), function (artist) {
|
||||||
|
var link = $("<a>").attr("href", "/artists/" + artist.id).text(artist.name);
|
||||||
|
$("#check-name-result").append(link);
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
$("#check-name-result").html("OK");
|
$("#check-name-result").text("OK");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -29,6 +29,10 @@ div#c-artists, div#excerpt {
|
|||||||
.hint {
|
.hint {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#check-name-result a {
|
||||||
|
margin-right: 1em;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
div.recent-posts {
|
div.recent-posts {
|
||||||
|
|||||||
Reference in New Issue
Block a user