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