_form.html.haml 1.62 KB
Newer Older
1
= form_for [@project, @note], remote: true, html: { :'data-type' => 'json', multipart: true, id: nil, class: "new_note js-new-note-form common-note-form" }, authenticity_token: true do |f|
2
  = note_target_fields
3
  = f.hidden_field :commit_id
4 5 6 7
  = f.hidden_field :line_code
  = f.hidden_field :noteable_id
  = f.hidden_field :noteable_type

8 9 10 11 12 13 14 15 16 17
  %ul.nav.nav-tabs
    %li.active
      = link_to '#note-write-holder', class: 'js-note-write-button' do
        Write
    %li
      = link_to '#note-preview-holder', class: 'js-note-preview-button', data: { url: preview_project_notes_path(@project) } do
        Preview
  %div
    .note-write-holder
      = f.text_area :note, size: 255, class: 'note_text js-note-text js-gfm-input markdown-area'
18

19 20 21 22 23 24
      .light.clearfix
        .pull-left Comments are parsed with #{link_to "GitLab Flavored Markdown", help_markdown_path, target: '_blank'}.
        .pull-right Attach images (JPG, PNG, GIF) by dragging & dropping or #{link_to "selecting them", '#', class: 'markdown-selector' }.

    .note-preview-holder.hide
      .js-note-preview
25

26 27
  .note-form-actions
    .buttons
28
      = f.submit 'Add Comment', class: "btn comment-btn btn-grouped js-comment-button"
29
      = yield(:note_actions)
30
      %a.btn.grouped.js-close-discussion-note-form Cancel
31

32
    .note-form-option
33
      %a.choose-btn.btn.js-choose-note-attachment-button
34 35 36 37
        %i.icon-paper-clip
        %span Choose File ...
       
      %span.file_name.js-attachment-filename File name...
38
      = f.file_field :attachment, class: "js-note-attachment-input hidden"
39

40 41
:javascript
  window.project_image_path_upload = "#{upload_image_project_path @project}";