- if issuable.errors.any?
  .row
    .col-sm-10.col-sm-offset-2
      .alert.alert-danger
        - issuable.errors.full_messages.each do |msg|
          %span= msg
          %br
.form-group
  = f.label :title, class: 'control-label' do
    %strong= 'Title *'
  .col-sm-10
    = f.text_field :title, maxlength: 255, autofocus: true,
        class: 'form-control pad js-gfm-input', required: true
.form-group.issuable-description
  = f.label :description, 'Description', class: 'control-label'
  .col-sm-10
    = render 'projects/zen', f: f, attr: :description,
                             classes: 'description form-control'
    .col-sm-12.hint
      .pull-left
        Parsed with
        #{link_to 'GitLab Flavored Markdown', help_page_path('markdown', 'markdown'), target: '_blank'}.
      .pull-right
        Attach images (JPG, PNG, GIF) by dragging &amp; dropping
        or #{link_to 'selecting them', '#', class: 'markdown-selector' }.
    .clearfix
    .error-alert
%hr
.form-group
  .issue-assignee
    = f.label :assignee_id, class: 'control-label' do
      %i.fa.fa-user
      Assign to
    .col-sm-10
      = project_users_select_tag("#{issuable.class.model_name.param_key}[assignee_id]",
          placeholder: 'Select a user', class: 'custom-form-control',
          selected: issuable.assignee_id)
      &nbsp;
      = link_to 'Assign to me', '#', class: 'btn assign-to-me-link'
.form-group
  .issue-milestone
    = f.label :milestone_id, class: 'control-label' do
      %i.fa.fa-clock-o
      Milestone
    .col-sm-10
      - if milestone_options(issuable).present?
        = f.select(:milestone_id, milestone_options(issuable),
          { include_blank: 'Select milestone' }, { class: 'select2' })
      - else
        %span.light No open milestones available.
      &nbsp;
      = link_to 'Create new milestone', new_project_milestone_path(issuable.project)
.form-group
  = f.label :label_ids, class: 'control-label' do
    %i.icon-tag
    Labels
  .col-sm-10
    - if issuable.project.labels.any?
      = f.collection_select :label_ids, issuable.project.labels.all, :id, :name,
        { selected: issuable.label_ids }, multiple: true, class: 'select2'
    - else
      %span.light No labels yet.
    &nbsp;
    = link_to 'Create new label', new_project_label_path(issuable.project)

.form-actions
  - if issuable.new_record?
    = f.submit "Submit new #{issuable.class.model_name.human.downcase}", class: 'btn btn-create'
  - else
    = f.submit 'Save changes', class: 'btn btn-save'
  - if issuable.new_record?
    - cancel_project = issuable.source_project
  - else
    - cancel_project = issuable.project
  = link_to 'Cancel', [cancel_project, issuable], class: 'btn btn-cancel'
