2016-11-16 06:09:09 -05:00
- project = local_assigns.fetch(:project)
2017-05-03 11:26:49 -04:00
- model = local_assigns.fetch(:model)
2016-11-15 12:28:14 -05:00
- form = local_assigns.fetch(:form)
2021-03-31 14:09:19 -04:00
- placeholder = model.is_a?(MergeRequest) ? _('Describe the goal of the changes and what reviewers should be aware of.') : _('Write a description or drag your files here…')
2016-11-16 06:09:09 -05:00
2020-06-29 11:08:56 -04:00
- supports_quick_actions = true
- preview_url = preview_markdown_path(project, target_type: model.class.name)
2016-11-15 12:28:14 -05:00
2018-04-12 16:11:22 -04:00
.form-group.row.detail-page-description
2018-04-12 19:16:56 -04:00
= form.label :description, 'Description', class: 'col-form-label col-sm-2'
2016-11-15 12:28:14 -05:00
.col-sm-10
2020-06-29 11:08:56 -04:00
- if model.is_a?(MergeRequest)
= hidden_field_tag :merge_request_diff_head_sha, model.diff_head_sha
2016-11-15 12:28:14 -05:00
2020-01-07 19:07:43 -05:00
- if model.is_a?(Issuable)
= render 'shared/issuable/form/template_selector', issuable: model
2020-11-16 19:09:16 -05:00
= render 'shared/form_elements/apply_template_warning', issuable: model
2020-06-11 11:08:36 -04:00
= render layout: 'shared/md_preview', locals: { url: preview_url, referenced_users: true } do
= render 'shared/zen', f: form, attr: :description,
2021-03-23 23:09:04 -04:00
classes: 'note-textarea rspec-issuable-form-description',
2019-11-15 07:06:12 -05:00
placeholder: placeholder,
2021-03-23 23:09:04 -04:00
supports_quick_actions: supports_quick_actions,
qa_selector: 'issuable_form_description'
2017-05-31 01:50:53 -04:00
= render 'shared/notes/hints', supports_quick_actions: supports_quick_actions
2016-11-15 12:28:14 -05:00
.clearfix
.error-alert