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
Boxiang Sun
gitlab-ce
Commits
0f0a96ab
Commit
0f0a96ab
authored
Jun 24, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'mr-improve-comments' into 'master'
Improve merge request comments Fixes #1338
parents
14bc7e05
30912c75
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
3 deletions
+20
-3
app/assets/javascripts/notes.js.coffee
app/assets/javascripts/notes.js.coffee
+9
-2
app/controllers/projects/notes_controller.rb
app/controllers/projects/notes_controller.rb
+11
-1
No files found.
app/assets/javascripts/notes.js.coffee
View file @
0f0a96ab
...
@@ -142,8 +142,15 @@ class Notes
...
@@ -142,8 +142,15 @@ class Notes
# remove the note (will be added again below)
# remove the note (will be added again below)
row
.
next
().
find
(
".note"
).
remove
()
row
.
next
().
find
(
".note"
).
remove
()
# append new note to all matching discussions
# Add note to 'Changes' page discussions
$
(
".notes[rel='"
+
note
.
discussion_id
+
"']"
).
append
note
.
html
$
(
".notes[rel='"
+
note
.
discussion_id
+
"']"
).
append
note
.
html
# Init discussion on 'Discussion' page
$
(
'ul.main-notes-list'
).
append
(
note
.
discussion_with_diff_html
)
else
# append new note to all matching discussions
$
(
".notes[rel='"
+
note
.
discussion_id
+
"']"
).
append
note
.
html
# cleanup after successfully creating a diff/discussion note
# cleanup after successfully creating a diff/discussion note
@
removeDiscussionNoteForm
(
form
)
@
removeDiscussionNoteForm
(
form
)
...
...
app/controllers/projects/notes_controller.rb
View file @
0f0a96ab
...
@@ -85,12 +85,22 @@ class Projects::NotesController < Projects::ApplicationController
...
@@ -85,12 +85,22 @@ class Projects::NotesController < Projects::ApplicationController
)
)
end
end
def
note_to_discussion_with_diff_html
(
note
)
render_to_string
(
"projects/notes/_discussion"
,
layout:
false
,
formats:
[
:html
],
locals:
{
discussion_notes:
[
note
]
}
)
end
def
render_note_json
(
note
)
def
render_note_json
(
note
)
render
json:
{
render
json:
{
id:
note
.
id
,
id:
note
.
id
,
discussion_id:
note
.
discussion_id
,
discussion_id:
note
.
discussion_id
,
html:
note_to_html
(
note
),
html:
note_to_html
(
note
),
discussion_html:
note_to_discussion_html
(
note
)
discussion_html:
note_to_discussion_html
(
note
),
discussion_with_diff_html:
note_to_discussion_with_diff_html
(
note
)
}
}
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