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.

28 lines
1.6 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?
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-07-23 23:45:48 +05:30
%div{ data: { testid: 'issue-title-input-field' } }
2022-05-07 20:08:51 +05:30
= form.text_field :title, required: true, aria: { required: true }, maxlength: 255, autofocus: true,
2022-07-23 23:45:48 +05:30
autocomplete: 'off', class: 'form-control pad qa-issuable-form-title', dir: 'auto'
2017-08-17 22:00:37 +05:30
2022-07-23 23:45:48 +05:30
- if issuable.respond_to?(:draft?)
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'