fixes #1359
This commit is contained in:
@@ -112,13 +112,17 @@
|
||||
}
|
||||
if (Danbooru.RelatedTag.recent_artists) {
|
||||
var tags = [];
|
||||
if (Danbooru.RelatedTag.recent_artists.length !== 1) {
|
||||
if (Danbooru.RelatedTag.recent_artists.length === 0) {
|
||||
tags.push([" none", 0]);
|
||||
} else {
|
||||
} else if (Danbooru.RelatedTag.recent_artists.length === 1) {
|
||||
tags.push([Danbooru.RelatedTag.recent_artists[0].name, 1]);
|
||||
$.each(Danbooru.RelatedTag.recent_artists[0].urls, function(i, url) {
|
||||
tags.push([" " + url.url, 0]);
|
||||
});
|
||||
} else {
|
||||
$.each(Danbooru.RelatedTag.recent_artists, function(i, artist) {
|
||||
tags.push([artist.name, 1]);
|
||||
});
|
||||
}
|
||||
$dest.append(Danbooru.RelatedTag.build_html("artist", tags, true));
|
||||
}
|
||||
@@ -212,7 +216,7 @@
|
||||
Danbooru.RelatedTag.find_artist = function(e) {
|
||||
$("#artist-tags").html("<em>Loading...</em>");
|
||||
var url = $("#upload_source,#post_source");
|
||||
$.get("/artists.json", {"limit": 2, "search[name]": url.val()}).success(Danbooru.RelatedTag.process_artist);
|
||||
$.get("/artists.json", {"limit": 20, "search[name]": url.val()}).success(Danbooru.RelatedTag.process_artist);
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
|
||||
@@ -250,6 +250,9 @@ class Artist < ActiveRecord::Base
|
||||
when /status:banned/
|
||||
q = q.banned
|
||||
|
||||
when /status:active/
|
||||
q = q.where("is_banned = false and is_deleted = false")
|
||||
|
||||
when /./
|
||||
q = q.any_name_matches(params[:name])
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user