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,
|
||||
function(data) {
|
||||
if (data.length) {
|
||||
$("#check-name-result").html("Taken");
|
||||
function(artists) {
|
||||
$("check-name-result").empty();
|
||||
|
||||
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 {
|
||||
$("#check-name-result").html("OK");
|
||||
$("#check-name-result").text("OK");
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
@@ -29,6 +29,10 @@ div#c-artists, div#excerpt {
|
||||
.hint {
|
||||
display: block;
|
||||
}
|
||||
|
||||
#check-name-result a {
|
||||
margin-right: 1em;
|
||||
}
|
||||
}
|
||||
|
||||
div.recent-posts {
|
||||
|
||||
Reference in New Issue
Block a user