2018-02-27 19:10:43 -05:00
|
|
|
- @gfm_form = true
|
2020-09-02 05:10:23 -04:00
|
|
|
- @content_class = "merge-request-container#{' limit-container-width' unless fluid_layout}"
|
2021-03-30 11:11:08 -04:00
|
|
|
- add_to_breadcrumbs _("Merge requests"), project_merge_requests_path(@project)
|
2017-08-17 05:42:04 -04:00
|
|
|
- breadcrumb_title @merge_request.to_reference
|
2021-03-30 11:11:08 -04:00
|
|
|
- page_title "#{@merge_request.title} (#{@merge_request.to_reference})", _("Merge requests")
|
2020-10-01 02:09:59 -04:00
|
|
|
- page_description @merge_request.description_html
|
2018-04-16 11:09:19 -04:00
|
|
|
- page_card_attributes @merge_request.card_attributes
|
2021-05-04 17:10:01 -04:00
|
|
|
- suggest_changes_help_path = help_page_path('user/project/merge_requests/reviews/suggestions.md')
|
2019-08-28 17:09:22 -04:00
|
|
|
- number_of_pipelines = @pipelines.size
|
2020-07-16 14:09:35 -04:00
|
|
|
- mr_action = j(params[:tab].presence || 'show')
|
2020-10-13 05:08:27 -04:00
|
|
|
- add_page_specific_style 'page_bundles/merge_requests'
|
2020-10-07 08:09:12 -04:00
|
|
|
- add_page_specific_style 'page_bundles/pipelines'
|
2020-10-08 23:08:25 -04:00
|
|
|
- add_page_specific_style 'page_bundles/reports'
|
2020-10-23 05:08:41 -04:00
|
|
|
- add_page_specific_style 'page_bundles/ci_status'
|
2018-02-27 19:10:43 -05:00
|
|
|
|
2021-03-17 14:09:01 -04:00
|
|
|
- add_page_startup_api_call @endpoint_metadata_url
|
|
|
|
|
2020-07-16 14:09:35 -04:00
|
|
|
.merge-request{ data: { mr_action: mr_action, url: merge_request_path(@merge_request, format: :json), project_path: project_path(@merge_request.project), lock_version: @merge_request.lock_version } }
|
2017-06-13 18:12:31 -04:00
|
|
|
= render "projects/merge_requests/mr_title"
|
|
|
|
|
|
|
|
.merge-request-details.issuable-details{ data: { id: @merge_request.project.id } }
|
|
|
|
= render "projects/merge_requests/mr_box"
|
|
|
|
.merge-request-tabs-holder{ class: ("js-tabs-affix" unless ENV['RAILS_ENV'] == 'test') }
|
|
|
|
.merge-request-tabs-container
|
2019-06-06 10:44:13 -04:00
|
|
|
%ul.merge-request-tabs.nav-tabs.nav.nav-links
|
2019-12-02 22:06:35 -05:00
|
|
|
= render "projects/merge_requests/tabs/tab", class: "notes-tab", qa_selector: "notes_tab" do
|
2019-06-06 10:44:13 -04:00
|
|
|
= tab_link_for @merge_request, :show, force_link: @commit.present? do
|
2020-08-20 05:09:55 -04:00
|
|
|
= _("Overview")
|
2021-04-19 14:09:09 -04:00
|
|
|
%span.badge.badge-pill.gl-badge.badge-muted.sm= @merge_request.related_notes.user.count
|
2019-06-06 10:44:13 -04:00
|
|
|
- if @merge_request.source_project
|
2021-04-05 23:09:02 -04:00
|
|
|
= render "projects/merge_requests/tabs/tab", name: "commits", class: "commits-tab", qa_selector: "commits_tab" do
|
2019-06-06 10:44:13 -04:00
|
|
|
= tab_link_for @merge_request, :commits do
|
|
|
|
= _("Commits")
|
2021-04-19 14:09:09 -04:00
|
|
|
%span.badge.badge-pill.gl-badge.badge-muted.sm= @commits_count
|
2019-08-28 17:09:22 -04:00
|
|
|
- if number_of_pipelines.nonzero?
|
2019-12-02 22:06:35 -05:00
|
|
|
= render "projects/merge_requests/tabs/tab", name: "pipelines", class: "pipelines-tab" do
|
2019-06-06 10:44:13 -04:00
|
|
|
= tab_link_for @merge_request, :pipelines do
|
|
|
|
= _("Pipelines")
|
2021-04-19 14:09:09 -04:00
|
|
|
%span.badge.badge-pill.gl-badge.badge-muted.sm.js-pipelines-mr-count= number_of_pipelines
|
2021-03-15 17:09:16 -04:00
|
|
|
= render "projects/merge_requests/tabs/tab", name: "diffs", class: "diffs-tab", id: "diffs-tab", qa_selector: "diffs_tab" do
|
2019-06-06 10:44:13 -04:00
|
|
|
= tab_link_for @merge_request, :diffs do
|
|
|
|
= _("Changes")
|
2021-04-29 11:10:07 -04:00
|
|
|
%span.badge.badge-pill.gl-badge.badge-muted.sm= @diffs_count
|
2019-06-06 10:44:13 -04:00
|
|
|
.d-flex.flex-wrap.align-items-center.justify-content-lg-end
|
2018-10-23 05:49:45 -04:00
|
|
|
#js-vue-discussion-counter
|
2017-06-13 18:12:31 -04:00
|
|
|
|
|
|
|
.tab-content#diff-notes-app
|
2019-01-16 10:17:10 -05:00
|
|
|
#js-diff-file-finder
|
2020-04-09 02:09:30 -04:00
|
|
|
#js-code-navigation
|
2019-12-02 22:06:35 -05:00
|
|
|
= render "projects/merge_requests/tabs/pane", id: "notes", class: "notes voting_notes" do
|
2017-06-13 18:12:31 -04:00
|
|
|
.row
|
|
|
|
%section.col-md-12
|
2018-02-27 19:10:43 -05:00
|
|
|
%script.js-notes-data{ type: "application/json" }= initial_notes_data(true).to_json.html_safe
|
|
|
|
.issuable-discussion.js-vue-notes-event
|
2020-08-20 05:09:55 -04:00
|
|
|
- if @merge_request.description.present?
|
|
|
|
.detail-page-description
|
|
|
|
= render "projects/merge_requests/description"
|
|
|
|
= render "projects/merge_requests/widget"
|
|
|
|
= render "projects/merge_requests/awards_block"
|
2020-11-23 04:09:13 -05:00
|
|
|
- if mr_action === "show"
|
2021-02-04 07:09:25 -05:00
|
|
|
- if Feature.enabled?(:paginated_notes, @project)
|
|
|
|
- add_page_startup_api_call notes_url
|
|
|
|
- else
|
|
|
|
- add_page_startup_api_call discussions_path(@merge_request)
|
2021-06-16 08:10:18 -04:00
|
|
|
- add_page_startup_api_call widget_project_json_merge_request_path(@project, @merge_request, format: :json)
|
2021-01-14 16:10:37 -05:00
|
|
|
- add_page_startup_api_call cached_widget_project_json_merge_request_path(@project, @merge_request, format: :json)
|
2021-02-04 07:09:25 -05:00
|
|
|
#js-vue-mr-discussions{ data: { notes_data: notes_data(@merge_request, Feature.enabled?(:paginated_notes, @project)).to_json,
|
2021-03-17 14:09:01 -04:00
|
|
|
endpoint_metadata: @endpoint_metadata_url,
|
2019-08-28 17:09:22 -04:00
|
|
|
noteable_data: serialize_issuable(@merge_request, serializer: 'noteable'),
|
2018-06-21 08:22:40 -04:00
|
|
|
noteable_type: 'MergeRequest',
|
|
|
|
target_type: 'merge_request',
|
2018-12-17 16:58:00 -05:00
|
|
|
help_page_path: suggest_changes_help_path,
|
2020-07-24 05:09:41 -04:00
|
|
|
current_user_data: @current_user_data,
|
|
|
|
is_locked: @merge_request.discussion_locked.to_s } }
|
2017-06-13 18:12:31 -04:00
|
|
|
|
2019-12-02 22:06:35 -05:00
|
|
|
= render "projects/merge_requests/tabs/pane", name: "commits", id: "commits", class: "commits" do
|
2017-06-13 18:12:31 -04:00
|
|
|
-# This tab is always loaded via AJAX
|
2019-12-02 22:06:35 -05:00
|
|
|
= render "projects/merge_requests/tabs/pane", name: "pipelines", id: "pipelines", class: "pipelines" do
|
2019-08-28 17:09:22 -04:00
|
|
|
- if number_of_pipelines.nonzero?
|
2017-06-29 13:06:35 -04:00
|
|
|
= render 'projects/commit/pipelines_list', disable_initialization: true, endpoint: pipelines_project_merge_request_path(@project, @merge_request)
|
2020-09-16 02:09:24 -04:00
|
|
|
- params = request.query_parameters
|
2021-02-16 13:09:24 -05:00
|
|
|
- if Feature.enabled?(:default_merge_ref_for_diffs, @project, default_enabled: :yaml)
|
2020-09-16 02:09:24 -04:00
|
|
|
- params = params.merge(diff_head: true)
|
2021-04-02 20:09:02 -04:00
|
|
|
= render "projects/merge_requests/tabs/pane", name: "diffs", id: "js-diffs-app", class: "diffs", data: diffs_tab_pane_data(@project, @merge_request, params)
|
2017-06-13 18:12:31 -04:00
|
|
|
|
|
|
|
.mr-loading-status
|
2020-02-13 07:08:49 -05:00
|
|
|
.loading.hide
|
2021-04-29 17:10:03 -04:00
|
|
|
.gl-spinner.gl-spinner-md
|
2017-06-13 18:12:31 -04:00
|
|
|
|
2020-09-29 05:09:49 -04:00
|
|
|
= render 'shared/issuable/sidebar', issuable_sidebar: @issuable_sidebar, assignees: @merge_request.assignees, reviewers: @merge_request.reviewers, source_branch: @merge_request.source_branch
|
2018-11-27 11:53:16 -05:00
|
|
|
|
2017-06-13 18:12:31 -04:00
|
|
|
- if @merge_request.can_be_reverted?(current_user)
|
2021-02-05 16:09:19 -05:00
|
|
|
= render "projects/commit/change", type: 'revert', commit: @merge_request.merge_commit
|
2017-06-13 18:12:31 -04:00
|
|
|
- if @merge_request.can_be_cherry_picked?
|
2021-02-05 16:09:19 -05:00
|
|
|
= render "projects/commit/change", type: 'cherry-pick', commit: @merge_request.merge_commit
|
2020-06-01 02:08:21 -04:00
|
|
|
|
|
|
|
#js-review-bar
|
2021-03-16 11:11:17 -04:00
|
|
|
|
|
|
|
= render 'shared/issuable/invite_members_trigger', project: @project
|
|
|
|
|