debian-mirror-gitlab/app/views/shared/form_elements/_description.html.haml

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

30 lines
1.5 KiB
Text
Raw Normal View History

2023-06-20 00:43:36 +05:30
- @gfm_form = true
2017-08-17 22:00:37 +05:30
- project = local_assigns.fetch(:project)
2017-09-10 17:25:29 +05:30
- model = local_assigns.fetch(:model)
2017-08-17 22:00:37 +05:30
- form = local_assigns.fetch(:form)
2021-04-29 21:17:54 +05:30
- 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…')
2023-06-20 00:43:36 +05:30
- no_issuable_templates = issuable_templates(ref_project, model.to_ability_name).empty?
2020-07-28 23:09:34 +05:30
- preview_url = preview_markdown_path(project, target_type: model.class.name)
2017-08-17 22:00:37 +05:30
2022-07-23 23:45:48 +05:30
.form-group
= form.label :description, _('Description'), class: 'gl-display-block'
- if model.is_a?(MergeRequest)
= hidden_field_tag :merge_request_diff_head_sha, model.diff_head_sha
2017-08-17 22:00:37 +05:30
2022-07-23 23:45:48 +05:30
- if model.is_a?(Issuable)
= render 'shared/issuable/form/template_selector', issuable: model
2021-01-29 00:20:46 +05:30
2022-07-23 23:45:48 +05:30
= render 'shared/form_elements/apply_template_warning', issuable: model
2021-01-29 00:20:46 +05:30
2023-06-20 00:43:36 +05:30
.js-markdown-editor{ data: { render_markdown_path: preview_url,
markdown_docs_path: help_page_path('user/markdown'),
quick_actions_docs_path: help_page_path('user/project/quick_actions'),
qa_selector: 'issuable_form_description_field',
form_field_placeholder: placeholder,
form_field_classes: 'js-gfm-input markdown-area note-textarea rspec-issuable-form-description' } }
= form.hidden_field :description
- if no_issuable_templates && can?(current_user, :push_code, model.project)
= render 'shared/issuable/form/default_templates'