2016-11-14 12:19:46 +00:00
- form = local_assigns.fetch(:f)
2016-07-19 09:05:38 +00:00
- project = @target_project || @project
2016-11-02 17:52:04 +00:00
2016-04-05 01:25:38 +00:00
= form_errors(issuable)
2016-08-01 15:34:17 +00:00
- if @conflict
.alert.alert-danger
Someone edited the #{issuable.class.model_name.human.downcase} the same time you did.
Please check out
= link_to "the #{issuable.class.model_name.human.downcase}", polymorphic_path([@project.namespace.becomes(Namespace), @project, issuable]), target: "_blank"
and make sure your changes will not unintentionally remove theirs
2014-09-03 11:15:03 +00:00
.form-group
2016-11-14 12:19:46 +00:00
= form.label :title, class: 'control-label'
2016-06-24 19:43:46 +00:00
2016-11-02 17:52:04 +00:00
= render 'shared/issuable/form/template_selector', issuable: issuable
2016-11-14 12:19:46 +00:00
= render 'shared/issuable/form/title', issuable: issuable, form: form
2016-06-24 19:43:46 +00:00
2015-12-16 15:13:22 +00:00
.form-group.detail-page-description
2016-11-14 12:19:46 +00:00
= form.label :description, 'Description', class: 'control-label'
2014-09-03 11:15:03 +00:00
.col-sm-10
2014-10-15 07:21:21 +00:00
2015-09-21 21:08:26 +00:00
= render layout: 'projects/md_preview', locals: { preview_class: "md-preview", referenced_users: true } do
2016-11-14 12:19:46 +00:00
= render 'projects/zen', f: form, attr: :description,
2016-04-05 11:33:30 +00:00
classes: 'note-textarea',
2016-08-13 01:19:16 +00:00
placeholder: "Write a comment or drag your files here...",
supports_slash_commands: !issuable.persisted?
2016-08-13 01:19:52 +00:00
= render 'projects/notes/hints', supports_slash_commands: !issuable.persisted?
2014-10-15 07:21:21 +00:00
.clearfix
.error-alert
2016-03-17 19:16:48 +00:00
2016-06-06 18:56:04 +00:00
- if issuable.is_a?(Issue)
2016-03-17 19:16:48 +00:00
.form-group
.col-sm-offset-2.col-sm-10
.checkbox
2016-11-14 12:19:46 +00:00
= form.label :confidential do
= form.check_box :confidential
2016-06-06 19:13:31 +00:00
This issue is confidential and should only be visible to team members with at least Reporter access.
2016-03-17 19:16:48 +00:00
2015-08-21 01:32:32 +00:00
- if can?(current_user, :"admin_#{issuable.to_ability_name}", issuable.project)
2016-04-22 20:23:55 +00:00
- has_due_date = issuable.has_attribute?(:due_date)
2015-12-02 13:30:12 +00:00
%hr
2016-04-22 20:23:55 +00:00
.row
%div{ class: (has_due_date ? "col-lg-6" : "col-sm-12") }
.form-group.issue-assignee
2016-11-14 12:19:46 +00:00
= form.label :assignee_id, "Assignee", class: "control-label #{"col-lg-4" if has_due_date}"
2016-04-22 20:23:55 +00:00
.col-sm-10{ class: ("col-lg-8" if has_due_date) }
2016-04-11 08:43:59 +00:00
.issuable-form-select-holder
2016-07-16 07:12:12 +00:00
- if issuable.assignee_id
2016-11-14 12:19:46 +00:00
= form.hidden_field :assignee_id
2016-10-14 09:49:23 +00:00
= dropdown_tag(user_dropdown_label(issuable.assignee_id, "Assignee"), options: { toggle_class: "js-dropdown-keep-input js-user-search js-issuable-form-dropdown js-assignee-search", title: "Select assignee", filter: true, dropdown_class: "dropdown-menu-user dropdown-menu-selectable dropdown-menu-assignee js-filter-submit",
2016-10-19 19:09:18 +00:00
placeholder: "Search assignee", data: { first_user: current_user.try(:username), null_user: true, current_user: true, project_id: project.try(:id), selected: issuable.assignee_id, field_name: "#{issuable.class.model_name.param_key}[assignee_id]", default_label: "Assignee"} })
2016-04-22 20:23:55 +00:00
.form-group.issue-milestone
2016-11-14 12:19:46 +00:00
= form.label :milestone_id, "Milestone", class: "control-label #{"col-lg-4" if has_due_date}"
2016-04-22 20:23:55 +00:00
.col-sm-10{ class: ("col-lg-8" if has_due_date) }
2016-07-16 07:12:12 +00:00
.issuable-form-select-holder
2016-10-19 19:09:18 +00:00
= render "shared/issuable/milestone_dropdown", selected: issuable.milestone, name: "#{issuable.class.model_name.param_key}[milestone_id]", show_any: false, show_upcoming: false, extra_class: "js-issuable-form-dropdown js-dropdown-keep-input", dropdown_title: "Select milestone"
2016-04-22 20:23:55 +00:00
.form-group
2016-09-19 20:21:39 +00:00
- has_labels = @labels && @labels.any?
2016-11-14 12:19:46 +00:00
= form.label :label_ids, "Labels", class: "control-label #{"col-lg-4" if has_due_date}"
= form.hidden_field :label_ids, multiple: true, value: ''
2016-04-22 20:23:55 +00:00
.col-sm-10{ class: "#{"col-lg-8" if has_due_date} #{'issuable-form-padding-top' if !has_labels}" }
2016-07-16 07:12:12 +00:00
.issuable-form-select-holder
2016-10-19 19:09:18 +00:00
= render "shared/issuable/label_dropdown", classes: ["js-issuable-form-dropdown"], selected: issuable.labels, data_options: { field_name: "#{issuable.class.model_name.param_key}[label_ids][]", show_any: false}, dropdown_title: "Select label"
2016-04-25 07:04:37 +00:00
- if has_due_date
2016-04-22 20:23:55 +00:00
.col-lg-6
.form-group
2016-11-14 12:19:46 +00:00
= form.label :due_date, "Due date", class: "control-label"
2016-04-22 20:23:55 +00:00
.col-sm-10
2016-06-06 08:26:47 +00:00
.issuable-form-select-holder
2016-11-14 12:19:46 +00:00
= form.text_field :due_date, id: "issuable-due-date", class: "datepicker form-control", placeholder: "Select due date"
2014-10-02 09:55:02 +00:00
2016-03-18 13:48:55 +00:00
- if issuable.can_move?(current_user)
2016-02-16 13:05:11 +00:00
%hr
2016-03-18 13:48:55 +00:00
.form-group
= label_tag :move_to_project_id, 'Move', class: 'control-label'
.col-sm-10
2016-04-20 13:59:07 +00:00
.issuable-form-select-holder
2016-08-05 13:29:20 +00:00
= hidden_field_tag :move_to_project_id, nil, class: 'js-move-dropdown', data: { placeholder: 'Select project', projects_url: autocomplete_projects_path(project_id: @project.id), page_size: MoveToProjectFinder::PAGE_SIZE }
2016-03-20 09:01:12 +00:00
2016-03-20 16:38:08 +00:00
%span{ data: { toggle: 'tooltip', placement: 'auto top' }, style: 'cursor: default',
2016-03-20 09:01:12 +00: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 16:38:08 +00:00
= icon('question-circle')
2016-02-16 13:05:11 +00:00
2016-08-10 13:36:30 +00:00
- if issuable.is_a?(MergeRequest) && !issuable.closed_without_fork?
2015-05-29 01:00:37 +00:00
%hr
2016-03-18 13:48:55 +00:00
- if @merge_request.new_record?
.form-group
2016-11-14 12:19:46 +00:00
= form.label :source_branch, class: 'control-label'
2016-03-18 13:48:55 +00:00
.col-sm-10
2016-04-20 13:59:07 +00:00
.issuable-form-select-holder
2016-11-14 12:19:46 +00:00
= form.select(:source_branch, [@merge_request.source_branch], { }, { class: 'source_branch select2 span2', disabled: true })
2015-05-29 01:00:37 +00:00
.form-group
2016-11-14 12:19:46 +00:00
= form.label :target_branch, class: 'control-label'
2015-05-29 01:00:37 +00:00
.col-sm-10
2016-04-20 13:59:07 +00:00
.issuable-form-select-holder
2016-11-14 12:19:46 +00:00
= form.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 04:55:44 +00:00
- if @merge_request.new_record?
2016-04-20 13:59:07 +00:00
2015-06-19 04:55:44 +00:00
= link_to 'Change branches', mr_change_branches_path(@merge_request)
2016-02-12 20:41:31 +00:00
- if @merge_request.can_remove_source_branch?(current_user)
.form-group
.col-sm-10.col-sm-offset-2
.checkbox
= label_tag 'merge_request[force_remove_source_branch]' do
2016-11-08 14:06:19 +00:00
= hidden_field_tag 'merge_request[force_remove_source_branch]', '0', id: nil
2016-02-12 20:41:31 +00:00
= check_box_tag 'merge_request[force_remove_source_branch]', '1', @merge_request.force_remove_source_branch?
Remove source branch when merge request is accepted.
2015-05-29 01:00:37 +00:00
2015-12-02 13:48:06 +00:00
- is_footer = !(issuable.is_a?(MergeRequest) && issuable.new_record?)
2016-04-25 20:02:15 +00:00
.row-content-block{class: (is_footer ? "footer-block" : "middle-block")}
2014-09-20 14:06:35 +00:00
- if issuable.new_record?
2016-11-14 12:19:46 +00:00
= form.submit "Submit #{issuable.class.model_name.human.downcase}", class: 'btn btn-create'
2014-09-20 14:06:35 +00:00
- else
2016-11-14 12:19:46 +00:00
= form.submit 'Save changes', class: 'btn btn-save'
2015-12-02 13:21:03 +00: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 14:06:35 +00:00
- if issuable.new_record?
2016-03-28 06:35:53 +00:00
= link_to 'Cancel', polymorphic_path([@project.namespace.becomes(Namespace), @project, issuable.class]), class: 'btn btn-cancel'
2014-09-20 14:06:35 +00:00
- else
2016-03-21 13:12:52 +00:00
.pull-right
2016-07-26 11:57:43 +00:00
- if can?(current_user, :"destroy_#{issuable.to_ability_name}", @project)
2016-11-19 02:19:04 +00:00
= link_to 'Delete', polymorphic_path([@project.namespace.becomes(Namespace), @project, issuable]), data: { confirm: "#{issuable.human_class_name} will be removed! Are you sure?" },
2016-04-11 22:20:38 +00:00
method: :delete, class: 'btn btn-danger btn-grouped'
2016-03-24 19:29:09 +00:00
= link_to 'Cancel', polymorphic_path([@project.namespace.becomes(Namespace), @project, issuable]), class: 'btn btn-grouped btn-cancel'
2016-08-01 15:34:17 +00:00
2016-11-14 12:19:46 +00:00
= form.hidden_field :lock_version