revamp saved search implementation
This commit is contained in:
@@ -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 = {})
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user