Fix handling form errors.
This commit is contained in:
parent
c1ffee4e65
commit
7978f8dd2b
4 changed files with 68 additions and 21 deletions
|
@ -7,10 +7,15 @@
|
|||
- else
|
||||
NoteList.appendNewNote(#{@note.id}, noteHtml);
|
||||
- else
|
||||
var firstDiscussionNoteHtml = "#{escape_javascript(render "notes/diff_notes_with_reply", notes: [@note])}";
|
||||
NoteList.appendNewDiscussionNote("#{@note.discussion_id}", firstDiscussionNoteHtml, noteHtml);
|
||||
:plain
|
||||
var firstDiscussionNoteHtml = "#{escape_javascript(render "notes/diff_notes_with_reply", notes: [@note])}";
|
||||
NoteList.appendNewDiscussionNote("#{@note.discussion_id}",
|
||||
firstDiscussionNoteHtml,
|
||||
noteHtml);
|
||||
|
||||
- else
|
||||
-# TODO: insert form correctly
|
||||
$(".js-main-target-note").replaceWith("#{escape_javascript(render 'notes/common_form')}");
|
||||
GitLab.GfmAutoComplete.setup();
|
||||
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}");
|
Loading…
Add table
Add a link
Reference in a new issue