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
Kazuhiko Shiozaki
gitlab-ce
Commits
8366ce36
Commit
8366ce36
authored
Oct 01, 2015
by
Robert Speicher
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'rs-update-note' into 'master'
Ensure updated notes are syntax highlighted See merge request !1444
parents
529cf138
b35dd6b9
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
9 deletions
+14
-9
CHANGELOG
CHANGELOG
+1
-0
app/assets/javascripts/notes.js.coffee
app/assets/javascripts/notes.js.coffee
+9
-7
app/models/note.rb
app/models/note.rb
+1
-1
app/views/projects/notes/_note.html.haml
app/views/projects/notes/_note.html.haml
+3
-1
No files found.
CHANGELOG
View file @
8366ce36
...
@@ -25,6 +25,7 @@ v 8.1.0 (unreleased)
...
@@ -25,6 +25,7 @@ v 8.1.0 (unreleased)
- Add support of multibyte characters in LDAP UID (Roman Petrov)
- Add support of multibyte characters in LDAP UID (Roman Petrov)
- Show additions/deletions stats on merge request diff
- Show additions/deletions stats on merge request diff
- Remove footer text in emails (Zeger-Jan van de Weg)
- Remove footer text in emails (Zeger-Jan van de Weg)
- Ensure code blocks are properly highlighted after a note is updated
v 8.0.3
v 8.0.3
- Fix URL shown in Slack notifications
- Fix URL shown in Slack notifications
...
...
app/assets/javascripts/notes.js.coffee
View file @
8366ce36
...
@@ -277,13 +277,15 @@ class @Notes
...
@@ -277,13 +277,15 @@ class @Notes
Updates the current note field.
Updates the current note field.
###
###
updateNote
:
(
xhr
,
note
,
status
)
=>
updateNote
:
(
_xhr
,
note
,
_status
)
=>
note_li
=
$
(
".note-row-"
+
note
.
id
)
# Convert returned HTML to a jQuery object so we can modify it further
note_li
.
replaceWith
(
note
.
html
)
$html
=
$
(
note
.
html
)
note_li
.
find
(
'.note-edit-form'
).
hide
()
$html
.
syntaxHighlight
()
note_li
.
find
(
'.note-body > .note-text'
).
show
()
$html
.
find
(
'.js-task-list-container'
).
taskList
(
'enable'
)
note_li
.
find
(
'js-task-list-container'
).
taskList
(
'enable'
)
@
enableTaskList
()
# Find the note's `li` element by ID and replace it with the updated HTML
$note_li
=
$
(
"#note_
#{
note
.
id
}
"
)
$note_li
.
replaceWith
(
$html
)
###
###
Called in response to clicking the edit note link
Called in response to clicking the edit note link
...
...
app/models/note.rb
View file @
8366ce36
...
@@ -366,6 +366,6 @@ class Note < ActiveRecord::Base
...
@@ -366,6 +366,6 @@ class Note < ActiveRecord::Base
end
end
def
editable?
def
editable?
!
read_attribute
(
:system
)
!
system
?
end
end
end
end
app/views/projects/notes/_note.html.haml
View file @
8366ce36
...
@@ -59,6 +59,8 @@
...
@@ -59,6 +59,8 @@
.note-text
.note-text
=
preserve
do
=
preserve
do
=
markdown
(
note
.
note
,
{
no_header_anchors:
true
})
=
markdown
(
note
.
note
,
{
no_header_anchors:
true
})
-
unless
note
.
system?
-# System notes can't be edited
=
render
'projects/notes/edit_form'
,
note:
note
=
render
'projects/notes/edit_form'
,
note:
note
-
if
note
.
attachment
.
url
-
if
note
.
attachment
.
url
...
...
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