BigW Consortium Gitlab

_form.html.haml 1.26 KB
Newer Older
1
= form_for [@project.namespace.becomes(Namespace), @project, @milestone], html: {class: 'form-horizontal milestone-form common-note-form js-quick-submit js-requires-input'}  do |f|
2
  = form_errors(@milestone)
3
  .row
4
    .col-md-6
5
      .form-group
6
        = f.label :title, "Title", class: "control-label"
7
        .col-sm-10
8
          = f.text_field :title, maxlength: 255, class: "form-control", required: true, autofocus: true
9
      .form-group.milestone-description
10
        = f.label :description, "Description", class: "control-label"
11
        .col-sm-10
12
          = render layout: 'projects/md_preview', locals: { url: preview_markdown_path(@project) } do
13
            = render 'projects/zen', f: f, attr: :description, classes: 'note-textarea', placeholder: 'Write milestone description...'
14
            = render 'shared/notes/hints'
15 16
          .clearfix
          .error-alert
17
    = render "shared/milestones/form_dates", f: f
18

randx committed
19
  .form-actions
20
    - if @milestone.new_record?
21
      = f.submit 'Create milestone', class: "btn-create btn"
22
      = link_to "Cancel", project_milestones_path(@project), class: "btn btn-cancel"
23
    - else
24
      = f.submit 'Save changes', class: "btn-save btn"
25
      = link_to "Cancel", project_milestone_path(@project, @milestone), class: "btn btn-cancel"