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
Jérome Perrin
gitlab-ce
Commits
b91d6802
Commit
b91d6802
authored
Oct 29, 2012
by
Riyad Preukschas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix notes helper
parent
fc1c250d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
7 deletions
+4
-7
app/helpers/notes_helper.rb
app/helpers/notes_helper.rb
+4
-7
No files found.
app/helpers/notes_helper.rb
View file @
b91d6802
...
@@ -9,16 +9,13 @@ module NotesHelper
...
@@ -9,16 +9,13 @@ module NotesHelper
# Helps to distinguish e.g. commit notes in mr notes list
# Helps to distinguish e.g. commit notes in mr notes list
def
note_for_main_target?
(
note
)
def
note_for_main_target?
(
note
)
!
@mixed_targets
||
@main_target_type
==
note
.
noteable_type
!
@mixed_targets
||
(
@main_target_type
==
note
.
noteable_type
&&
!
note
.
for_diff_line?
)
end
end
def
link_to_commit_diff_line_note
(
note
)
def
link_to_commit_diff_line_note
(
note
)
commit
=
note
.
noteable
if
note
.
for_commit_diff_line?
diff_index
,
diff_old_line
,
diff_new_line
=
note
.
line_code
.
split
(
'_'
)
link_to
"
#{
note
.
diff_file_name
}
:L
#{
note
.
diff_new_line
}
"
,
project_commit_path
(
@project
,
note
.
noteable
,
anchor:
note
.
line_code
)
end
link_file
=
commit
.
diffs
[
diff_index
.
to_i
].
new_path
link_line
=
diff_new_line
link_to
"
#{
link_file
}
:L
#{
link_line
}
"
,
project_commit_path
(
@project
,
commit
,
anchor:
note
.
line_code
)
end
end
end
end
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