Merge pull request #2297 from evazion/feat-artist-check

Link to artist entries when artist name is taken.
This commit is contained in:
Toks
2014-10-29 00:24:53 -04:00
2 changed files with 15 additions and 4 deletions

View File

@@ -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");
}
}
);

View File

@@ -29,6 +29,10 @@ div#c-artists, div#excerpt {
.hint {
display: block;
}
#check-name-result a {
margin-right: 1em;
}
}
div.recent-posts {