2016-04-04 21:25:38 -04:00
= form_errors(issuable)
2014-09-03 07:15:03 -04:00
.form-group
2015-12-02 08:35:19 -05:00
= f.label :title, class: 'control-label'
2014-09-03 07:15:03 -04:00
.col-sm-10
2015-09-09 18:04:38 -04:00
= f.text_field :title, maxlength: 255, autofocus: true, autocomplete: 'off',
2016-02-12 16:28:53 -05:00
class: 'form-control pad js-gfm-input', required: true
2015-05-15 07:50:04 -04:00
- if issuable.is_a?(MergeRequest)
2015-05-20 08:00:45 -04:00
%p.help-block
2016-02-26 22:34:32 -05:00
.js-wip-explanation
2016-03-28 17:04:11 -04:00
%a.js-toggle-wip{href: "", tabindex: -1}
2016-03-18 18:27:35 -04:00
Remove the
%code WIP:
prefix from the title
2016-02-26 22:34:32 -05:00
to allow this
2016-03-18 18:27:35 -04:00
%strong Work In Progress
merge request to be merged when it's ready.
2016-02-26 22:34:32 -05:00
.js-no-wip-explanation
2016-03-28 17:04:11 -04:00
%a.js-toggle-wip{href: "", tabindex: -1}
2016-03-18 18:27:35 -04:00
Start the title with
%code WIP:
2016-02-26 22:34:32 -05:00
to prevent a
2016-03-18 18:27:35 -04:00
%strong Work In Progress
merge request from being merged before it's ready.
2015-12-16 10:13:22 -05:00
.form-group.detail-page-description
2014-09-03 07:15:03 -04:00
= f.label :description, 'Description', class: 'control-label'
.col-sm-10
2014-10-15 03:21:21 -04:00
2015-09-21 17:08:26 -04:00
= render layout: 'projects/md_preview', locals: { preview_class: "md-preview", referenced_users: true } do
2014-10-15 03:21:21 -04:00
= render 'projects/zen', f: f, attr: :description,
2016-04-05 07:33:30 -04:00
classes: 'note-textarea',
placeholder: "Write a comment or drag your files here..."
2015-11-07 14:22:16 -05:00
= render 'projects/notes/hints'
2014-10-15 03:21:21 -04:00
.clearfix
.error-alert
2016-03-17 15:16:48 -04:00
- if issuable.is_a?(Issue) && !issuable.project.private?
.form-group
.col-sm-offset-2.col-sm-10
.checkbox
= f.label :confidential do
= f.check_box :confidential
This issue is confidential and should only be visible to team members
2015-08-20 21:32:32 -04:00
- if can?(current_user, :"admin_#{issuable.to_ability_name}", issuable.project)
2015-12-02 08:30:12 -05:00
%hr
2015-06-25 09:38:04 -04:00
.form-group
.issue-assignee
2015-12-02 08:30:12 -05:00
= f.label :assignee_id, "Assignee", class: 'control-label'
2015-06-25 09:38:04 -04:00
.col-sm-10
2016-04-11 04:43:59 -04:00
.issuable-form-select-holder
= users_select_tag("#{issuable.class.model_name.param_key}[assignee_id]",
placeholder: 'Select assignee', class: 'custom-form-control', null_user: true,
selected: issuable.assignee_id, project: @target_project || @project,
first_user: true, current_user: true, include_blank: true)
2015-06-25 09:38:04 -04:00
= link_to 'Assign to me', '#', class: 'btn assign-to-me-link'
.form-group
.issue-milestone
2015-12-02 08:30:12 -05:00
= f.label :milestone_id, "Milestone", class: 'control-label'
2015-06-25 09:38:04 -04:00
.col-sm-10
- if milestone_options(issuable).present?
2016-04-11 04:43:59 -04:00
.issuable-form-select-holder
= f.select(:milestone_id, milestone_options(issuable),
{ include_blank: true }, { class: 'select2', data: { placeholder: 'Select milestone' } })
2015-06-25 09:38:04 -04:00
- else
.prepend-top-10
%span.light No open milestones available.
- if can? current_user, :admin_milestone, issuable.project
= link_to 'Create new milestone', new_namespace_project_milestone_path(issuable.project.namespace, issuable.project), target: :blank
.form-group
2016-04-11 12:04:01 -04:00
- has_labels = issuable.project.labels.any?
2015-12-02 08:30:12 -05:00
= f.label :label_ids, "Labels", class: 'control-label'
2016-04-11 12:04:01 -04:00
.col-sm-10{ class: ('issuable-form-padding-top' if !has_labels) }
- if has_labels
2015-06-25 09:38:04 -04:00
= f.collection_select :label_ids, issuable.project.labels.all, :id, :name,
2015-12-02 08:24:29 -05:00
{ selected: issuable.label_ids }, multiple: true, class: 'select2', data: { placeholder: "Select labels" }
2014-10-02 05:49:31 -04:00
- else
2015-06-25 09:38:04 -04:00
%span.light No labels yet.
2014-10-02 05:49:31 -04:00
2015-06-25 09:38:04 -04:00
- if can? current_user, :admin_label, issuable.project
= link_to 'Create new label', new_namespace_project_label_path(issuable.project.namespace, issuable.project), target: :blank
2014-10-02 05:55:02 -04:00
2016-03-18 09:48:55 -04:00
- if issuable.can_move?(current_user)
2016-02-16 08:05:11 -05:00
%hr
2016-03-18 09:48:55 -04:00
.form-group
= label_tag :move_to_project_id, 'Move', class: 'control-label'
.col-sm-10
- projects = project_options(issuable, current_user, ability: :admin_issue)
= select_tag(:move_to_project_id, projects, include_blank: true,
class: 'select2', data: { placeholder: 'Select project' })
2016-03-20 05:01:12 -04:00
2016-03-20 12:38:08 -04:00
%span{ data: { toggle: 'tooltip', placement: 'auto top' }, style: 'cursor: default',
2016-03-20 05:01:12 -04:00
title: 'Moving an issue will copy the discussion to a different project and close it here. All participants will be notified of the new location.' }
2016-03-20 12:38:08 -04:00
= icon('question-circle')
2016-02-16 08:05:11 -05:00
2015-05-28 21:00:37 -04:00
- if issuable.is_a?(MergeRequest)
%hr
2016-03-18 09:48:55 -04:00
- if @merge_request.new_record?
.form-group
= f.label :source_branch, class: 'control-label'
.col-sm-10
= f.select(:source_branch, [@merge_request.source_branch], { }, { class: 'source_branch select2 span2', disabled: true })
2015-05-28 21:00:37 -04:00
.form-group
2015-12-02 08:30:12 -05:00
= f.label :target_branch, class: 'control-label'
2015-05-28 21:00:37 -04:00
.col-sm-10
2015-12-02 08:24:29 -05:00
= f.select(:target_branch, @merge_request.target_branches, { include_blank: true }, { class: 'target_branch select2 span2', disabled: @merge_request.new_record?, data: {placeholder: "Select branch"} })
2015-06-19 00:55:44 -04:00
- if @merge_request.new_record?
%p.help-block
= link_to 'Change branches', mr_change_branches_path(@merge_request)
2015-05-28 21:00:37 -04:00
2015-12-02 08:48:06 -05:00
- is_footer = !(issuable.is_a?(MergeRequest) && issuable.new_record?)
.gray-content-block{class: (is_footer ? "footer-block" : "middle-block")}
2014-09-20 10:06:35 -04:00
- if issuable.new_record?
2015-12-02 08:33:14 -05:00
= f.submit "Submit #{issuable.class.model_name.human.downcase}", class: 'btn btn-create'
2014-09-20 10:06:35 -04:00
- else
= f.submit 'Save changes', class: 'btn btn-save'
2015-12-02 08:21:03 -05:00
- if !issuable.persisted? && !issuable.project.empty_repo? && (guide_url = contribution_guide_path(issuable.project))
.inline.prepend-left-10
Please review the
%strong #{link_to 'contribution guidelines', guide_url}
for this project.
2014-09-20 10:06:35 -04:00
- if issuable.new_record?
2016-03-28 02:35:53 -04:00
= link_to 'Cancel', polymorphic_path([@project.namespace.becomes(Namespace), @project, issuable.class]), class: 'btn btn-cancel'
2014-09-20 10:06:35 -04:00
- else
2016-03-21 09:12:52 -04:00
.pull-right
- if current_user.can?(:"destroy_#{issuable.to_ability_name}", @project)
2016-04-11 18:20:38 -04:00
= link_to 'Delete', polymorphic_path([@project.namespace.becomes(Namespace), @project, issuable]), data: { confirm: "#{issuable.class.name.titleize} will be removed! Are you sure?" },
method: :delete, class: 'btn btn-danger btn-grouped'
2016-03-24 15:29:09 -04:00
= link_to 'Cancel', polymorphic_path([@project.namespace.becomes(Namespace), @project, issuable]), class: 'btn btn-grouped btn-cancel'