2013-10-19 03:23:51 -04:00
|
|
|
%h3.page-title= @milestone.new_record? ? "New Milestone" : "Edit Milestone ##{@milestone.iid}"
|
2013-07-13 01:45:48 -04:00
|
|
|
.back-link
|
2012-06-03 18:37:27 -04:00
|
|
|
= link_to project_milestones_path(@project) do
|
2012-04-08 17:28:58 -04:00
|
|
|
← To milestones
|
|
|
|
|
|
|
|
%hr
|
|
|
|
|
2012-08-10 18:07:50 -04:00
|
|
|
= form_for [@project, @milestone], html: {class: "new_milestone form-horizontal"} do |f|
|
2012-04-08 17:28:58 -04:00
|
|
|
-if @milestone.errors.any?
|
2013-12-31 09:34:14 -05:00
|
|
|
.alert.alert-danger
|
2012-04-08 17:28:58 -04:00
|
|
|
%ul
|
|
|
|
- @milestone.errors.full_messages.each do |msg|
|
|
|
|
%li= msg
|
|
|
|
.row
|
2013-12-30 16:55:15 -05:00
|
|
|
.col-md-6
|
2013-12-30 18:27:02 -05:00
|
|
|
.form-group
|
2012-08-10 18:07:50 -04:00
|
|
|
= f.label :title, "Title", class: "control-label"
|
2013-12-30 18:27:02 -05:00
|
|
|
.col-sm-10
|
2014-01-01 15:11:18 -05:00
|
|
|
= f.text_field :title, maxlength: 255, class: "form-control"
|
2012-08-17 02:26:59 -04:00
|
|
|
%p.hint Required
|
2013-12-30 18:27:02 -05:00
|
|
|
.form-group
|
2012-08-10 18:07:50 -04:00
|
|
|
= f.label :description, "Description", class: "control-label"
|
2013-12-30 18:27:02 -05:00
|
|
|
.col-sm-10
|
2014-07-15 03:34:05 -04:00
|
|
|
= f.text_area :description, maxlength: 65535, class: "form-control markdown-area", rows: 10
|
2014-05-23 04:22:00 -04:00
|
|
|
.hint
|
2014-05-28 09:58:02 -04:00
|
|
|
.pull-left Milestones are parsed with #{link_to "GitLab Flavored Markdown", help_page_path("markdown", "markdown"), target: '_blank'}.
|
2014-06-03 03:56:40 -04:00
|
|
|
.pull-left Attach images (JPG, PNG, GIF) by dragging & dropping or #{link_to "selecting them", '#', class: 'markdown-selector' }.
|
2014-05-23 04:22:00 -04:00
|
|
|
.clearfix
|
|
|
|
.error-alert
|
2013-12-30 16:55:15 -05:00
|
|
|
.col-md-6
|
2013-12-30 18:27:02 -05:00
|
|
|
.form-group
|
2012-08-10 18:07:50 -04:00
|
|
|
= f.label :due_date, "Due Date", class: "control-label"
|
2013-12-30 18:27:02 -05:00
|
|
|
.col-sm-10= f.hidden_field :due_date
|
|
|
|
.col-sm-10
|
2012-04-08 17:28:58 -04:00
|
|
|
.datepicker
|
|
|
|
|
2012-04-10 01:51:08 -04:00
|
|
|
.form-actions
|
2012-04-08 17:28:58 -04:00
|
|
|
- if @milestone.new_record?
|
2013-08-01 15:35:40 -04:00
|
|
|
= f.submit 'Create milestone', class: "btn-create btn"
|
2013-01-29 15:18:19 -05:00
|
|
|
= link_to "Cancel", project_milestones_path(@project), class: "btn btn-cancel"
|
2012-04-08 17:28:58 -04:00
|
|
|
-else
|
2013-01-29 15:18:19 -05:00
|
|
|
= f.submit 'Save changes', class: "btn-save btn"
|
|
|
|
= link_to "Cancel", project_milestone_path(@project, @milestone), class: "btn btn-cancel"
|
2012-04-08 17:28:58 -04:00
|
|
|
|
|
|
|
|
|
|
|
:javascript
|
2013-06-21 15:08:16 -04:00
|
|
|
disableButtonIfEmptyField("#milestone_title", ".btn-save");
|
|
|
|
$( ".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()));
|
2014-05-23 04:22:00 -04:00
|
|
|
|
|
|
|
window.project_image_path_upload = "#{upload_image_project_path @project}";
|