_form.html.haml 1.6 KB
Newer Older
1 2 3
= form_for [@project, @note], remote: true, html: { multipart: true, id: nil, class: "new_note js-new-note-form" } do |f|

  = note_target_fields
4
  = f.hidden_field :commit_id
5 6 7 8 9
  = f.hidden_field :line_code
  = f.hidden_field :noteable_id
  = f.hidden_field :noteable_type

  .note_text_and_preview.js-toggler-container
Riyad Preukschas's avatar
Riyad Preukschas committed
10
    %a.js-note-preview-button.js-toggler-target.turn-off{ href: "javascript:;", title: "Preview", data: {url: preview_project_notes_path(@project)} }
11
      %i.icon-eye-open
Riyad Preukschas's avatar
Riyad Preukschas committed
12
    %a.js-note-edit-button.js-toggler-target.turn-off{ href: "javascript:;", title: "Edit" }
13 14 15 16 17 18 19 20 21 22 23 24 25
      %i.icon-edit

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

  .buttons
    = f.submit 'Add Comment', class: "btn comment-btn grouped js-comment-button"
    %a.btn.grouped.js-close-discussion-note-form Cancel
  .hint
    .right Comments are parsed with #{link_to "GitLab Flavored Markdown", help_markdown_path, target: '_blank'}.
  .clearfix

  .note_options
26 27 28
    .attachment
      %h6 Attachment:
      .file_name.js-attachment-filename File name...
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
29
      %a.choose-btn.btn.btn-small.js-choose-note-attachment-button Choose File ...
30
      .hint Any file up to 10 MB
31

32
      = f.file_field :attachment, class: "js-note-attachment-input"
33

34 35
    .notify_options
      %h6 Notify via email:
36 37
      = label_tag :notify do
        = check_box_tag :notify, 1, !@note.for_commit?
38
        Project team
39

40
      .js-notify-commit-author
41
        = label_tag :notify_author do
Riyad Preukschas's avatar
Riyad Preukschas committed
42
          = check_box_tag :notify_author, 1 , @note.for_commit?
43
          Commit author
44
  .clearfix