2017-08-17 22:00:37 +05:30
- form = local_assigns.fetch(:f)
- commits = local_assigns[:commits]
2016-11-03 12:29:30 +05:30
- project = @target_project || @project
2018-11-08 19:23:39 +05:30
- presenter = local_assigns.fetch(:presenter, nil)
2017-08-17 22:00:37 +05:30
2022-10-11 01:57:18 +05:30
= form_errors(issuable)
2016-06-02 11:05:42 +05:30
2016-09-29 09:46:39 +05:30
- if @conflict
2022-06-21 17:19:12 +05:30
= render Pajamas::AlertComponent.new(variant: :danger,
2021-09-30 23:02:18 +05:30
dismissible: false,
2022-07-23 23:45:48 +05:30
alert_options: { class: 'gl-mb-5' }) do |c|
2022-07-16 23:28:13 +05:30
= c.body do
2021-09-30 23:02:18 +05:30
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, issuable]), target: "_blank", rel: 'noopener noreferrer'
and make sure your changes will not unintentionally remove theirs
2016-09-29 09:46:39 +05:30
2019-12-26 22:10:19 +05:30
= render 'shared/issuable/form/branch_chooser', issuable: issuable, form: form
2022-07-23 23:45:48 +05:30
.form-group
= form.label :title do
= _('Title (required)')
2017-08-17 22:00:37 +05:30
2022-07-23 23:45:48 +05:30
= render 'shared/issuable/form/title', issuable: issuable, form: form, has_wip_commits: commits && commits.detect(&:draft?)
2019-09-30 21:07:59 +05:30
#js-suggestions{ data: { project_path: @project.full_path } }
2017-08-17 22:00:37 +05:30
2020-11-24 15:15:51 +05:30
= render 'shared/issuable/form/type_selector', issuable: issuable, form: form
2017-09-10 17:25:29 +05:30
= render 'shared/form_elements/description', model: issuable, form: form, project: project
2017-08-17 22:00:37 +05:30
2021-02-22 17:27:13 +05:30
= render 'shared/issuable/form/metadata', issuable: issuable, form: form, project: project, presenter: presenter
2015-09-11 14:41:01 +05:30
2020-07-28 23:09:34 +05:30
= render 'shared/issuable/form/merge_params', issuable: issuable, project: project
2017-08-17 22:00:37 +05:30
2018-03-27 19:54:05 +05:30
= render 'shared/issuable/form/contribution', issuable: issuable, form: form
2017-08-17 22:00:37 +05:30
- if @merge_request_to_resolve_discussions_of
2022-07-23 23:45:48 +05:30
.form-group
= sprite_icon('information-o')
- 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 thread in
2017-08-17 22:00:37 +05:30
- else
2022-07-23 23:45:48 +05:30
Creating this issue will resolve all threads in
= link_to_discussions_to_resolve(@merge_request_to_resolve_discussions_of, @discussion_to_resolve)
- else
The
= @discussion_to_resolve ? 'thread' : 'threads'
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.'
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?)
2022-07-23 23:45:48 +05:30
.gl-mt-5{ class: (is_footer ? "footer-block" : "middle-block") }
2018-03-27 19:54:05 +05:30
- if !issuable.persisted? && !issuable.project.empty_repo? && (guide_url = issuable.project.present.contribution_guide_path)
2021-04-29 21:17:54 +05:30
.gl-mb-5
2022-08-27 11:52:29 +05:30
- contribution_guidelines_start = '<strong><a href="%{url}">'.html_safe % {url: strip_tags(guide_url)}
- contribution_guidelines_end = '</a></strong>'.html_safe
= sanitize(html_escape(_('Please review the %{linkStart}contribution guidelines%{linkEnd} for this project.')) % { linkStart: contribution_guidelines_start, linkEnd: contribution_guidelines_end })
2015-12-23 02:04:40 +05:30
2021-04-29 21:17:54 +05:30
- if issuable.new_record?
2022-11-25 23:54:43 +05:30
= form.submit "#{_('Create')} #{issuable.class.model_name.human.downcase}", class: 'gl-button btn btn-confirm gl-mr-2', data: { qa_selector: 'issuable_create_button', track_action: 'click_button', track_label: 'submit_mr', track_value: 0 }
2021-04-29 21:17:54 +05:30
- else
2022-11-25 23:54:43 +05:30
= form.submit _('Save changes'), class: 'gl-button btn btn-confirm gl-mr-2', data: { track_action: 'click_button', track_label: 'submit_mr', track_value: 0 }
2021-04-29 21:17:54 +05:30
- if issuable.new_record?
2022-08-13 15:12:31 +05:30
= link_to _('Cancel'), polymorphic_path([@project, issuable.class]), class: 'btn gl-button btn-default js-reset-autosave'
2021-04-29 21:17:54 +05:30
- else
2022-08-13 15:12:31 +05:30
= link_to _('Cancel'), polymorphic_path([@project, issuable]), class: 'gl-button btn btn-default js-reset-autosave'
2021-04-29 21:17:54 +05:30
- if can?(current_user, :"destroy_#{issuable.to_ability_name}", @project)
2023-01-13 00:05:48 +05:30
- confirm_title = _('Delete %{issuableType}?') % { issuableType: issuable.human_class_name }
- confirm_body = _('You’ re about to permanently delete the %{issuableType} ‘ %{strongOpen}%{issuableTitle}%{strongClose}’ . To avoid data loss, consider %{strongOpen}closing this %{issuableType}%{strongClose} instead. Once deleted, it cannot be undone or recovered.') % { issuableType: issuable.human_class_name, issuableTitle: issuable.title, strongOpen: '<strong>', strongClose: '</strong>' }
- confirm_primary_btn_text = _('Delete %{issuableType}') % { issuableType: issuable.human_class_name }
= link_to _('Delete'), polymorphic_path([@project, issuable], params: { destroy_confirm: true }), data: { title: confirm_title, confirm: confirm_body, is_html_message: true, confirm_btn_variant: 'danger'}, method: :delete, class: 'btn gl-button btn-danger btn-danger-secondary gl-float-right js-reset-autosave', "aria-label": confirm_primary_btn_text
2021-04-29 21:17:54 +05:30
2020-10-24 23:57:45 +05:30
- if issuable.respond_to?(:issue_type)
= form.hidden_field :issue_type
2017-08-17 22:00:37 +05:30
= form.hidden_field :lock_version
2021-02-22 17:27:13 +05:30
- if @vulnerability_id
= hidden_field_tag 'vulnerability_id', @vulnerability_id