BigW Consortium Gitlab

_form.html.haml 4.33 KB
Newer Older
1
- form = local_assigns.fetch(:f)
2
- commits = local_assigns[:commits]
3
- project = @target_project || @project
4

5 6
= form_errors(issuable)

7 8 9 10
- if @conflict
  .alert.alert-danger
    Someone edited the #{issuable.class.model_name.human.downcase} the same time you did.
    Please check out
11
    = link_to "the #{issuable.class.model_name.human.downcase}", polymorphic_path([@project.namespace.becomes(Namespace), @project, issuable]), target: "_blank", rel: 'noopener noreferrer'
12 13
    and make sure your changes will not unintentionally remove theirs

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

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

20
= render 'shared/issuable/form/description', issuable: issuable, form: form
21

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

30
= render 'shared/issuable/form/metadata', issuable: issuable, form: form
Dmitriy Zaporozhets committed
31

32
- if issuable.can_move?(current_user)
33
  %hr
34 35 36
  .form-group
    = label_tag :move_to_project_id, 'Move', class: 'control-label'
    .col-sm-10
37
      .issuable-form-select-holder
38
        = 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 }
39
       
40
      %span{ data: { toggle: 'tooltip', placement: 'auto top' }, style: 'cursor: default',
41
      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.' }
42
        = icon('question-circle')
43

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

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

Bob Van Landuyt committed
48
- if @merge_request_to_resolve_discussions_of
49 50
  .form-group
    .col-sm-10.col-sm-offset-2
51
      = icon('info-circle')
Bob Van Landuyt committed
52 53
      - 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
54 55
        - if @discussion_to_resolve
          = hidden_field_tag 'discussion_to_resolve', @discussion_to_resolve.id
56
          Creating this issue will resolve the discussion in
57
        - else
58
          Creating this issue will resolve all discussions in
Bob Van Landuyt committed
59
        = link_to_discussions_to_resolve(@merge_request_to_resolve_discussions_of, @discussion_to_resolve)
60
      - else
61 62 63
        The
        = @discussion_to_resolve ? 'discussion' : 'discussions'
        at
Bob Van Landuyt committed
64
        = link_to_discussions_to_resolve(@merge_request_to_resolve_discussions_of, @discussion_to_resolve)
65 66
        will stay unresolved. Ask someone with permission to resolve
        = @discussion_to_resolve ? 'it.' : 'them.'
67

68
- is_footer = !(issuable.is_a?(MergeRequest) && issuable.new_record?)
69
.row-content-block{ class: (is_footer ? "footer-block" : "middle-block") }
70 71 72 73 74 75 76 77 78 79 80 81 82
  .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'
    - else
      = form.submit 'Save changes', class: 'btn btn-save'
83 84

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

90

91
= form.hidden_field :lock_version