Commit 41a24230 authored by Adam Niedzielski's avatar Adam Niedzielski Committed by Fatih Acet

Remove dependency on Note instance from notes edit form.

parent 1100320b
.note-edit-form .note-edit-form
= form_for note, url: namespace_project_note_path(@project.namespace, @project, note), method: :put, remote: true, authenticity_token: true, html: { class: 'edit-note common-note-form js-quick-submit' } do |f| = form_tag '#', method: :put, remote: true, class: 'edit-note common-note-form js-quick-submit' do
= note_target_fields(note)
= render layout: 'projects/md_preview', locals: { preview_class: 'md-preview' } do = render layout: 'projects/md_preview', locals: { preview_class: 'md-preview' } do
= render 'projects/zen', f: f, attr: :note, classes: 'note-textarea js-note-text js-task-list-field', placeholder: "Write a comment or drag your files here..." = render 'projects/zen', attr: 'note[note]', classes: 'note-textarea js-note-text js-task-list-field', placeholder: "Write a comment or drag your files here..."
= render 'projects/notes/hints' = render 'projects/notes/hints'
.note-form-actions.clearfix .note-form-actions.clearfix
= f.submit 'Save Comment', class: 'btn btn-nr btn-save js-comment-button' = submit_tag 'Save Comment', class: 'btn btn-nr btn-save js-comment-button'
%span.settings-message.note-edit-warning.js-edit-warning %span.settings-message.note-edit-warning.js-edit-warning
Finish editing this message first! Finish editing this message first!
%button.btn.btn-nr.btn-cancel.note-edit-cancel{ type: 'button' } %button.btn.btn-nr.btn-cancel.note-edit-cancel{ type: 'button' }
......
...@@ -7,5 +7,4 @@ ...@@ -7,5 +7,4 @@
- else - else
= render partial: "projects/notes/note", collection: @notes, as: :note = render partial: "projects/notes/note", collection: @notes, as: :note
= render 'projects/notes/edit_form', note: @notes[0] = render 'projects/notes/edit_form'
= hidden_field_tag :authenticity_token, form_authenticity_token
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