diff --git a/app/assets/javascripts/discourse/widgets/search-menu-results.js.es6 b/app/assets/javascripts/discourse/widgets/search-menu-results.js.es6 index 56ac661370b..1d190fc7c8b 100644 --- a/app/assets/javascripts/discourse/widgets/search-menu-results.js.es6 +++ b/app/assets/javascripts/discourse/widgets/search-menu-results.js.es6 @@ -46,7 +46,7 @@ function postResult(result, link, term) { } createSearchResult('user', 'path', function(u) { - return [ avatarImg('small', { template: u.avatar_template, username: u.username }), ' ', u.username ]; + return [ avatarImg('small', { template: u.avatar_template, username: u.username }), ' ', h('span.user-results', h('b', u.username)), ' ', h('span.user-results', u.name ? u.name : '') ]; }); createSearchResult('topic', 'url', function(result, term) { diff --git a/app/assets/stylesheets/common/base/menu-panel.scss b/app/assets/stylesheets/common/base/menu-panel.scss index 64851b6bb46..deb79628d5c 100644 --- a/app/assets/stylesheets/common/base/menu-panel.scss +++ b/app/assets/stylesheets/common/base/menu-panel.scss @@ -184,6 +184,10 @@ display: block; padding: 5px; transition: all linear .15s; + + .user-results { + color: dark-light-choose(scale-color($primary, $lightness: 30%), scale-color($secondary, $lightness: 70%)); + } } &:hover a:not(.badge-notification) { diff --git a/app/serializers/grouped_search_result_serializer.rb b/app/serializers/grouped_search_result_serializer.rb index 721567d3d58..ff216c8a232 100644 --- a/app/serializers/grouped_search_result_serializer.rb +++ b/app/serializers/grouped_search_result_serializer.rb @@ -1,6 +1,6 @@ class GroupedSearchResultSerializer < ApplicationSerializer has_many :posts, serializer: SearchPostSerializer - has_many :users, serializer: BasicUserSerializer + has_many :users, serializer: SearchResultUserSerializer has_many :categories, serializer: BasicCategorySerializer attributes :more_posts, :more_users, :more_categories end diff --git a/app/serializers/search_result_user_serializer.rb b/app/serializers/search_result_user_serializer.rb new file mode 100644 index 00000000000..bf4d4bae8ec --- /dev/null +++ b/app/serializers/search_result_user_serializer.rb @@ -0,0 +1,3 @@ +class SearchResultUserSerializer < BasicUserSerializer + attributes :name +end