Commit c20af32a authored by Riyad Preukschas's avatar Riyad Preukschas

Pull together and rename Notes partials

parent 6fc10fa2
- if note.valid?
- if note.for_wall?
NoteList.appendNewWallNote(#{note.id}, "#{escape_javascript(render "notes/note", note: note)}");
- else
NoteList.appendNewNote(#{note.id}, "#{escape_javascript(render "notes/note", note: note)}");
- else
-# TODO: insert form correctly
$(".js-main-target-note").replaceWith("#{escape_javascript(render 'notes/common_form')}");
GitLab.GfmAutoComplete.setup();
- if note.valid?
:plain
NoteList.appendNewDiscussionNote("#{note.discussion_id}",
"#{escape_javascript(render "notes/diff_notes_with_reply", notes: [note])}",
"#{escape_javascript(render "notes/note", note: note)}");
%ul#notes-list.notes %ul#notes-list.notes
.notes-status .js-notes-busy
.js-main-target-form .js-main-target-form
- if can? current_user, :write_note, @project - if can? current_user, :write_note, @project
= render "notes/common_form" = render "notes/form"
:javascript :javascript
$(function(){ $(function(){
......
.js-main-target-form .js-main-target-form
- if can? current_user, :write_note, @project - if can? current_user, :write_note, @project
= render "notes/common_form" = render "notes/form"
%ul#new-notes-list.reversed.notes %ul#new-notes-list.reversed.notes
%ul#notes-list.reversed.notes %ul#notes-list.reversed.notes
.notes-status .notes-busy.js-notes-busy
:javascript :javascript
$(function(){ $(function(){
......
- if note_for_main_target?(@note) - if @note.valid?
= render "create_common_note", note: @note 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
var firstDiscussionNoteHtml = "#{escape_javascript(render "notes/diff_notes_with_reply", notes: [@note])}";
NoteList.appendNewDiscussionNote("#{@note.discussion_id}", firstDiscussionNoteHtml, noteHtml);
- else - else
= render "create_discussion_note", note: @note -# TODO: insert form correctly
$(".js-main-target-note").replaceWith("#{escape_javascript(render 'notes/common_form')}");
GitLab.GfmAutoComplete.setup();
\ No newline at end of file
- unless @notes.blank? - unless @notes.blank?
var notesHtml = "#{escape_javascript(render 'notes/notes')}";
- new_note_ids = @notes.map(&:id) - new_note_ids = @notes.map(&:id)
- if loading_more_notes? - if loading_more_notes?
:plain NoteList.appendMoreNotes(#{new_note_ids}, notesHtml);
NoteList.appendMoreNotes(#{new_note_ids}, "#{escape_javascript(render 'notes/notes')}");
- elsif loading_new_notes? - elsif loading_new_notes?
:plain NoteList.replaceNewNotes(#{new_note_ids}, notesHtml);
NoteList.replaceNewNotes(#{new_note_ids}, "#{escape_javascript(render 'notes/notes')}");
- else - else
:plain NoteList.setContent(#{new_note_ids}, notesHtml);
NoteList.setContent(#{new_note_ids}, "#{escape_javascript(render 'notes/notes')}");
- else - else
- if loading_more_notes? - if loading_more_notes?
:plain
NoteList.finishedLoadingMore(); NoteList.finishedLoadingMore();
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment