debian-mirror-gitlab/app/views/shared/issuable/_form.html.haml

146 lines
6.7 KiB
Text
Raw Normal View History

2016-06-02 11:05:42 +05:30
= form_errors(issuable)
2015-09-11 14:41:01 +05:30
.form-group
2015-12-23 02:04:40 +05:30
= f.label :title, class: 'control-label'
2015-09-11 14:41:01 +05:30
.col-sm-10
2015-09-25 12:07:36 +05:30
= f.text_field :title, maxlength: 255, autofocus: true, autocomplete: 'off',
2016-06-02 11:05:42 +05:30
class: 'form-control pad', required: true
2015-09-11 14:41:01 +05:30
- if issuable.is_a?(MergeRequest)
%p.help-block
2016-06-02 11:05:42 +05:30
.js-wip-explanation
%a.js-toggle-wip{href: "", tabindex: -1}
Remove the
%code WIP:
prefix from the title
to allow this
%strong Work In Progress
merge request to be merged when it's ready.
.js-no-wip-explanation
%a.js-toggle-wip{href: "", tabindex: -1}
Start the title with
%code WIP:
to prevent a
%strong Work In Progress
merge request from being merged before it's ready.
2015-12-23 02:04:40 +05:30
.form-group.detail-page-description
2015-09-11 14:41:01 +05:30
= f.label :description, 'Description', class: 'control-label'
.col-sm-10
2015-09-25 12:07:36 +05:30
= render layout: 'projects/md_preview', locals: { preview_class: "md-preview", referenced_users: true } do
2015-09-11 14:41:01 +05:30
= render 'projects/zen', f: f, attr: :description,
2016-06-02 11:05:42 +05:30
classes: 'note-textarea',
placeholder: "Write a comment or drag your files here..."
2015-11-26 14:37:03 +05:30
= render 'projects/notes/hints'
2015-09-11 14:41:01 +05:30
.clearfix
.error-alert
2016-06-02 11:05:42 +05:30
- 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-09-11 14:41:01 +05:30
- if can?(current_user, :"admin_#{issuable.to_ability_name}", issuable.project)
2015-12-23 02:04:40 +05:30
%hr
2015-09-11 14:41:01 +05:30
.form-group
.issue-assignee
2015-12-23 02:04:40 +05:30
= f.label :assignee_id, "Assignee", class: 'control-label'
2015-09-11 14:41:01 +05:30
.col-sm-10
2016-06-02 11:05:42 +05:30
.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-09-11 14:41:01 +05:30
 
= link_to 'Assign to me', '#', class: 'btn assign-to-me-link'
.form-group
.issue-milestone
2015-12-23 02:04:40 +05:30
= f.label :milestone_id, "Milestone", class: 'control-label'
2015-09-11 14:41:01 +05:30
.col-sm-10
- if milestone_options(issuable).present?
2016-06-02 11:05:42 +05:30
.issuable-form-select-holder
= f.select(:milestone_id, milestone_options(issuable),
{ include_blank: true }, { class: 'select2', data: { placeholder: 'Select milestone' } })
2015-09-11 14:41:01 +05:30
- 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-06-02 11:05:42 +05:30
- has_labels = issuable.project.labels.any?
2015-12-23 02:04:40 +05:30
= f.label :label_ids, "Labels", class: 'control-label'
2016-06-02 11:05:42 +05:30
.col-sm-10{ class: ('issuable-form-padding-top' if !has_labels) }
- if has_labels
.issuable-form-select-holder
= f.collection_select :label_ids, issuable.project.labels.all, :id, :name,
{ selected: issuable.label_ids }, multiple: true, class: 'select2', data: { placeholder: "Select labels" }
2015-09-11 14:41:01 +05:30
- else
%span.light No labels yet.
 
- 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
2016-06-02 11:05:42 +05:30
- if issuable.can_move?(current_user)
%hr
.form-group
= label_tag :move_to_project_id, 'Move', class: 'control-label'
.col-sm-10
.issuable-form-select-holder
- 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' })
 
%span{ data: { toggle: 'tooltip', placement: 'auto top' }, style: 'cursor: default',
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.' }
= icon('question-circle')
2015-09-11 14:41:01 +05:30
- if issuable.is_a?(MergeRequest)
%hr
2016-06-02 11:05:42 +05:30
- if @merge_request.new_record?
.form-group
= f.label :source_branch, class: 'control-label'
.col-sm-10
.issuable-form-select-holder
2015-09-11 14:41:01 +05:30
= f.select(:source_branch, [@merge_request.source_branch], { }, { class: 'source_branch select2 span2', disabled: true })
.form-group
2015-12-23 02:04:40 +05:30
= f.label :target_branch, class: 'control-label'
2015-09-11 14:41:01 +05:30
.col-sm-10
2016-06-02 11:05:42 +05:30
.issuable-form-select-holder
= 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-09-11 14:41:01 +05:30
- if @merge_request.new_record?
2016-06-02 11:05:42 +05:30
 
2015-09-11 14:41:01 +05:30
= link_to 'Change branches', mr_change_branches_path(@merge_request)
2016-06-02 11:05:42 +05:30
- 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
= 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-09-11 14:41:01 +05:30
2015-12-23 02:04:40 +05:30
- is_footer = !(issuable.is_a?(MergeRequest) && issuable.new_record?)
2016-06-02 11:05:42 +05:30
.row-content-block{class: (is_footer ? "footer-block" : "middle-block")}
2015-09-11 14:41:01 +05:30
- if issuable.new_record?
2015-12-23 02:04:40 +05:30
= f.submit "Submit #{issuable.class.model_name.human.downcase}", class: 'btn btn-create'
2015-09-11 14:41:01 +05:30
- else
= f.submit 'Save changes', class: 'btn btn-save'
2015-12-23 02:04:40 +05:30
- 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.
2015-09-11 14:41:01 +05:30
- if issuable.new_record?
2016-06-02 11:05:42 +05:30
= link_to 'Cancel', polymorphic_path([@project.namespace.becomes(Namespace), @project, issuable.class]), class: 'btn btn-cancel'
2015-09-11 14:41:01 +05:30
- else
2016-06-02 11:05:42 +05:30
.pull-right
- if current_user.can?(:"destroy_#{issuable.to_ability_name}", @project)
= 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'
= link_to 'Cancel', polymorphic_path([@project.namespace.becomes(Namespace), @project, issuable]), class: 'btn btn-grouped btn-cancel'