Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
5a45b54f
Commit
5a45b54f
authored
Aug 15, 2018
by
Alexis Reigel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
search results: show user's status emoji
parent
40962ac4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
app/controllers/search_controller.rb
app/controllers/search_controller.rb
+5
-0
app/views/search/results/_user.html.haml
app/views/search/results/_user.html.haml
+3
-1
No files found.
app/controllers/search_controller.rb
View file @
5a45b54f
...
...
@@ -29,6 +29,7 @@ class SearchController < ApplicationController
@search_objects
=
search_service
.
search_objects
render_commits
if
@scope
==
'commits'
eager_load_user_status
if
@scope
==
'users'
check_single_commit_result
end
...
...
@@ -54,6 +55,10 @@ class SearchController < ApplicationController
@search_objects
=
prepare_commits_for_rendering
(
@search_objects
)
end
def
eager_load_user_status
@search_objects
=
@search_objects
.
eager_load
(
:status
)
# rubocop:disable CodeReuse/ActiveRecord
end
def
check_single_commit_result
if
@search_results
.
single_commit_result?
only_commit
=
@search_results
.
objects
(
'commits'
).
first
...
...
app/views/search/results/_user.html.haml
View file @
5a45b54f
...
...
@@ -4,5 +4,7 @@
=
user_avatar
(
user:
user
,
user_name:
user
.
name
,
css_class:
'd-none d-sm-inline avatar s40'
)
.user-info
=
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment