debian-mirror-gitlab/app/views/shared/issuable/form/_title.html.haml

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

29 lines
1.7 KiB
Text
Raw Normal View History

2017-08-17 22:00:37 +05:30
- issuable = local_assigns.fetch(:issuable)
- has_wip_commits = local_assigns.fetch(:has_wip_commits)
- form = local_assigns.fetch(:form)
2021-03-11 19:13:27 +05:30
- no_issuable_templates = issuable_templates(ref_project, issuable.to_ability_name).empty?
2017-08-17 22:00:37 +05:30
- div_class = no_issuable_templates ? 'col-sm-10' : 'col-sm-7 col-lg-8'
2020-10-24 23:57:45 +05:30
- toggle_wip_link_start = '<a href="" class="js-toggle-wip">'
- toggle_wip_link_end = '</a>'
2022-01-26 12:08:38 +05:30
- add_wip_text = (_('%{link_start}Start the title with %{draft_snippet}%{link_end} to prevent a merge request draft from merging before it\'s ready.') % { link_start: toggle_wip_link_start, link_end: toggle_wip_link_end, draft_snippet: '<code>Draft:</code>'.html_safe } ).html_safe
2021-06-08 01:23:25 +05:30
- remove_wip_text = (_('%{link_start}Remove the %{draft_snippet} prefix%{link_end} from the title to allow this merge request to be merged when it\'s ready.' ) % { link_start: toggle_wip_link_start, link_end: toggle_wip_link_end, draft_snippet: '<code>Draft</code>'.html_safe } ).html_safe
2017-08-17 22:00:37 +05:30
2022-05-07 20:08:51 +05:30
%div{ class: div_class, data: { testid: 'issue-title-input-field' } }
= form.text_field :title, required: true, aria: { required: true }, maxlength: 255, autofocus: true,
autocomplete: 'off', class: 'form-control pad qa-issuable-form-title', placeholder: _('Title'), dir: 'auto'
2017-08-17 22:00:37 +05:30
- if issuable.respond_to?(:work_in_progress?)
2018-12-05 23:21:45 +05:30
.form-text.text-muted
2022-04-04 11:22:00 +05:30
.js-wip-explanation{ style: "display: none;" }
2020-10-24 23:57:45 +05:30
= remove_wip_text
2017-08-17 22:00:37 +05:30
.js-no-wip-explanation
- if has_wip_commits
2020-10-24 23:57:45 +05:30
= _('It looks like you have some draft commits in this branch.')
2017-08-17 22:00:37 +05:30
%br
2022-04-04 11:22:00 +05:30
.invisible
.js-unwrap-on-load
= add_wip_text
2017-08-17 22:00:37 +05:30
- if no_issuable_templates && can?(current_user, :push_code, issuable.project)
2018-11-08 19:23:39 +05:30
= render 'shared/issuable/form/default_templates'