debian-mirror-gitlab/app/views/projects/merge_requests/show.html.haml

111 lines
6.6 KiB
Text
Raw Normal View History

2018-03-27 19:54:05 +05:30
- @gfm_form = true
2020-11-24 15:15:51 +05:30
- @content_class = "merge-request-container#{' limit-container-width' unless fluid_layout}"
2020-07-28 23:09:34 +05:30
- add_to_breadcrumbs _("Merge Requests"), project_merge_requests_path(@project)
2018-03-17 18:26:18 +05:30
- breadcrumb_title @merge_request.to_reference
2020-07-28 23:09:34 +05:30
- page_title "#{@merge_request.title} (#{@merge_request.to_reference})", _("Merge Requests")
2021-01-03 14:25:43 +05:30
- page_description @merge_request.description_html
2017-09-10 17:25:29 +05:30
- page_card_attributes @merge_request.card_attributes
2019-02-15 15:39:39 +05:30
- suggest_changes_help_path = help_page_path('user/discussions/index.md', anchor: 'suggest-changes')
2019-12-04 20:38:33 +05:30
- number_of_pipelines = @pipelines.size
2020-07-28 23:09:34 +05:30
- mr_action = j(params[:tab].presence || 'show')
2021-01-03 14:25:43 +05:30
- add_page_specific_style 'page_bundles/merge_requests'
- add_page_specific_style 'page_bundles/pipelines'
- add_page_specific_style 'page_bundles/reports'
2021-01-29 00:20:46 +05:30
- add_page_specific_style 'page_bundles/ci_status'
2017-09-10 17:25:29 +05:30
2020-07-28 23:09:34 +05:30
.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-09-10 17:25:29 +05:30
= 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-09-04 21:01:54 +05:30
%ul.merge-request-tabs.nav-tabs.nav.nav-links
2020-01-01 13:55:28 +05:30
= render "projects/merge_requests/tabs/tab", class: "notes-tab", qa_selector: "notes_tab" do
2019-09-04 21:01:54 +05:30
= tab_link_for @merge_request, :show, force_link: @commit.present? do
2020-10-24 23:57:45 +05:30
= _("Overview")
2019-09-04 21:01:54 +05:30
%span.badge.badge-pill= @merge_request.related_notes.user.count
- if @merge_request.source_project
2020-01-01 13:55:28 +05:30
= render "projects/merge_requests/tabs/tab", name: "commits", class: "commits-tab" do
2019-09-04 21:01:54 +05:30
= tab_link_for @merge_request, :commits do
= _("Commits")
%span.badge.badge-pill= @commits_count
2019-12-04 20:38:33 +05:30
- if number_of_pipelines.nonzero?
2020-01-01 13:55:28 +05:30
= render "projects/merge_requests/tabs/tab", name: "pipelines", class: "pipelines-tab" do
2019-09-04 21:01:54 +05:30
= tab_link_for @merge_request, :pipelines do
= _("Pipelines")
2019-12-04 20:38:33 +05:30
%span.badge.badge-pill.js-pipelines-mr-count= number_of_pipelines
2020-01-01 13:55:28 +05:30
= render "projects/merge_requests/tabs/tab", name: "diffs", class: "diffs-tab qa-diffs-tab", id: "diffs-tab" do
2019-09-04 21:01:54 +05:30
= tab_link_for @merge_request, :diffs do
= _("Changes")
%span.badge.badge-pill= @merge_request.diff_size
.d-flex.flex-wrap.align-items-center.justify-content-lg-end
2018-12-13 13:39:08 +05:30
#js-vue-discussion-counter
2017-09-10 17:25:29 +05:30
.tab-content#diff-notes-app
2019-03-02 22:35:43 +05:30
#js-diff-file-finder
2020-04-22 19:07:51 +05:30
#js-code-navigation
2020-01-01 13:55:28 +05:30
= render "projects/merge_requests/tabs/pane", id: "notes", class: "notes voting_notes" do
2017-09-10 17:25:29 +05:30
.row
%section.col-md-12
2018-03-27 19:54:05 +05:30
%script.js-notes-data{ type: "application/json" }= initial_notes_data(true).to_json.html_safe
.issuable-discussion.js-vue-notes-event
2020-10-24 23:57:45 +05:30
- if @merge_request.description.present?
.detail-page-description
= render "projects/merge_requests/description"
= render "projects/merge_requests/widget"
= render "projects/merge_requests/awards_block"
2021-02-22 17:27:13 +05:30
- if mr_action === "show"
2021-03-11 19:13:27 +05:30
- if Feature.enabled?(:paginated_notes, @project)
- add_page_startup_api_call notes_url
- else
- add_page_startup_api_call discussions_path(@merge_request)
2021-03-08 18:12:59 +05:30
- add_page_startup_api_call widget_project_json_merge_request_path(@project, @merge_request, format: :json)
- add_page_startup_api_call cached_widget_project_json_merge_request_path(@project, @merge_request, format: :json)
2021-03-11 19:13:27 +05:30
#js-vue-mr-discussions{ data: { notes_data: notes_data(@merge_request, Feature.enabled?(:paginated_notes, @project)).to_json,
2019-12-04 20:38:33 +05:30
noteable_data: serialize_issuable(@merge_request, serializer: 'noteable'),
2018-11-08 19:23:39 +05:30
noteable_type: 'MergeRequest',
target_type: 'merge_request',
2019-02-15 15:39:39 +05:30
help_page_path: suggest_changes_help_path,
2020-10-24 23:57:45 +05:30
current_user_data: @current_user_data,
is_locked: @merge_request.discussion_locked.to_s } }
2017-09-10 17:25:29 +05:30
2020-01-01 13:55:28 +05:30
= render "projects/merge_requests/tabs/pane", name: "commits", id: "commits", class: "commits" do
2017-09-10 17:25:29 +05:30
-# This tab is always loaded via AJAX
2020-01-01 13:55:28 +05:30
= render "projects/merge_requests/tabs/pane", name: "pipelines", id: "pipelines", class: "pipelines" do
2019-12-04 20:38:33 +05:30
- if number_of_pipelines.nonzero?
2017-09-10 17:25:29 +05:30
= render 'projects/commit/pipelines_list', disable_initialization: true, endpoint: pipelines_project_merge_request_path(@project, @merge_request)
2020-07-28 23:09:34 +05:30
- if mr_action === "diffs"
- add_page_startup_api_call @endpoint_metadata_url
2020-11-24 15:15:51 +05:30
- params = request.query_parameters
2021-03-11 19:13:27 +05:30
- if Feature.enabled?(:default_merge_ref_for_diffs, @project, default_enabled: :yaml)
2020-11-24 15:15:51 +05:30
- params = params.merge(diff_head: true)
2020-01-01 13:55:28 +05:30
= render "projects/merge_requests/tabs/pane", name: "diffs", id: "js-diffs-app", class: "diffs", data: { "is-locked": @merge_request.discussion_locked?,
2020-11-24 15:15:51 +05:30
endpoint: diffs_project_merge_request_path(@project, @merge_request, 'json', params),
2020-07-28 23:09:34 +05:30
endpoint_metadata: @endpoint_metadata_url,
2020-11-24 15:15:51 +05:30
endpoint_batch: diffs_batch_project_json_merge_request_path(@project, @merge_request, 'json', params),
2020-04-08 14:13:33 +05:30
endpoint_coverage: @coverage_path,
2019-02-15 15:39:39 +05:30
help_page_path: suggest_changes_help_path,
2019-12-04 20:38:33 +05:30
current_user_data: @current_user_data,
2019-02-15 15:39:39 +05:30
project_path: project_path(@merge_request.project),
2019-07-07 11:18:12 +05:30
changes_empty_state_illustration: image_path('illustrations/merge_request_changes_empty.svg'),
2019-09-04 21:01:54 +05:30
is_fluid_layout: fluid_layout.to_s,
dismiss_endpoint: user_callouts_path,
2019-12-04 20:38:33 +05:30
show_suggest_popover: show_suggest_popover?.to_s,
2020-07-28 23:09:34 +05:30
show_whitespace_default: @show_whitespace_default.to_s,
2021-03-08 18:12:59 +05:30
file_by_file_default: @file_by_file_default.to_s,
default_suggestion_commit_message: default_suggestion_commit_message }
2017-09-10 17:25:29 +05:30
.mr-loading-status
2020-03-13 15:44:24 +05:30
.loading.hide
.spinner.spinner-md
2017-09-10 17:25:29 +05:30
2021-01-03 14:25:43 +05:30
= render 'shared/issuable/sidebar', issuable_sidebar: @issuable_sidebar, assignees: @merge_request.assignees, reviewers: @merge_request.reviewers, source_branch: @merge_request.source_branch
2019-02-15 15:39:39 +05:30
2017-09-10 17:25:29 +05:30
- if @merge_request.can_be_reverted?(current_user)
2021-03-11 19:13:27 +05:30
= render "projects/commit/change", type: 'revert', commit: @merge_request.merge_commit
2017-09-10 17:25:29 +05:30
- if @merge_request.can_be_cherry_picked?
2021-03-11 19:13:27 +05:30
= render "projects/commit/change", type: 'cherry-pick', commit: @merge_request.merge_commit
2020-06-23 00:09:42 +05:30
#js-review-bar