2017-06-12 19:42:12 +00:00
|
|
|
- supports_autocomplete = local_assigns.fetch(:supports_autocomplete, true)
|
2017-05-31 05:50:53 +00:00
|
|
|
- supports_quick_actions = note_supports_quick_actions?(@note)
|
|
|
|
- if supports_quick_actions
|
|
|
|
- preview_url = preview_markdown_path(@project, quick_actions_target_type: @note.noteable_type, quick_actions_target_id: @note.noteable_id)
|
2016-11-16 11:09:09 +00:00
|
|
|
- else
|
|
|
|
- preview_url = preview_markdown_path(@project)
|
2016-09-15 14:57:06 +00:00
|
|
|
|
2017-05-03 08:48:01 +00:00
|
|
|
= form_for form_resources, url: new_form_url, remote: true, html: { :'data-type' => 'json', multipart: true, id: nil, class: "new-note js-new-note-form js-quick-submit common-note-form", "data-noteable-iid" => @note.noteable.try(:iid), }, authenticity_token: true do |f|
|
2015-11-17 15:08:58 +00:00
|
|
|
= hidden_field_tag :view, diff_view
|
2015-06-05 22:24:05 +00:00
|
|
|
= hidden_field_tag :line_type
|
2016-11-24 14:05:15 +00:00
|
|
|
= hidden_field_tag :merge_request_diff_head_sha, @note.noteable.try(:diff_head_sha)
|
2017-03-10 01:29:11 +00:00
|
|
|
= hidden_field_tag :in_reply_to_discussion_id
|
2017-07-27 14:36:39 +00:00
|
|
|
= hidden_field_tag :note_project_id
|
2017-03-10 01:29:11 +00:00
|
|
|
|
2015-03-02 23:05:23 +00:00
|
|
|
= note_target_fields(@note)
|
2012-12-02 19:47:09 +00:00
|
|
|
= f.hidden_field :noteable_type
|
2017-03-10 01:29:11 +00:00
|
|
|
= f.hidden_field :noteable_id
|
|
|
|
= f.hidden_field :commit_id
|
2016-05-10 22:41:46 +00:00
|
|
|
= f.hidden_field :type
|
2017-03-10 01:29:11 +00:00
|
|
|
|
|
|
|
-# LegacyDiffNote
|
|
|
|
= f.hidden_field :line_code
|
|
|
|
|
|
|
|
-# DiffNote
|
2016-06-20 17:23:46 +00:00
|
|
|
= f.hidden_field :position
|
2012-12-02 19:47:09 +00:00
|
|
|
|
2018-04-12 15:10:40 +00:00
|
|
|
.discussion-form-container
|
|
|
|
= render layout: 'projects/md_preview', locals: { url: preview_url, referenced_users: true } do
|
|
|
|
= render 'projects/zen', f: f,
|
|
|
|
attr: :note,
|
|
|
|
classes: 'note-textarea js-note-text',
|
2018-06-11 07:21:04 +00:00
|
|
|
placeholder: "Write a comment or drag your files here…",
|
2018-04-12 15:10:40 +00:00
|
|
|
supports_quick_actions: supports_quick_actions,
|
|
|
|
supports_autocomplete: supports_autocomplete
|
|
|
|
= render 'shared/notes/hints', supports_quick_actions: supports_quick_actions
|
|
|
|
.error-alert
|
|
|
|
|
|
|
|
.note-form-actions.clearfix
|
|
|
|
= render partial: 'shared/notes/comment_button'
|
|
|
|
|
|
|
|
= yield(:note_actions)
|
|
|
|
|
2018-07-10 12:38:15 +00:00
|
|
|
%a.btn.btn-cancel.js-note-discard{ role: "button", data: {cancel_text: "Cancel" } }
|
2018-04-12 15:10:40 +00:00
|
|
|
Discard draft
|