BigW Consortium Gitlab

_form.html.haml 1.55 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: { preview_class: "md-preview" } do
13
            = render 'projects/zen', f: f, attr: :description, classes: 'note-textarea', placeholder: 'Write milestone description...'
14
            = render 'projects/notes/hints'
15 16
          .clearfix
          .error-alert
17
    .col-md-6
18
      .form-group
19
        = f.label :due_date, "Due Date", class: "control-label"
20
        .col-sm-10
21
          = f.text_field :due_date, class: "datepicker form-control", placeholder: "Select due date"
22
          %a.inline.prepend-top-5.js-clear-due-date{ href: "#" } Clear due date
23

randx committed
24
  .form-actions
25
    - if @milestone.new_record?
26
      = f.submit 'Create milestone', class: "btn-create btn"
Vinnie Okada committed
27
      = link_to "Cancel", namespace_project_milestones_path(@project.namespace, @project), class: "btn btn-cancel"
28
    -else
29
      = f.submit 'Save changes', class: "btn-save btn"
Vinnie Okada committed
30
      = link_to "Cancel", namespace_project_milestone_path(@project.namespace, @project, @milestone), class: "btn btn-cancel"