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
9c3935c5
Commit
9c3935c5
authored
Sep 09, 2014
by
Marin Jankovski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use the new path to the partial, move the diff related methods to the new helper.
parent
be4359ef
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
14 deletions
+13
-14
commits_helper.rb
app/helpers/commits_helper.rb
+0
-12
diff_helper.rb
app/helpers/diff_helper.rb
+11
-0
diff.html.haml
app/views/projects/blob/diff.html.haml
+2
-2
No files found.
app/helpers/commits_helper.rb
View file @
9c3935c5
...
...
@@ -31,14 +31,6 @@ module CommitsHelper
escape_javascript
(
render
"projects/commits/
#{
template
}
"
,
commit:
commit
,
project:
project
)
unless
commit
.
nil?
end
def
diff_line_content
(
line
)
if
line
.
blank?
" "
else
line
end
end
# Breadcrumb links for a Project and, if applicable, a tree path
def
commits_breadcrumbs
return
unless
@project
&&
@ref
...
...
@@ -121,10 +113,6 @@ module CommitsHelper
end
end
def
unfold_bottom_class
(
bottom
)
(
bottom
)
?
'js-unfold-bottom'
:
''
end
def
view_file_btn
(
commit_sha
,
diff
,
project
)
link_to
project_blob_path
(
project
,
tree_join
(
commit_sha
,
diff
.
new_path
)),
class:
'btn btn-small view-file js-view-file'
do
...
...
app/helpers/diff_helper.rb
View file @
9c3935c5
...
...
@@ -86,4 +86,15 @@ module DiffHelper
lines
end
def
unfold_bottom_class
(
bottom
)
(
bottom
)
?
'js-unfold-bottom'
:
''
end
def
diff_line_content
(
line
)
if
line
.
blank?
" "
else
line
end
end
end
app/views/projects/blob/diff.html.haml
View file @
9c3935c5
-
if
@lines
.
present?
-
if
@form
.
unfold?
&&
@form
.
since
!=
1
&&
!
@form
.
bottom?
%tr
.line_holder
{
id:
@form
.
since
}
=
render
"projects/
commits/
diffs/match_line"
,
{
line:
@match_line
,
=
render
"projects/diffs/match_line"
,
{
line:
@match_line
,
line_old:
@form
.
since
,
line_new:
@form
.
since
,
bottom:
false
}
-
@lines
.
each_with_index
do
|
line
,
index
|
...
...
@@ -15,5 +15,5 @@
-
if
@form
.
unfold?
&&
@form
.
bottom?
&&
@form
.
to
<
@blob
.
loc
%tr
.line_holder
{
id:
@form
.
to
}
=
render
"projects/
commits/
diffs/match_line"
,
{
line:
@match_line
,
=
render
"projects/diffs/match_line"
,
{
line:
@match_line
,
line_old:
@form
.
to
,
line_new:
@form
.
to
,
bottom:
true
}
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