revamp saved search implementation

This commit is contained in:
r888888888
2017-03-15 15:36:48 -07:00
parent 79c0dc3647
commit da06bee0ab
24 changed files with 307 additions and 257 deletions

View File

@@ -12,7 +12,7 @@ module PostSetPresenters
if post_set.is_pattern_search?
pattern_tags
elsif post_set.is_saved_search?
SavedSearch.categories_for(CurrentUser.user).map {|x| "search:#{x}"}
SavedSearch.labels_for(CurrentUser.user.id).map {|x| "search:#{x}"}
elsif post_set.is_tag_subscription?
post_set.tag_subscription_tags
elsif post_set.is_single_tag?
@@ -56,8 +56,8 @@ module PostSetPresenters
RelatedTagCalculator.calculate_from_post_set_to_array(post_set).map(&:first)
end
def saved_search_tags
SavedSearch.categories_for(CurrentUser.user).map {|x| "search:#{x}"}
def saved_search_labels
SavedSearch.labels_for(CurrentUser.user.id).map {|x| "search:#{x}"}
end
def tag_list_html(template, options = {})

View File

@@ -221,9 +221,9 @@ class UserPresenter
end
end
def saved_search_categories
def saved_search_labels
if CurrentUser.user.id == user.id
user.unique_saved_search_categories
SavedSearch.labels_for(CurrentUser.user.id)
else
[]
end