BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
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
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
3 deletions
+20
-3
notes.js.coffee
app/assets/javascripts/notes.js.coffee
+9
-2
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
# remove the note (will be added again below)
row
.
next
().
find
(
".note"
).
remove
()
# append new note to all matching discussions
$
(
".notes[rel='"
+
note
.
discussion_id
+
"']"
).
append
note
.
html
# Add note to 'Changes' page discussions
$
(
".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
@
removeDiscussionNoteForm
(
form
)
...
...
app/controllers/projects/notes_controller.rb
View file @
0f0a96ab
...
...
@@ -85,12 +85,22 @@ class Projects::NotesController < Projects::ApplicationController
)
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
)
render
json:
{
id:
note
.
id
,
discussion_id:
note
.
discussion_id
,
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
...
...
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