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
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
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
14 deletions
+13
-14
app/helpers/commits_helper.rb
app/helpers/commits_helper.rb
+0
-12
app/helpers/diff_helper.rb
app/helpers/diff_helper.rb
+11
-0
app/views/projects/blob/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
...
@@ -31,14 +31,6 @@ module CommitsHelper
escape_javascript
(
render
"projects/commits/
#{
template
}
"
,
commit:
commit
,
project:
project
)
unless
commit
.
nil?
escape_javascript
(
render
"projects/commits/
#{
template
}
"
,
commit:
commit
,
project:
project
)
unless
commit
.
nil?
end
end
def
diff_line_content
(
line
)
if
line
.
blank?
" "
else
line
end
end
# Breadcrumb links for a Project and, if applicable, a tree path
# Breadcrumb links for a Project and, if applicable, a tree path
def
commits_breadcrumbs
def
commits_breadcrumbs
return
unless
@project
&&
@ref
return
unless
@project
&&
@ref
...
@@ -121,10 +113,6 @@ module CommitsHelper
...
@@ -121,10 +113,6 @@ module CommitsHelper
end
end
end
end
def
unfold_bottom_class
(
bottom
)
(
bottom
)
?
'js-unfold-bottom'
:
''
end
def
view_file_btn
(
commit_sha
,
diff
,
project
)
def
view_file_btn
(
commit_sha
,
diff
,
project
)
link_to
project_blob_path
(
project
,
tree_join
(
commit_sha
,
diff
.
new_path
)),
link_to
project_blob_path
(
project
,
tree_join
(
commit_sha
,
diff
.
new_path
)),
class:
'btn btn-small view-file js-view-file'
do
class:
'btn btn-small view-file js-view-file'
do
...
...
app/helpers/diff_helper.rb
View file @
9c3935c5
...
@@ -86,4 +86,15 @@ module DiffHelper
...
@@ -86,4 +86,15 @@ module DiffHelper
lines
lines
end
end
def
unfold_bottom_class
(
bottom
)
(
bottom
)
?
'js-unfold-bottom'
:
''
end
def
diff_line_content
(
line
)
if
line
.
blank?
" "
else
line
end
end
end
end
app/views/projects/blob/diff.html.haml
View file @
9c3935c5
-
if
@lines
.
present?
-
if
@lines
.
present?
-
if
@form
.
unfold?
&&
@form
.
since
!=
1
&&
!
@form
.
bottom?
-
if
@form
.
unfold?
&&
@form
.
since
!=
1
&&
!
@form
.
bottom?
%tr
.line_holder
{
id:
@form
.
since
}
%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
}
line_old:
@form
.
since
,
line_new:
@form
.
since
,
bottom:
false
}
-
@lines
.
each_with_index
do
|
line
,
index
|
-
@lines
.
each_with_index
do
|
line
,
index
|
...
@@ -15,5 +15,5 @@
...
@@ -15,5 +15,5 @@
-
if
@form
.
unfold?
&&
@form
.
bottom?
&&
@form
.
to
<
@blob
.
loc
-
if
@form
.
unfold?
&&
@form
.
bottom?
&&
@form
.
to
<
@blob
.
loc
%tr
.line_holder
{
id:
@form
.
to
}
%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
}
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