73 lines
3.1 KiB
Text
73 lines
3.1 KiB
Text
|
%div.issue-form-holder
|
||
|
%h3.page-title= @issue.new_record? ? "New Issue" : "Edit Issue ##{@issue.iid}"
|
||
|
%hr
|
||
|
- if @repository.exists? && !@repository.empty? && @repository.contribution_guide && !@issue.persisted?
|
||
|
- contribution_guide_url = project_blob_path(@project, tree_join(@repository.root_ref, @repository.contribution_guide.name))
|
||
|
.row
|
||
|
.col-sm-10.col-sm-offset-2
|
||
|
.alert.alert-info
|
||
|
= "Please review the <strong>#{link_to "guidelines for contribution", contribution_guide_url}</strong> to this repository.".html_safe
|
||
|
|
||
|
= form_for [@project, @issue], html: { class: 'form-horizontal issue-form' } do |f|
|
||
|
-if @issue.errors.any?
|
||
|
.row
|
||
|
.col-sm-10.col-sm-offset-2
|
||
|
.alert.alert-danger
|
||
|
- @issue.errors.full_messages.each do |msg|
|
||
|
%span= msg
|
||
|
%br
|
||
|
.form-group
|
||
|
= f.label :title, class: 'control-label' do
|
||
|
%strong= 'Title *'
|
||
|
.col-sm-10
|
||
|
= f.text_field :title, maxlength: 255, class: "form-control js-gfm-input", autofocus: true, required: true
|
||
|
.form-group
|
||
|
= f.label :description, 'Description', class: 'control-label'
|
||
|
.col-sm-10
|
||
|
= f.text_area :description, class: 'form-control js-gfm-input markdown-area', rows: 14
|
||
|
.col-sm-12.hint
|
||
|
.pull-left Issues are parsed with #{link_to "GitLab Flavored Markdown", help_page_path("markdown", "markdown"), target: '_blank'}.
|
||
|
.pull-right Attach images (JPG, PNG, GIF) by dragging & dropping or #{link_to "selecting them", '#', class: 'markdown-selector' }.
|
||
|
.clearfix
|
||
|
.error-alert
|
||
|
%hr
|
||
|
.form-group
|
||
|
.issue-assignee
|
||
|
= f.label :assignee_id, class: 'control-label' do
|
||
|
%i.icon-user
|
||
|
Assign to
|
||
|
.col-sm-10
|
||
|
= project_users_select_tag('issue[assignee_id]', placeholder: 'Select a user', class: 'custom-form-control', selected: @issue.assignee_id)
|
||
|
|
||
|
= link_to 'Assign to me', '#', class: 'btn assign-to-me-link'
|
||
|
.form-group
|
||
|
.issue-milestone
|
||
|
= f.label :milestone_id, class: 'control-label' do
|
||
|
%i.icon-time
|
||
|
Milestone
|
||
|
.col-sm-10= f.select(:milestone_id, milestone_options(@issue), { include_blank: "Select milestone" }, {class: 'select2'})
|
||
|
|
||
|
.form-group
|
||
|
= f.label :label_ids, class: 'control-label' do
|
||
|
%i.icon-tag
|
||
|
Labels
|
||
|
.col-sm-10
|
||
|
= f.collection_select :label_ids, @project.labels.all, :id, :name, { selected: @issue.label_ids }, multiple: true, class: 'select2'
|
||
|
|
||
|
.form-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
|
||
|
$('.assign-to-me-link').on('click', function(e){
|
||
|
$('#issue_assignee_id').val("#{current_user.id}").trigger("change");
|
||
|
e.preventDefault();
|
||
|
});
|
||
|
|
||
|
window.project_image_path_upload = "#{upload_image_project_path @project}";
|