Commit 5a45b54f authored by Alexis Reigel's avatar Alexis Reigel

search results: show user's status emoji

parent 40962ac4
...@@ -29,6 +29,7 @@ class SearchController < ApplicationController ...@@ -29,6 +29,7 @@ class SearchController < ApplicationController
@search_objects = search_service.search_objects @search_objects = search_service.search_objects
render_commits if @scope == 'commits' render_commits if @scope == 'commits'
eager_load_user_status if @scope == 'users'
check_single_commit_result check_single_commit_result
end end
...@@ -54,6 +55,10 @@ class SearchController < ApplicationController ...@@ -54,6 +55,10 @@ class SearchController < ApplicationController
@search_objects = prepare_commits_for_rendering(@search_objects) @search_objects = prepare_commits_for_rendering(@search_objects)
end end
def eager_load_user_status
@search_objects = @search_objects.eager_load(:status) # rubocop:disable CodeReuse/ActiveRecord
end
def check_single_commit_result def check_single_commit_result
if @search_results.single_commit_result? if @search_results.single_commit_result?
only_commit = @search_results.objects('commits').first only_commit = @search_results.objects('commits').first
......
...@@ -4,5 +4,7 @@ ...@@ -4,5 +4,7 @@
= user_avatar(user: user, user_name: user.name, css_class: 'd-none d-sm-inline avatar s40') = user_avatar(user: user, user_name: user.name, css_class: 'd-none d-sm-inline avatar s40')
.user-info .user-info
= link_to user_path(user), class: 'd-none d-sm-inline' do = link_to user_path(user), class: 'd-none d-sm-inline' do
.item-title= user.name .item-title
= user.name
= user_status(user)
.cgray= user.to_reference .cgray= user.to_reference
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment