gitlab-org--gitlab-foss/app/views/notes/create.js.haml

19 lines
735 B
Text
Raw Normal View History

- if @note.valid?
var noteHtml = "#{escape_javascript(render "notes/note", note: @note)}";
- if note_for_main_target?(@note)
2013-03-19 06:34:14 -04:00
NoteList.appendNewNote(#{@note.id}, noteHtml);
- else
2012-12-03 14:35:09 -05:00
:plain
var firstDiscussionNoteHtml = "#{escape_javascript(render "notes/diff_notes_with_reply", notes: [@note])}";
NoteList.appendNewDiscussionNote("#{@note.discussion_id}",
firstDiscussionNoteHtml,
noteHtml);
2012-12-02 14:43:39 -05:00
- else
2012-12-03 14:35:09 -05:00
var errorsHtml = "#{escape_javascript(render 'notes/form_errors', note: @note)}";
- if note_for_main_target?(@note)
NoteList.errorsOnForm(errorsHtml);
- else
2013-03-19 06:34:14 -04:00
NoteList.errorsOnForm(errorsHtml, "#{@note.discussion_id}");