gitlab-org--gitlab-foss/app/views/notes/create.js.haml
2013-03-19 12:34:14 +02:00

18 lines
735 B
Text

- if @note.valid?
var noteHtml = "#{escape_javascript(render "notes/note", note: @note)}";
- if note_for_main_target?(@note)
NoteList.appendNewNote(#{@note.id}, noteHtml);
- else
:plain
var firstDiscussionNoteHtml = "#{escape_javascript(render "notes/diff_notes_with_reply", notes: [@note])}";
NoteList.appendNewDiscussionNote("#{@note.discussion_id}",
firstDiscussionNoteHtml,
noteHtml);
- else
var errorsHtml = "#{escape_javascript(render 'notes/form_errors', note: @note)}";
- if note_for_main_target?(@note)
NoteList.errorsOnForm(errorsHtml);
- else
NoteList.errorsOnForm(errorsHtml, "#{@note.discussion_id}");