diff options
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/projects/notes/_edit_form.html.haml | 22 | ||||
-rw-r--r-- | app/views/projects/notes/_form.html.haml | 5 | ||||
-rw-r--r-- | app/views/projects/notes/_note.html.haml | 22 |
3 files changed, 27 insertions, 22 deletions
diff --git a/app/views/projects/notes/_edit_form.html.haml b/app/views/projects/notes/_edit_form.html.haml new file mode 100644 index 00000000000..a4520787a85 --- /dev/null +++ b/app/views/projects/notes/_edit_form.html.haml @@ -0,0 +1,22 @@ +.note-edit-form + = form_for note, url: project_note_path(@project, note), method: :put, remote: true, authenticity_token: true do |f| + = render layout: 'projects/md_preview' do + = render 'projects/zen', f: f, attr: :note, + classes: 'note_text js-note-text' + + .light.clearfix + .pull-left Comments are parsed with #{link_to "GitLab Flavored Markdown", help_page_path("markdown", "markdown"),{ target: '_blank', tabindex: -1 }} + .pull-right Attach images (JPG, PNG, GIF) by dragging & dropping or #{link_to "selecting them", '#', class: 'markdown-selector', tabindex: -1 }. + + .note-form-actions + .buttons + = f.submit 'Save Comment', class: "btn btn-primary btn-save btn-grouped js-comment-button" + = link_to 'Cancel', "#", class: "btn btn-cancel note-edit-cancel" + + .note-form-option.hidden-xs + %a.choose-btn.btn.js-choose-note-attachment-button + %i.fa.fa-paperclip + %span Choose File ... + + %span.file_name.js-attachment-filename + = f.file_field :attachment, class: "js-note-attachment-input hidden" diff --git a/app/views/projects/notes/_form.html.haml b/app/views/projects/notes/_form.html.haml index 47ffe1fd2f3..76525966dc3 100644 --- a/app/views/projects/notes/_form.html.haml +++ b/app/views/projects/notes/_form.html.haml @@ -7,7 +7,8 @@ = render layout: 'projects/md_preview' do = render 'projects/zen', f: f, attr: :note, - classes: 'note_text js-note-text' + classes: 'note_text js-note-text' + .light.clearfix .pull-left Comments are parsed with #{link_to "GitLab Flavored Markdown", help_page_path("markdown", "markdown"),{ target: '_blank', tabindex: -1 }} .pull-right Attach images (JPG, PNG, GIF) by dragging & dropping or #{link_to "selecting them", '#', class: 'markdown-selector', tabindex: -1 }. @@ -24,7 +25,7 @@ %i.fa.fa-paperclip %span Choose File ... - %span.file_name.js-attachment-filename File name... + %span.file_name.js-attachment-filename = f.file_field :attachment, class: "js-note-attachment-input hidden" :javascript diff --git a/app/views/projects/notes/_note.html.haml b/app/views/projects/notes/_note.html.haml index 80e7342455b..691c169b620 100644 --- a/app/views/projects/notes/_note.html.haml +++ b/app/views/projects/notes/_note.html.haml @@ -1,4 +1,4 @@ -%li.timeline-entry{ id: dom_id(note), class: [dom_class(note), ('system-note' if note.system)], data: { discussion: note.discussion_id } } +%li.timeline-entry{ id: dom_id(note), class: [dom_class(note), "note-row-#{note.id}", ('system-note' if note.system)], data: { discussion: note.discussion_id } } .timeline-entry-inner .timeline-icon - if note.system @@ -42,25 +42,7 @@ .note-text = preserve do = markdown(note.note, {no_header_anchors: true}) - - .note-edit-form - = form_for note, url: project_note_path(@project, note), method: :put, remote: true, authenticity_token: true do |f| - = render layout: 'projects/md_preview' do - = f.text_area :note, class: 'note_text js-note-text js-gfm-input turn-on' - - .form-actions.clearfix - = f.submit 'Save changes', class: "btn btn-primary btn-save js-comment-button" - - .note-form-option - %a.choose-btn.btn.js-choose-note-attachment-button - %i.fa.fa-paperclip - %span Choose File ... - - %span.file_name.js-attachment-filename File name... - = f.file_field :attachment, class: "js-note-attachment-input hidden" - - = link_to 'Cancel', "#", class: "btn btn-cancel note-edit-cancel" - + = render 'projects/notes/edit_form', note: note - if note.attachment.url .note-attachment |