Welcome to mirror list, hosted at ThFree Co, Russian Federation.

_title.html.haml « form « issuable « shared « views « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 257ad7a8518b747cf3ed4045b8a3d1b4957f37e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
- issuable = local_assigns.fetch(:issuable)
- has_wip_commits = local_assigns.fetch(:has_wip_commits)
- form = local_assigns.fetch(:form)
- no_issuable_templates = issuable_templates(ref_project, issuable.to_ability_name).empty?
- div_class = no_issuable_templates ? 'col-sm-10' : 'col-sm-7 col-lg-8'
- toggle_wip_link_start = '<a href="" class="js-toggle-wip">'
- toggle_wip_link_end = '</a>'
- 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
- 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

%div{ class: div_class }
  = form.text_field :title, required: true, maxlength: 255, autofocus: true,
      autocomplete: 'off', class: 'form-control pad qa-issuable-form-title', placeholder: _('Title'), dir: 'auto'

  - if issuable.respond_to?(:work_in_progress?)
    .form-text.text-muted
      .js-wip-explanation{ style: "display: none;" }
        = remove_wip_text
      .js-no-wip-explanation
        - if has_wip_commits
          = _('It looks like you have some draft commits in this branch.')
          %br
        .invisible
          .js-unwrap-on-load
            = add_wip_text

  - if no_issuable_templates && can?(current_user, :push_code, issuable.project)
    = render 'shared/issuable/form/default_templates'