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

27 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?
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>'
2021-06-08 01:23:25 +05:30
- add_wip_text = (_('%{link_start}Start the title with %{draft_snippet}%{link_end} to prevent a merge request that is a work in progress from being merged 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
- 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
%div{ class: div_class }
= form.text_field :title, required: true, maxlength: 255, autofocus: true,
2019-07-31 22:56:46 +05:30
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
2017-08-17 22:00:37 +05:30
.js-wip-explanation
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
2020-10-24 23:57:45 +05:30
= 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'