debian-mirror-gitlab/app/views/projects/milestones/_form.html.haml

52 lines
2.2 KiB
Text
Raw Normal View History

2014-09-02 18:07:02 +05:30
%h3.page-title= @milestone.new_record? ? "New Milestone" : "Edit Milestone ##{@milestone.iid}"
.back-link
2015-04-26 12:48:37 +05:30
= link_to namespace_project_milestones_path(@project.namespace, @project) do
2014-09-02 18:07:02 +05:30
← To milestones
%hr
2015-09-11 14:41:01 +05:30
= form_for [@project.namespace.becomes(Namespace), @project, @milestone], html: {class: 'form-horizontal milestone-form gfm-form js-requires-input'} do |f|
2014-09-02 18:07:02 +05:30
-if @milestone.errors.any?
.alert.alert-danger
%ul
- @milestone.errors.full_messages.each do |msg|
%li= msg
.row
.col-md-6
.form-group
= f.label :title, "Title", class: "control-label"
.col-sm-10
2015-09-11 14:41:01 +05:30
= f.text_field :title, maxlength: 255, class: "form-control", required: true
2014-09-02 18:07:02 +05:30
%p.hint Required
2015-04-26 12:48:37 +05:30
.form-group.milestone-description
2014-09-02 18:07:02 +05:30
= f.label :description, "Description", class: "control-label"
.col-sm-10
2015-09-25 12:07:36 +05:30
= render layout: 'projects/md_preview', locals: { preview_class: "md-preview" } do
2015-04-26 12:48:37 +05:30
= render 'projects/zen', f: f, attr: :description, classes: 'description form-control'
.hint
.pull-left Milestones are parsed with #{link_to "GitLab Flavored Markdown", help_page_path("markdown", "markdown"), target: '_blank'}.
.pull-left Attach files by dragging & dropping or #{link_to "selecting them", '#', class: 'markdown-selector' }.
2014-09-02 18:07:02 +05:30
.clearfix
.error-alert
.col-md-6
.form-group
= f.label :due_date, "Due Date", class: "control-label"
.col-sm-10= f.hidden_field :due_date
.col-sm-10
.datepicker
.form-actions
- if @milestone.new_record?
= f.submit 'Create milestone', class: "btn-create btn"
2015-04-26 12:48:37 +05:30
= link_to "Cancel", namespace_project_milestones_path(@project.namespace, @project), class: "btn btn-cancel"
2014-09-02 18:07:02 +05:30
-else
= f.submit 'Save changes', class: "btn-save btn"
2015-04-26 12:48:37 +05:30
= link_to "Cancel", namespace_project_milestone_path(@project.namespace, @project, @milestone), class: "btn btn-cancel"
2014-09-02 18:07:02 +05:30
:javascript
$( ".datepicker" ).datepicker({
dateFormat: "yy-mm-dd",
onSelect: function(dateText, inst) { $("#milestone_due_date").val(dateText) }
}).datepicker("setDate", $.datepicker.parseDate('yy-mm-dd', $('#milestone_due_date').val()));