mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: displays groups in menu search (#7090)
This commit is contained in:
@@ -598,6 +598,7 @@ class Search
|
||||
user_search if @term.present?
|
||||
category_search if @term.present?
|
||||
tags_search if @term.present?
|
||||
groups_search if @term.present?
|
||||
end
|
||||
topic_search
|
||||
end
|
||||
@@ -683,6 +684,14 @@ class Search
|
||||
end
|
||||
end
|
||||
|
||||
def groups_search
|
||||
groups = Group
|
||||
.visible_groups(@guardian.user, "name ASC", include_everyone: false)
|
||||
.where("groups.name ILIKE ?", "%#{@term}%")
|
||||
|
||||
groups.each { |group| @results.add(group) }
|
||||
end
|
||||
|
||||
def tags_search
|
||||
return unless SiteSetting.tagging_enabled
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ class Search
|
||||
:categories,
|
||||
:users,
|
||||
:tags,
|
||||
:groups,
|
||||
:more_posts,
|
||||
:more_categories,
|
||||
:more_users,
|
||||
@@ -36,6 +37,7 @@ class Search
|
||||
@categories = []
|
||||
@users = []
|
||||
@tags = []
|
||||
@groups = []
|
||||
end
|
||||
|
||||
def find_user_data(guardian)
|
||||
|
||||
Reference in New Issue
Block a user