Remove wall from basic notes logic

This commit is contained in:
Dmitriy Zaporozhets 2013-03-19 12:34:14 +02:00
parent 1752c6dc8b
commit 5bf3a898ed
5 changed files with 3 additions and 183 deletions

View file

@ -1,12 +0,0 @@
.js-main-target-form
- if can? current_user, :write_note, @project
= render "notes/form"
%ul#new-notes-list.reversed.notes
%ul#notes-list.reversed.notes
.notes-busy.js-notes-busy
:javascript
$(function(){
NoteList.init("#{@target_id}", "#{@target_type}", "#{project_notes_path(@project)}");
});

View file

@ -2,10 +2,7 @@
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);
NoteList.appendNewNote(#{@note.id}, noteHtml);
- else
:plain
var firstDiscussionNoteHtml = "#{escape_javascript(render "notes/diff_notes_with_reply", notes: [@note])}";
@ -18,4 +15,4 @@
- if note_for_main_target?(@note)
NoteList.errorsOnForm(errorsHtml);
- else
NoteList.errorsOnForm(errorsHtml, "#{@note.discussion_id}");
NoteList.errorsOnForm(errorsHtml, "#{@note.discussion_id}");

View file

@ -1,15 +1,4 @@
- unless @notes.blank?
var notesHtml = "#{escape_javascript(render 'notes/notes')}";
- new_note_ids = @notes.map(&:id)
- if loading_more_notes?
NoteList.appendMoreNotes(#{new_note_ids}, notesHtml);
- elsif loading_new_notes?
NoteList.replaceNewNotes(#{new_note_ids}, notesHtml);
- else
NoteList.setContent(#{new_note_ids}, notesHtml);
- else
- if loading_more_notes?
NoteList.finishedLoadingMore();
NoteList.setContent(#{new_note_ids}, notesHtml);