Commit fb6c88ab authored by Annabel Dunstone Gray's avatar Annabel Dunstone Gray

Migrate contribution checkbox to Pajamas component

parent d1799487
= form_for [@project, @merge_request],
= gitlab_ui_form_for [@project, @merge_request],
html: { class: 'merge-request-form common-note-form js-requires-input js-quick-submit' } do |f|
= render 'shared/issuable/form', f: f, issuable: @merge_request, presenter: @mr_presenter
%h3.page-title
= _('New merge request')
= form_for [@project, @merge_request], html: { class: 'merge-request-form common-note-form js-requires-input js-quick-submit' } do |f|
= gitlab_ui_form_for [@project, @merge_request], html: { class: 'merge-request-form common-note-form js-requires-input js-quick-submit' } do |f|
= render 'shared/issuable/form', f: f, issuable: @merge_request, commits: @commits, presenter: @mr_presenter
= f.hidden_field :source_project_id
= f.hidden_field :source_branch
......
- issuable = local_assigns.fetch(:issuable)
- form = local_assigns.fetch(:form)
- contribution_help_link = help_page_path('user/project/merge_requests/allow_collaboration')
- contribution_help_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: contribution_help_link }
- return unless issuable.is_a?(MergeRequest)
- return unless issuable.for_fork?
......@@ -11,10 +13,7 @@
%label.col-form-label.col-sm-2
= _('Contribution')
.col-sm-10
.form-check.gl-mt-2
= form.check_box :allow_collaboration, disabled: !issuable.can_allow_collaboration?(current_user), class: 'form-check-input'
= form.label :allow_collaboration, class: 'form-check-label' do
= _('Allow commits from members who can merge to the target branch.')
= link_to 'About this feature', help_page_path('user/project/merge_requests/allow_collaboration'), target: '_blank', rel: 'noopener noreferrer nofollow'
.form-text.text-muted
= allow_collaboration_unavailable_reason(issuable)
= form.gitlab_ui_checkbox_component :allow_collaboration,
_('Allow commits from members who can merge to the target branch. %{link_start}About this feature.%{link_end}').html_safe % { link_start: contribution_help_link_start, link_end: '</a>'.html_safe },
checkbox_options: { disabled: !issuable.can_allow_collaboration?(current_user) },
help_text: allow_collaboration_unavailable_reason(issuable)
......@@ -17,9 +17,8 @@
- if issuable.respond_to?(:confidential) && can?(current_user, :set_confidentiality, issuable)
.form-group.row
.offset-sm-2.col-sm-10
.form-check
= form.gitlab_ui_checkbox_component :confidential,
s_('This issue is confidential and should only be visible to team members with at least Reporter access.')
= form.gitlab_ui_checkbox_component :confidential,
_('This issue is confidential and should only be visible to team members with at least Reporter access.')
- if can?(current_user, :"set_#{issuable.to_ability_name}_metadata", issuable)
%hr
......
......@@ -3651,7 +3651,7 @@ msgstr ""
msgid "Allow access to the following IP addresses"
msgstr ""
msgid "Allow commits from members who can merge to the target branch."
msgid "Allow commits from members who can merge to the target branch. %{link_start}About this feature.%{link_end}"
msgstr ""
msgid "Allow group owners to manage LDAP-related settings"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment