_title.html.haml 1.25 KB
Newer Older
1
- issuable = local_assigns.fetch(:issuable)
2
- has_wip_commits = local_assigns.fetch(:has_wip_commits)
3 4 5 6 7 8
- form = local_assigns.fetch(:form)
- no_issuable_templates = issuable_templates(issuable).empty?
- div_class = no_issuable_templates ? 'col-sm-10' : 'col-sm-7 col-lg-8'

%div{ class: div_class }
  = form.text_field :title, required: true, maxlength: 255, autofocus: true,
Felipe Artur's avatar
Felipe Artur committed
9
      autocomplete: 'off', class: 'form-control pad qa-issuable-form-title'
10 11

  - if issuable.respond_to?(:work_in_progress?)
12
    %p.form-text.text-muted
13 14 15 16 17 18 19 20 21
      .js-wip-explanation
        %a.js-toggle-wip{ href: '', tabindex: -1 }
          Remove the
          %code WIP:
          prefix from the title
        to allow this
        %strong Work In Progress
        merge request to be merged when it's ready.
      .js-no-wip-explanation
22 23 24
        - if has_wip_commits
          It looks like you have some WIP commits in this branch.
          %br
25 26 27 28 29 30 31 32
        %a.js-toggle-wip{ href: '', tabindex: -1 }
          Start the title with
          %code WIP:
        to prevent a
        %strong Work In Progress
        merge request from being merged before it's ready.

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