summaryrefslogtreecommitdiff
path: root/app/views/projects/notes/_form.html.haml
blob: 33667d3f46d90d1f056d3105f8c10a5465432693 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
= 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|
  = note_target_fields
  = f.hidden_field :commit_id
  = f.hidden_field :line_code
  = f.hidden_field :noteable_id
  = f.hidden_field :noteable_type

  .note_text_and_preview.js-toggler-container
    %a.btn.js-note-preview-button.js-toggler-target.turn-off{ href: "javascript:;", data: {url: preview_project_notes_path(@project)} }
      %i.icon-eye-open
      Preview
    %a.btn.btn-primary.js-note-edit-button.js-toggler-target.turn-off{ href: "javascript:;" }
      %i.icon-edit
      Write

    = f.text_area :note, size: 255, class: 'note_text js-note-text js-gfm-input turn-on'
    .note_preview.js-note-preview.turn-off

  .hint
    .pull-right Comments are parsed with #{link_to "GitLab Flavored Markdown", help_markdown_path, target: '_blank'}.
  .clearfix

  .note-form-actions
    .buttons
      = f.submit 'Add Comment', class: "btn comment-btn grouped js-comment-button"
      = yield(:note_actions)

      %a.btn.grouped.js-close-discussion-note-form Cancel

    .note-form-option
      %a.choose-btn.btn.js-choose-note-attachment-button
        %i.icon-paper-clip
        %span Choose File ...
       
      %span.file_name.js-attachment-filename File name...
      = f.file_field :attachment, class: "js-note-attachment-input hide"

    .clearfix