2011-11-25 22:40:12 +01:00
|
|
|
%div.issue-form-holder
|
2012-08-17 08:26:59 +02:00
|
|
|
%h3.page_title= @issue.new_record? ? "New Issue" : "Edit Issue ##{@issue.id}"
|
2012-12-19 04:14:05 +01:00
|
|
|
= form_for [@project, @issue] do |f|
|
2012-01-17 23:46:13 +01:00
|
|
|
-if @issue.errors.any?
|
2013-01-30 15:53:18 +01:00
|
|
|
.alert.alert-error
|
2012-12-19 04:14:05 +01:00
|
|
|
- @issue.errors.full_messages.each do |msg|
|
|
|
|
%span= msg
|
|
|
|
%br
|
2013-01-04 22:35:31 +01:00
|
|
|
.ui-box.ui-box-show
|
|
|
|
.ui-box-head
|
2012-04-16 23:22:59 +02:00
|
|
|
.clearfix
|
2012-08-17 08:26:59 +02:00
|
|
|
= f.label :title do
|
2012-06-27 20:30:35 +02:00
|
|
|
%strong= "Subject *"
|
2012-04-16 23:22:59 +02:00
|
|
|
.input
|
2012-12-19 04:14:05 +01:00
|
|
|
= f.text_field :title, maxlength: 255, class: "xxlarge js-gfm-input", autofocus: true, required: true
|
2013-01-04 22:35:31 +01:00
|
|
|
.ui-box-body
|
|
|
|
.clearfix
|
|
|
|
.issue_assignee.pull-left
|
|
|
|
= f.label :assignee_id do
|
|
|
|
%i.icon-user
|
|
|
|
Assign to
|
|
|
|
.input= f.select(:assignee_id, @project.users.all.collect {|p| [ p.name, p.id ] }, { include_blank: "Select a user" }, {class: 'chosen'})
|
|
|
|
.issue_milestone.pull-left
|
|
|
|
= f.label :milestone_id do
|
|
|
|
%i.icon-time
|
|
|
|
Milestone
|
|
|
|
.input= f.select(:milestone_id, @project.milestones.active.all.collect {|p| [ p.title, p.id ] }, { include_blank: "Select milestone" }, {class: 'chosen'})
|
2012-04-16 23:22:59 +02:00
|
|
|
|
2013-01-04 22:35:31 +01:00
|
|
|
.ui-box-bottom
|
2012-04-16 23:22:59 +02:00
|
|
|
.clearfix
|
2012-08-17 08:26:59 +02:00
|
|
|
= f.label :label_list do
|
|
|
|
%i.icon-tag
|
2012-06-27 20:30:35 +02:00
|
|
|
Labels
|
|
|
|
.input
|
2012-08-11 00:07:50 +02:00
|
|
|
= f.text_field :label_list, maxlength: 2000, class: "xxlarge"
|
2012-06-27 20:30:35 +02:00
|
|
|
%p.hint Separate with comma.
|
2012-06-04 00:37:27 +02:00
|
|
|
|
2012-04-16 23:22:59 +02:00
|
|
|
.clearfix
|
2012-06-27 20:30:35 +02:00
|
|
|
= f.label :description, "Details"
|
2012-04-16 23:22:59 +02:00
|
|
|
.input
|
2012-10-12 08:19:34 +02:00
|
|
|
= f.text_area :description, maxlength: 2000, class: "xxlarge js-gfm-input", rows: 14
|
2012-09-06 09:50:47 +02:00
|
|
|
%p.hint Issues are parsed with #{link_to "GitLab Flavored Markdown", help_markdown_path, target: '_blank'}.
|
2011-11-25 22:40:12 +01:00
|
|
|
|
2012-06-27 20:20:35 +02:00
|
|
|
|
2012-01-29 11:04:09 +01:00
|
|
|
.actions
|
2012-03-17 17:02:48 +01:00
|
|
|
- if @issue.new_record?
|
2013-01-29 21:18:19 +01:00
|
|
|
= f.submit 'Submit new issue', class: "btn btn-create"
|
2012-03-17 17:02:48 +01:00
|
|
|
-else
|
2013-01-29 21:18:19 +01:00
|
|
|
= f.submit 'Save changes', class: "btn-save btn"
|
2012-01-28 00:49:14 +01:00
|
|
|
|
2012-12-19 04:14:05 +01:00
|
|
|
- cancel_path = @issue.new_record? ? project_issues_path(@project) : project_issue_path(@project, @issue)
|
2013-01-29 21:18:19 +01:00
|
|
|
= link_to "Cancel", cancel_path, class: 'btn btn-cancel'
|
2012-12-18 04:14:05 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
:javascript
|
|
|
|
$(function(){
|
|
|
|
$("#issue_label_list")
|
|
|
|
.bind( "keydown", function( event ) {
|
|
|
|
if ( event.keyCode === $.ui.keyCode.TAB &&
|
|
|
|
$( this ).data( "autocomplete" ).menu.active ) {
|
|
|
|
event.preventDefault();
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.autocomplete({
|
|
|
|
minLength: 0,
|
|
|
|
source: function( request, response ) {
|
|
|
|
response( $.ui.autocomplete.filter(
|
|
|
|
#{raw labels_autocomplete_source}, extractLast( request.term ) ) );
|
|
|
|
},
|
|
|
|
focus: function() {
|
|
|
|
return false;
|
|
|
|
},
|
|
|
|
select: function(event, ui) {
|
|
|
|
var terms = split( this.value );
|
|
|
|
terms.pop();
|
|
|
|
terms.push( ui.item.value );
|
|
|
|
terms.push( "" );
|
|
|
|
this.value = terms.join( ", " );
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|