fixes #280
This commit is contained in:
@@ -9,7 +9,9 @@ module PostSetPresenters
|
||||
end
|
||||
|
||||
def related_tags
|
||||
if post_set.is_single_tag?
|
||||
if post_set.is_pattern_search?
|
||||
pattern_tags
|
||||
elsif post_set.is_single_tag?
|
||||
related_tags_for_single
|
||||
elsif post_set.is_empty_tag?
|
||||
popular_tags
|
||||
@@ -31,6 +33,10 @@ module PostSetPresenters
|
||||
results
|
||||
end
|
||||
|
||||
def pattern_tags
|
||||
Tag.name_matches(post_set.tag_string).all(:select => "name", :limit => Danbooru.config.tag_query_limit, :order => "post_count DESC").map(&:name)
|
||||
end
|
||||
|
||||
def related_tags_for_group
|
||||
RelatedTagCalculator.calculate_from_sample_to_array(post_set.tag_string).map(&:first)
|
||||
end
|
||||
|
||||
@@ -12,7 +12,7 @@ class TagSetPresenter < Presenter
|
||||
def tag_list_html(template, options = {})
|
||||
html = ""
|
||||
html << "<ul>"
|
||||
@tags.each do |tag|
|
||||
Array(@tags).each do |tag|
|
||||
html << build_list_item(tag, template, options)
|
||||
end
|
||||
html << "</ul>"
|
||||
|
||||
Reference in New Issue
Block a user