2011-11-25 21:40:12 +00:00
|
|
|
%div.issue-form-holder
|
2013-10-19 07:23:51 +00:00
|
|
|
%h3.page-title= @issue.new_record? ? "New Issue" : "Edit Issue ##{@issue.iid}"
|
2014-01-01 20:11:18 +00:00
|
|
|
%hr
|
2014-04-08 15:12:57 +00:00
|
|
|
- if @repository.exists? && !@repository.empty? && @repository.contribution_guide && !@issue.persisted?
|
2014-02-22 15:37:10 +00:00
|
|
|
- contribution_guide_url = project_blob_path(@project, tree_join(@repository.root_ref, @repository.contribution_guide.name))
|
|
|
|
.alert.alert-info.col-sm-10.col-sm-offset-2
|
|
|
|
="Please review the <strong>#{link_to "guidelines for contribution", contribution_guide_url}</strong> to this repository.".html_safe
|
2014-05-23 08:22:00 +00:00
|
|
|
|
2014-01-01 20:11:18 +00:00
|
|
|
= form_for [@project, @issue], html: { class: 'form-horizontal issue-form' } do |f|
|
2012-01-17 22:46:13 +00:00
|
|
|
-if @issue.errors.any?
|
2013-12-31 14:34:14 +00:00
|
|
|
.alert.alert-danger
|
2012-12-19 03:14:05 +00:00
|
|
|
- @issue.errors.full_messages.each do |msg|
|
|
|
|
%span= msg
|
|
|
|
%br
|
2014-01-01 20:11:18 +00:00
|
|
|
.form-group
|
|
|
|
= f.label :title, class: 'control-label' do
|
2014-04-14 21:36:12 +00:00
|
|
|
%strong= 'Title *'
|
2014-01-01 20:11:18 +00:00
|
|
|
.col-sm-10
|
|
|
|
= f.text_field :title, maxlength: 255, class: "form-control js-gfm-input", autofocus: true, required: true
|
|
|
|
.form-group
|
2014-04-14 21:36:12 +00:00
|
|
|
= f.label :description, 'Description', class: 'control-label'
|
2014-01-01 20:11:18 +00:00
|
|
|
.col-sm-10
|
2014-05-23 08:22:00 +00:00
|
|
|
= f.text_area :description, class: 'form-control js-gfm-input markdown-area', rows: 14
|
|
|
|
.col-sm-12.hint
|
2014-05-28 13:58:02 +00:00
|
|
|
.pull-left Issues are parsed with #{link_to "GitLab Flavored Markdown", help_page_path("markdown", "markdown"), target: '_blank'}.
|
2014-06-03 07:56:40 +00:00
|
|
|
.pull-right Attach images (JPG, PNG, GIF) by dragging & dropping or #{link_to "selecting them", '#', class: 'markdown-selector' }.
|
2014-05-23 08:22:00 +00:00
|
|
|
.clearfix
|
|
|
|
.error-alert
|
2014-01-01 20:11:18 +00:00
|
|
|
%hr
|
|
|
|
.form-group
|
2014-01-01 20:27:10 +00:00
|
|
|
.issue-assignee
|
2014-01-01 20:11:18 +00:00
|
|
|
= f.label :assignee_id, class: 'control-label' do
|
|
|
|
%i.icon-user
|
|
|
|
Assign to
|
|
|
|
.col-sm-10
|
2014-02-17 16:23:11 +00:00
|
|
|
= project_users_select_tag('issue[assignee_id]', placeholder: 'Select a user', class: 'custom-form-control', selected: @issue.assignee_id)
|
2014-01-01 20:11:18 +00:00
|
|
|
|
|
|
|
= link_to 'Assign to me', '#', class: 'btn btn-small assign-to-me-link'
|
|
|
|
.form-group
|
2014-01-01 20:27:10 +00:00
|
|
|
.issue-milestone
|
2014-01-01 20:11:18 +00:00
|
|
|
= f.label :milestone_id, class: 'control-label' do
|
|
|
|
%i.icon-time
|
|
|
|
Milestone
|
2014-01-11 10:11:54 +00:00
|
|
|
.col-sm-10= f.select(:milestone_id, milestone_options(@issue), { include_blank: "Select milestone" }, {class: 'select2'})
|
2012-04-16 21:22:59 +00:00
|
|
|
|
2014-01-01 20:11:18 +00:00
|
|
|
.form-group
|
|
|
|
= f.label :label_list, class: 'control-label' do
|
|
|
|
%i.icon-tag
|
|
|
|
Labels
|
|
|
|
.col-sm-10
|
|
|
|
= f.text_field :label_list, maxlength: 2000, class: "form-control"
|
|
|
|
%p.hint Separate labels with commas.
|
2012-06-03 22:37:27 +00:00
|
|
|
|
2011-11-25 21:40:12 +00:00
|
|
|
|
2012-06-27 18:20:35 +00:00
|
|
|
|
2013-08-07 20:35:24 +00:00
|
|
|
.form-actions
|
2012-03-17 16:02:48 +00:00
|
|
|
- if @issue.new_record?
|
2013-01-29 20:18:19 +00:00
|
|
|
= f.submit 'Submit new issue', class: "btn btn-create"
|
2012-03-17 16:02:48 +00:00
|
|
|
-else
|
2013-01-29 20:18:19 +00:00
|
|
|
= f.submit 'Save changes', class: "btn-save btn"
|
2012-01-27 23:49:14 +00:00
|
|
|
|
2012-12-19 03:14:05 +00:00
|
|
|
- cancel_path = @issue.new_record? ? project_issues_path(@project) : project_issue_path(@project, @issue)
|
2013-01-29 20:18:19 +00:00
|
|
|
= link_to "Cancel", cancel_path, class: 'btn btn-cancel'
|
2012-12-18 03:14:05 +00:00
|
|
|
|
|
|
|
:javascript
|
2013-05-29 10:16:30 +00:00
|
|
|
$("#issue_label_list")
|
|
|
|
.bind( "keydown", function( event ) {
|
|
|
|
if ( event.keyCode === $.ui.keyCode.TAB &&
|
|
|
|
$( this ).data( "autocomplete" ).menu.active ) {
|
|
|
|
event.preventDefault();
|
|
|
|
}
|
|
|
|
})
|
2013-09-12 17:15:10 +00:00
|
|
|
.bind("click", function(event) {
|
|
|
|
$(this).autocomplete("search", "");
|
2013-06-09 16:36:08 +00:00
|
|
|
})
|
2013-05-29 10:16:30 +00:00
|
|
|
.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;
|
|
|
|
}
|
|
|
|
});
|
2012-12-18 03:14:05 +00:00
|
|
|
|
2013-05-29 10:16:30 +00:00
|
|
|
$('.assign-to-me-link').on('click', function(e){
|
2014-01-11 10:11:54 +00:00
|
|
|
$('#issue_assignee_id').val("#{current_user.id}").trigger("change");
|
2013-05-29 10:16:30 +00:00
|
|
|
e.preventDefault();
|
|
|
|
});
|
2014-05-23 08:22:00 +00:00
|
|
|
|
|
|
|
window.project_image_path_upload = "#{upload_image_project_path @project}";
|