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

103 lines
4.6 KiB
Text
Raw Normal View History

2015-09-11 14:41:01 +05:30
- if issuable.errors.any?
.row
.col-sm-offset-2.col-sm-10
.alert.alert-danger
- issuable.errors.full_messages.each do |msg|
%span= msg
%br
.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',
2015-10-24 18:46:33 +05:30
class: 'form-control pad js-gfm-input js-quick-submit', required: true
2015-09-11 14:41:01 +05:30
- if issuable.is_a?(MergeRequest)
%p.help-block
- if issuable.work_in_progress?
Remove the <code>WIP</code> prefix from the title to allow this
<strong>Work In Progress</strong> merge request to be merged when it's ready.
- else
Start the title with <code>[WIP]</code> or <code>WIP:</code> to prevent a
<strong>Work In Progress</strong> 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,
2015-10-24 18:46:33 +05:30
classes: 'description form-control js-quick-submit'
2015-11-26 14:37:03 +05:30
= render 'projects/notes/hints'
2015-09-11 14:41:01 +05:30
.clearfix
.error-alert
- 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
= users_select_tag("#{issuable.class.model_name.param_key}[assignee_id]",
2015-12-23 02:04:40 +05:30
placeholder: 'Select assignee', class: 'custom-form-control', null_user: true,
2015-09-11 14:41:01 +05:30
selected: issuable.assignee_id, project: @target_project || @project,
2015-12-23 02:04:40 +05:30
first_user: true, current_user: true, include_blank: true)
2015-09-11 14:41:01 +05:30
&nbsp;
= 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?
= f.select(:milestone_id, milestone_options(issuable),
2015-12-23 02:04:40 +05:30
{ 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.
&nbsp;
- 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
2015-12-23 02:04:40 +05:30
= f.label :label_ids, "Labels", class: 'control-label'
2015-09-11 14:41:01 +05:30
.col-sm-10
- if issuable.project.labels.any?
= f.collection_select :label_ids, issuable.project.labels.all, :id, :name,
2015-12-23 02:04:40 +05:30
{ selected: issuable.label_ids }, multiple: true, class: 'select2', data: { placeholder: "Select labels" }
2015-09-11 14:41:01 +05:30
- else
.prepend-top-10
%span.light No labels yet.
&nbsp;
- 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
- if issuable.is_a?(MergeRequest)
%hr
- if @merge_request.new_record?
.form-group
2015-12-23 02:04:40 +05:30
= f.label :source_branch, class: 'control-label'
2015-09-11 14:41:01 +05:30
.col-sm-10
= 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
2015-12-23 02:04:40 +05:30
= 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?
%p.help-block
= link_to 'Change branches', mr_change_branches_path(@merge_request)
2015-12-23 02:04:40 +05:30
- is_footer = !(issuable.is_a?(MergeRequest) && issuable.new_record?)
.gray-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?
- cancel_project = issuable.source_project
- else
- cancel_project = issuable.project
= link_to 'Cancel', [cancel_project.namespace.becomes(Namespace), cancel_project, issuable], class: 'btn btn-cancel'