95 lines
3.1 KiB
Text
95 lines
3.1 KiB
Text
%div.issue-form-holder
|
|
%h3.page_title= @issue.new_record? ? "New Issue" : "Edit Issue ##{@issue.id}"
|
|
= form_for [@project, @issue] do |f|
|
|
-if @issue.errors.any?
|
|
.alert.alert-error
|
|
- @issue.errors.full_messages.each do |msg|
|
|
%span= msg
|
|
%br
|
|
.ui-box.ui-box-show
|
|
.ui-box-head
|
|
.clearfix
|
|
= f.label :title do
|
|
%strong= "Subject *"
|
|
.input
|
|
= f.text_field :title, maxlength: 255, class: "xxlarge js-gfm-input", autofocus: true, required: true
|
|
.ui-box-body
|
|
.clearfix
|
|
.issue_assignee.pull-left
|
|
= f.label :assignee_id do
|
|
%i.icon-user
|
|
Assign to
|
|
.input
|
|
.pull-left
|
|
= f.select(:assignee_id, @project.team.members.sort_by(&:name).map {|p| [ p.name, p.id ] }, { include_blank: "Select a user" }, {class: 'chosen'})
|
|
.pull-right
|
|
|
|
= link_to 'Assign to me', '#', class: 'btn btn-small assign-to-me-link'
|
|
.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'})
|
|
|
|
.ui-box-bottom
|
|
.clearfix
|
|
= f.label :label_list do
|
|
%i.icon-tag
|
|
Labels
|
|
.input
|
|
= f.text_field :label_list, maxlength: 2000, class: "xxlarge"
|
|
%p.hint Separate with comma.
|
|
|
|
.clearfix
|
|
= f.label :description, "Details"
|
|
.input
|
|
= f.text_area :description, class: "xxlarge js-gfm-input", rows: 14
|
|
%p.hint Issues are parsed with #{link_to "GitLab Flavored Markdown", help_markdown_path, target: '_blank'}.
|
|
|
|
|
|
.actions
|
|
- if @issue.new_record?
|
|
= f.submit 'Submit new issue', class: "btn btn-create"
|
|
-else
|
|
= f.submit 'Save changes', class: "btn-save btn"
|
|
|
|
- cancel_path = @issue.new_record? ? project_issues_path(@project) : project_issue_path(@project, @issue)
|
|
= link_to "Cancel", cancel_path, class: 'btn btn-cancel'
|
|
|
|
|
|
|
|
|
|
:javascript
|
|
$("#issue_label_list")
|
|
.bind( "keydown", function( event ) {
|
|
if ( event.keyCode === $.ui.keyCode.TAB &&
|
|
$( this ).data( "autocomplete" ).menu.active ) {
|
|
event.preventDefault();
|
|
}
|
|
})
|
|
.bind( "click", function( event ) {
|
|
$( this ).autocomplete("search", "");
|
|
})
|
|
.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;
|
|
}
|
|
});
|
|
|
|
$('.assign-to-me-link').on('click', function(e){
|
|
$('#issue_assignee_id').val("#{current_user.id}").trigger("liszt:updated");
|
|
e.preventDefault();
|
|
});
|