2012-12-02 23:14:56 +01:00
|
|
|
- if @note.valid?
|
|
|
|
var noteHtml = "#{escape_javascript(render "notes/note", note: @note)}";
|
|
|
|
|
|
|
|
- if note_for_main_target?(@note)
|
|
|
|
- if @note.for_wall?
|
|
|
|
NoteList.appendNewWallNote(#{@note.id}, noteHtml);
|
|
|
|
- else
|
|
|
|
NoteList.appendNewNote(#{@note.id}, noteHtml);
|
|
|
|
- else
|
2012-12-03 20:35:09 +01:00
|
|
|
:plain
|
|
|
|
var firstDiscussionNoteHtml = "#{escape_javascript(render "notes/diff_notes_with_reply", notes: [@note])}";
|
|
|
|
NoteList.appendNewDiscussionNote("#{@note.discussion_id}",
|
|
|
|
firstDiscussionNoteHtml,
|
|
|
|
noteHtml);
|
2012-12-02 23:14:56 +01:00
|
|
|
|
2012-12-02 20:43:39 +01:00
|
|
|
- else
|
2012-12-03 20:35:09 +01:00
|
|
|
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}");
|