summaryrefslogtreecommitdiff
path: root/app/views/shared/issuable/_form.html.haml
blob: 4c8f03f149835aef1094e42cf966605eb99438b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
- form = local_assigns.fetch(:f)
- commits = local_assigns[:commits]
- project = @target_project || @project

= form_errors(issuable)

- 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", rel: 'noopener noreferrer'
    and make sure your changes will not unintentionally remove theirs

.form-group
  = form.label :title, class: 'control-label'

  = render 'shared/issuable/form/template_selector', issuable: issuable
  = render 'shared/issuable/form/title', issuable: issuable, form: form, has_wip_commits: commits && commits.detect(&:work_in_progress?)

= render 'shared/form_elements/description', model: issuable, form: form, project: project

- if issuable.respond_to?(:confidential)
  .form-group
    .col-sm-offset-2.col-sm-10
      .checkbox
        = form.label :confidential do
          = form.check_box :confidential
          This issue is confidential and should only be visible to team members with at least Reporter access.

= render 'shared/issuable/form/metadata', issuable: issuable, form: form

= render 'shared/issuable/form/branch_chooser', issuable: issuable, form: form

= render 'shared/issuable/form/merge_params', issuable: issuable

= render 'shared/issuable/form/contribution', issuable: issuable, form: form

- if @merge_request_to_resolve_discussions_of
  .form-group
    .col-sm-10.col-sm-offset-2
      = icon('info-circle')
      - if @merge_request_to_resolve_discussions_of.discussions_can_be_resolved_by?(current_user)
        = hidden_field_tag 'merge_request_to_resolve_discussions_of', @merge_request_to_resolve_discussions_of.iid
        - if @discussion_to_resolve
          = hidden_field_tag 'discussion_to_resolve', @discussion_to_resolve.id
          Creating this issue will resolve the discussion in
        - else
          Creating this issue will resolve all discussions in
        = link_to_discussions_to_resolve(@merge_request_to_resolve_discussions_of, @discussion_to_resolve)
      - else
        The
        = @discussion_to_resolve ? 'discussion' : 'discussions'
        at
        = link_to_discussions_to_resolve(@merge_request_to_resolve_discussions_of, @discussion_to_resolve)
        will stay unresolved. Ask someone with permission to resolve
        = @discussion_to_resolve ? 'it.' : 'them.'

- is_footer = !(issuable.is_a?(MergeRequest) && issuable.new_record?)
.row-content-block{ class: (is_footer ? "footer-block" : "middle-block") }
  .pull-right
    - if issuable.new_record?
      = link_to 'Cancel', polymorphic_path([@project.namespace.becomes(Namespace), @project, issuable.class]), class: 'btn btn-cancel'
    - else
      - if can?(current_user, :"destroy_#{issuable.to_ability_name}", @project)
        = link_to 'Delete', polymorphic_path([@project.namespace.becomes(Namespace), @project, issuable]), data: { confirm: "#{issuable.human_class_name} 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'

  %span.append-right-10
    - if issuable.new_record?
      = form.submit "Submit #{issuable.class.model_name.human.downcase}", class: 'btn btn-create qa-issuable-create-button'
    - else
      = form.submit 'Save changes', class: 'btn btn-save'

  - if !issuable.persisted? && !issuable.project.empty_repo? && (guide_url = issuable.project.present.contribution_guide_path)
    .inline.prepend-top-10
      Please review the
      %strong= link_to('contribution guidelines', guide_url)
      for this project.


= form.hidden_field :lock_version