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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
5ab95ba6
Commit
5ab95ba6
authored
Jul 06, 2016
by
Luke "Jared" Bennett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
review changes
parent
c6abeffe
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
app/assets/javascripts/files_comment_button.js.coffee
app/assets/javascripts/files_comment_button.js.coffee
+7
-5
app/views/projects/diffs/_diffs.html.haml
app/views/projects/diffs/_diffs.html.haml
+1
-1
No files found.
app/assets/javascripts/files_comment_button.js.coffee
View file @
5ab95ba6
class
@
FilesCommentButton
class
@
FilesCommentButton
constructor
:
(
@
filesContainerElement
)
->
constructor
:
(
@
filesContainerElement
)
->
return
if
not
@
filesContainerElement
return
unless
@
filesContainerElement
return
if
not
@
filesContainerElement
.
data
'can-create-note'
return
if
_
.
isUndefined
@
filesContainerElement
.
data
'can-create-note'
@
COMMENT_BUTTON_CLASS
=
'.add-diff-note'
@
COMMENT_BUTTON_CLASS
=
'.add-diff-note'
@
COMMENT_BUTTON_TEMPLATE
=
_
.
template
(
"<button name='button' type='submit' class='btn <%- COMMENT_BUTTON_CLASS %> js-add-diff-note-button' title='Add a comment to this line'><i class='fa fa-comment-o'></i></button>"
)
@
COMMENT_BUTTON_TEMPLATE
=
_
.
template
'<button name="button" type="submit" class="btn <%- COMMENT_BUTTON_CLASS %> js-add-diff-note-button" title="Add a comment to this line"><i class="fa fa-comment-o"></i></button>'
@
LINE_HOLDER_CLASS
=
'.line_holder'
@
LINE_HOLDER_CLASS
=
'.line_holder'
@
LINE_NUMBER_CLASS
=
'diff-line-num'
@
LINE_NUMBER_CLASS
=
'diff-line-num'
...
@@ -37,7 +37,7 @@ class @FilesCommentButton
...
@@ -37,7 +37,7 @@ class @FilesCommentButton
lineContentElement
=
@
getLineContent
(
currentTarget
)
lineContentElement
=
@
getLineContent
(
currentTarget
)
buttonParentElement
=
@
getButtonParent
(
currentTarget
)
buttonParentElement
=
@
getButtonParent
(
currentTarget
)
return
if
not
@
shouldRender
e
,
buttonParentElement
return
unless
@
shouldRender
e
,
buttonParentElement
buttonParentElement
.
append
@
buildButton
buttonParentElement
.
append
@
buildButton
id
:
id
:
...
@@ -58,7 +58,9 @@ class @FilesCommentButton
...
@@ -58,7 +58,9 @@ class @FilesCommentButton
return
return
buildButton
:
(
buttonAttributes
)
->
buildButton
:
(
buttonAttributes
)
->
$
(
@
COMMENT_BUTTON_TEMPLATE
COMMENT_BUTTON_CLASS
:
@
COMMENT_BUTTON_CLASS
.
substr
1
).
attr
initializedButtonTemplate
=
@
COMMENT_BUTTON_TEMPLATE
COMMENT_BUTTON_CLASS
:
@
COMMENT_BUTTON_CLASS
.
substr
1
$
(
initializedButtonTemplate
).
attr
'data-noteable-id'
:
buttonAttributes
.
id
.
noteable
'data-noteable-id'
:
buttonAttributes
.
id
.
noteable
'data-commit-id'
:
buttonAttributes
.
id
.
commit
'data-commit-id'
:
buttonAttributes
.
id
.
commit
'data-discussion-id'
:
buttonAttributes
.
id
.
discussion
'data-discussion-id'
:
buttonAttributes
.
id
.
discussion
...
...
app/views/projects/diffs/_diffs.html.haml
View file @
5ab95ba6
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
-
if
diff_files
.
overflow?
-
if
diff_files
.
overflow?
=
render
'projects/diffs/warning'
,
diff_files:
diff_files
=
render
'projects/diffs/warning'
,
diff_files:
diff_files
.files
{
data:
{
can_create_note:
(
!
@diff_notes_disabled
&&
can?
(
current_user
,
:create_note
,
@project
))
.
to_s
}}
.files
{
data:
{
can_create_note:
(
!
@diff_notes_disabled
&&
can?
(
current_user
,
:create_note
,
@project
))}}
-
diff_files
.
each_with_index
do
|
diff_file
,
index
|
-
diff_files
.
each_with_index
do
|
diff_file
,
index
|
-
diff_commit
=
commit_for_diff
(
diff_file
)
-
diff_commit
=
commit_for_diff
(
diff_file
)
-
blob
=
project
.
repository
.
blob_for_diff
(
diff_commit
,
diff_file
)
-
blob
=
project
.
repository
.
blob_for_diff
(
diff_commit
,
diff_file
)
...
...
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