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
9a3ed265
Commit
9a3ed265
authored
May 13, 2016
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use `@diff_notes_disabled` instead of `@comments_allowed`
parent
99d3e21f
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
7 additions
and
7 deletions
+7
-7
app/controllers/projects/commit_controller.rb
app/controllers/projects/commit_controller.rb
+0
-1
app/controllers/projects/compare_controller.rb
app/controllers/projects/compare_controller.rb
+1
-0
app/controllers/projects/merge_requests_controller.rb
app/controllers/projects/merge_requests_controller.rb
+1
-1
app/views/projects/diffs/_line.html.haml
app/views/projects/diffs/_line.html.haml
+1
-1
app/views/projects/diffs/_parallel_view.html.haml
app/views/projects/diffs/_parallel_view.html.haml
+3
-3
app/views/projects/diffs/_text_file.html.haml
app/views/projects/diffs/_text_file.html.haml
+1
-1
No files found.
app/controllers/projects/commit_controller.rb
View file @
9a3ed265
...
...
@@ -22,7 +22,6 @@ class Projects::CommitController < Projects::ApplicationController
@note
=
@project
.
build_commit_note
(
commit
)
@notes
=
commit
.
notes
.
non_diff_notes
.
fresh
@noteable
=
@commit
@comments_allowed
=
true
@comments_target
=
{
noteable_type:
'Commit'
,
commit_id:
@commit
.
id
...
...
app/controllers/projects/compare_controller.rb
View file @
9a3ed265
...
...
@@ -22,6 +22,7 @@ class Projects::CompareController < Projects::ApplicationController
@base_commit
=
@project
.
merge_base_commit
(
@base_ref
,
@head_ref
)
@diffs
=
compare
.
diffs
(
diff_options
)
@diff_refs
=
[
@base_commit
,
@commit
]
@diff_notes_disabled
=
true
@grouped_diff_notes
=
{}
end
end
...
...
app/controllers/projects/merge_requests_controller.rb
View file @
9a3ed265
...
...
@@ -73,7 +73,6 @@ class Projects::MergeRequestsController < Projects::ApplicationController
# but we need it for the "View file @ ..." link by deleted files
@base_commit
||=
@merge_request
.
first_commit
.
parent
||
@merge_request
.
first_commit
@comments_allowed
=
true
@comments_target
=
{
noteable_type:
'MergeRequest'
,
noteable_id:
@merge_request
.
id
...
...
@@ -118,6 +117,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController
@commit
=
@merge_request
.
last_commit
@base_commit
=
@merge_request
.
diff_base_commit
@diffs
=
@merge_request
.
compare
.
diffs
(
diff_options
)
if
@merge_request
.
compare
@diff_notes_disabled
=
true
@ci_commit
=
@merge_request
.
ci_commit
@statuses
=
@ci_commit
.
statuses
if
@ci_commit
...
...
app/views/projects/diffs/_line.html.haml
View file @
9a3ed265
...
...
@@ -15,7 +15,7 @@
=
link_text
-
else
=
link_to
""
,
"#
#{
line_code
}
"
,
id:
line_code
,
data:
{
linenumber:
link_text
}
-
if
@comments_allow
ed
&&
can?
(
current_user
,
:create_note
,
@project
)
-
if
!
@diff_notes_disabl
ed
&&
can?
(
current_user
,
:create_note
,
@project
)
=
link_to_new_diff_note
(
line_code
)
%td
.new_line.diff-line-num
{
class:
type
,
data:
{
linenumber:
line
.
new_pos
}
}
-
link_text
=
type
==
"old"
?
" "
.
html_safe
:
line
.
new_pos
...
...
app/views/projects/diffs/_parallel_view.html.haml
View file @
9a3ed265
...
...
@@ -16,7 +16,7 @@
-
else
%td
.old_line.diff-line-num
{
id:
left
[
:line_code
],
class:
"#{left[:type]} #{'empty-cell' if !left[:number]}"
}
=
link_to
raw
(
left
[
:number
]),
"#
#{
left
[
:line_code
]
}
"
,
id:
left
[
:line_code
]
-
if
@comments_allow
ed
&&
can?
(
current_user
,
:create_note
,
@project
)
-
if
!
@diff_notes_disabl
ed
&&
can?
(
current_user
,
:create_note
,
@project
)
=
link_to_new_diff_note
(
left
[
:line_code
],
'old'
)
%td
.line_content
{
class:
"parallel noteable_line #{left[:type]} #{left[:line_code]} #{'empty-cell' if left[:text].empty?}"
,
data:
{
line_code:
left
[
:line_code
]
}}=
diff_line_content
(
left
[
:text
])
...
...
@@ -29,11 +29,11 @@
%td
.new_line.diff-line-num
{
id:
new_line_code
,
class:
"#{new_line_class} #{'empty-cell' if !right[:number]}"
,
data:
{
linenumber:
right
[
:number
]
}}
=
link_to
raw
(
right
[
:number
]),
"#
#{
new_line_code
}
"
,
id:
new_line_code
-
if
@comments_allow
ed
&&
can?
(
current_user
,
:create_note
,
@project
)
-
if
!
@diff_notes_disabl
ed
&&
can?
(
current_user
,
:create_note
,
@project
)
=
link_to_new_diff_note
(
new_line_code
,
'new'
)
%td
.line_content.parallel
{
class:
"noteable_line #{new_line_class} #{new_line_code} #{'empty-cell' if right[:text].empty?}"
,
data:
{
line_code:
new_line_code
}}=
diff_line_content
(
right
[
:text
])
-
if
@comments_allow
ed
-
unless
@diff_notes_disabl
ed
-
notes_left
,
notes_right
=
organize_comments
(
left
,
right
)
-
if
notes_left
.
present?
||
notes_right
.
present?
=
render
"projects/notes/diff_notes_with_reply_parallel"
,
notes_left:
notes_left
,
notes_right:
notes_right
...
...
app/views/projects/diffs/_text_file.html.haml
View file @
9a3ed265
...
...
@@ -11,7 +11,7 @@
-
last_line
=
line
.
new_pos
=
render
"projects/diffs/line"
,
{
line:
line
,
diff_file:
diff_file
,
line_code:
line_code
}
-
if
@comments_allow
ed
-
unless
@diff_notes_disabl
ed
-
diff_notes
=
@grouped_diff_notes
[
line_code
]
-
if
diff_notes
=
render
"projects/notes/diff_notes_with_reply"
,
notes:
diff_notes
...
...
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