BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
519642af
Commit
519642af
authored
Jun 14, 2016
by
barthc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix clickable code search results
parent
fe32942f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
_blob.html.haml
app/views/search/results/_blob.html.haml
+3
-2
_file_highlight.html.haml
app/views/shared/_file_highlight.html.haml
+2
-1
No files found.
app/views/search/results/_blob.html.haml
View file @
519642af
...
...
@@ -2,9 +2,10 @@
.blob-result
.file-holder
.file-title
=
link_to
namespace_project_blob_path
(
@project
.
namespace
,
@project
,
tree_join
(
blob
.
ref
,
blob
.
filename
),
:anchor
=>
"L"
+
blob
.
startline
.
to_s
)
do
-
blob_path
=
namespace_project_blob_path
(
@project
.
namespace
,
@project
,
tree_join
(
blob
.
ref
,
blob
.
filename
))
=
link_to
blob_path
do
%i
.fa.fa-file
%strong
=
blob
.
filename
.file-content.code.term
=
render
'shared/file_highlight'
,
blob:
blob
,
first_line_number:
blob
.
startline
=
render
'shared/file_highlight'
,
blob:
blob
,
first_line_number:
blob
.
startline
,
blob_path:
blob_path
app/views/shared/_file_highlight.html.haml
View file @
519642af
...
...
@@ -2,11 +2,12 @@
.line-numbers
-
if
blob
.
data
.
present?
-
link_icon
=
icon
(
'link'
)
-
path
=
blob_path
if
defined?
(
blob_path
)
-
blob
.
data
.
each_line
.
each_with_index
do
|
_
,
index
|
-
offset
=
defined?
(
first_line_number
)
?
first_line_number
:
1
-
i
=
index
+
offset
-# We're not using `link_to` because it is too slow once we get to thousands of lines.
%a
.diff-line-num
{
href:
"#L#{i}"
,
id:
"L#{i}"
,
'data-line-number'
=>
i
}
%a
.diff-line-num
{
href:
"#
{path}#
L#{i}"
,
id:
"L#{i}"
,
'data-line-number'
=>
i
}
=
link_icon
=
i
.blob-content
{
data:
{
blob_id:
blob
.
id
}}
...
...
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