This commit is contained in:
albert
2012-01-14 17:19:42 -05:00
parent 57e93f8e69
commit 914d2d5b4e
4 changed files with 13 additions and 3 deletions

View File

@@ -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

View File

@@ -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>"