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
Tatuya Kamada
gitlab-ce
Commits
41d05fa8
Commit
41d05fa8
authored
Feb 14, 2017
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed alignment of snippet search results
Also enabled syntaax highlight on the search results Closes #26832
parent
f802ad37
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
31 deletions
+28
-31
app/views/search/results/_snippet_blob.html.haml
app/views/search/results/_snippet_blob.html.haml
+24
-31
changelogs/unreleased/snippets-search.yml
changelogs/unreleased/snippets-search.yml
+4
-0
No files found.
app/views/search/results/_snippet_blob.html.haml
View file @
41d05fa8
...
...
@@ -12,41 +12,34 @@
%span
.light
=
time_ago_with_tooltip
(
snippet
.
created_at
)
%h4
.snippet-title
-
snippet_path
=
reliable_snippet_path
(
snippet
)
=
link_to
snippet_path
do
.
file-holder
.js-file-title.file-title
.file-holder
.
js-file-title.file-title
=
link_to
snippet_path
do
%i
.fa.fa-file
%strong
=
snippet
.
file_name
-
if
markup?
(
snippet
.
file_name
)
.file-content.wiki
-
if
markup?
(
snippet
.
file_name
)
.file-content.wiki
-
snippet_chunks
.
each
do
|
chunk
|
-
unless
chunk
[
:data
].
empty?
=
render_markup
(
snippet
.
file_name
,
chunk
[
:data
])
-
else
.file-content.code
.nothing-here-block
Empty file
-
else
.file-content.code.js-syntax-highlight
.line-numbers
-
snippet_chunks
.
each
do
|
chunk
|
-
unless
chunk
[
:data
].
empty?
=
render_markup
(
snippet
.
file_name
,
chunk
[
:data
])
-
Gitlab
::
Git
::
Util
.
count_lines
(
chunk
[
:data
]).
times
do
|
index
|
-
offset
=
defined?
(
chunk
[
:start_line
])
?
chunk
[
:start_line
]
:
1
-
i
=
index
+
offset
=
link_to
snippet_path
+
"#L
#{
i
}
"
,
id:
"L
#{
i
}
"
,
rel:
"#L
#{
i
}
"
,
class:
"diff-line-num"
do
%i
.fa.fa-link
=
i
.blob-content
-
snippet_chunks
.
each
do
|
chunk
|
-
unless
chunk
[
:data
].
empty?
=
highlight
(
snippet
.
file_name
,
chunk
[
:data
],
repository:
nil
,
plain:
snippet
.
no_highlighting?
)
-
else
.file-content.code
.nothing-here-block
Empty file
-
else
.file-content.code.js-syntax-highlight
.line-numbers
-
snippet_chunks
.
each
do
|
chunk
|
-
unless
chunk
[
:data
].
empty?
-
Gitlab
::
Git
::
Util
.
count_lines
(
chunk
[
:data
]).
times
do
|
index
|
-
offset
=
defined?
(
chunk
[
:start_line
])
?
chunk
[
:start_line
]
:
1
-
i
=
index
+
offset
=
link_to
snippet_path
+
"#L
#{
i
}
"
,
id:
"L
#{
i
}
"
,
rel:
"#L
#{
i
}
"
,
class:
"diff-line-num"
do
%i
.fa.fa-link
=
i
-
unless
snippet
==
snippet_chunks
.
last
%a
.diff-line-num
=
"."
%pre
.code
%code
-
snippet_chunks
.
each
do
|
chunk
|
-
unless
chunk
[
:data
].
empty?
=
chunk
[
:data
]
-
unless
chunk
==
snippet_chunks
.
last
%a
=
"..."
-
else
.file-content.code
.nothing-here-block
Empty file
changelogs/unreleased/snippets-search.yml
0 → 100644
View file @
41d05fa8
---
title
:
Fix snippets search result spacing
merge_request
:
author
:
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