From 4fc66ead4f50f76efb80e119bbedc7514602f57f Mon Sep 17 00:00:00 2001 From: Riyad Preukschas Date: Fri, 14 Sep 2012 05:13:26 +0200 Subject: [PATCH] Rename 'notes/show' partial to 'notes/note' --- app/views/notes/_create_common_note.js.haml | 2 +- app/views/notes/_note.html.haml | 21 +++++++++++++++++++++ app/views/notes/_notes_list.html.haml | 2 +- app/views/notes/_per_line_show.html.haml | 2 +- app/views/notes/_show.html.haml | 21 --------------------- 5 files changed, 24 insertions(+), 24 deletions(-) create mode 100644 app/views/notes/_note.html.haml delete mode 100644 app/views/notes/_show.html.haml diff --git a/app/views/notes/_create_common_note.js.haml b/app/views/notes/_create_common_note.js.haml index 0a00bd4..bbebc24 100644 --- a/app/views/notes/_create_common_note.js.haml +++ b/app/views/notes/_create_common_note.js.haml @@ -5,7 +5,7 @@ $('.note-form-holder #preview-link').text('Preview'); $('.note-form-holder #preview-note').hide(); $('.note-form-holder').show(); - NoteList.appendNewNote(#{note.id}, "#{escape_javascript(render "notes/show", note: note)}"); + NoteList.appendNewNote(#{note.id}, "#{escape_javascript(render "notes/note", note: note)}"); - else :plain diff --git a/app/views/notes/_note.html.haml b/app/views/notes/_note.html.haml new file mode 100644 index 0000000..3412e4e --- /dev/null +++ b/app/views/notes/_note.html.haml @@ -0,0 +1,21 @@ +%li{id: dom_id(note), class: "note"} + = image_tag gravatar_icon(note.author.email), class: "avatar s32" + %div.note-author + %strong= note.author_name + = link_to "##{dom_id(note)}", name: dom_id(note) do + %cite.cgray + = time_ago_in_words(note.updated_at) + ago + - if(note.author_id == current_user.id) || can?(current_user, :admin_note, @project) + = link_to [@project, note], confirm: 'Are you sure?', method: :delete, remote: true, class: "cred delete-note btn very_small" do + %i.icon-trash + Remove + + %div.note-title + = preserve do + = markdown(note.note) + - if note.attachment.url + .right + %div.file + = link_to note.attachment_identifier, note.attachment.url, target: "_blank" + .clear diff --git a/app/views/notes/_notes_list.html.haml b/app/views/notes/_notes_list.html.haml index 5673988..e2c4bed 100644 --- a/app/views/notes/_notes_list.html.haml +++ b/app/views/notes/_notes_list.html.haml @@ -1,4 +1,4 @@ - @notes.each do |note| - next unless note.author - = render partial: "notes/show", locals: {note: note} + = render "notes/note", note: note diff --git a/app/views/notes/_per_line_show.html.haml b/app/views/notes/_per_line_show.html.haml index 9d5a31a..28bcd6e 100644 --- a/app/views/notes/_per_line_show.html.haml +++ b/app/views/notes/_per_line_show.html.haml @@ -1,5 +1,5 @@ %tr.line_notes_row %td{colspan: 3} %ul - = render "notes/show", note: note + = render "notes/note", note: note diff --git a/app/views/notes/_show.html.haml b/app/views/notes/_show.html.haml deleted file mode 100644 index 3412e4e..0000000 --- a/app/views/notes/_show.html.haml +++ /dev/null @@ -1,21 +0,0 @@ -%li{id: dom_id(note), class: "note"} - = image_tag gravatar_icon(note.author.email), class: "avatar s32" - %div.note-author - %strong= note.author_name - = link_to "##{dom_id(note)}", name: dom_id(note) do - %cite.cgray - = time_ago_in_words(note.updated_at) - ago - - if(note.author_id == current_user.id) || can?(current_user, :admin_note, @project) - = link_to [@project, note], confirm: 'Are you sure?', method: :delete, remote: true, class: "cred delete-note btn very_small" do - %i.icon-trash - Remove - - %div.note-title - = preserve do - = markdown(note.note) - - if note.attachment.url - .right - %div.file - = link_to note.attachment_identifier, note.attachment.url, target: "_blank" - .clear -- libgit2 0.21.2