diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 21:42:06 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 21:42:06 +0300 |
commit | 6e4e1050d9dba2b7b2523fdd1768823ab85feef4 (patch) | |
tree | 78be5963ec075d80116a932011d695dd33910b4e /app/views/projects/commits/_commits.html.haml | |
parent | 1ce776de4ae122aba3f349c02c17cebeaa8ecf07 (diff) |
Add latest changes from gitlab-org/gitlab@13-3-stable-ee
Diffstat (limited to 'app/views/projects/commits/_commits.html.haml')
-rw-r--r-- | app/views/projects/commits/_commits.html.haml | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/app/views/projects/commits/_commits.html.haml b/app/views/projects/commits/_commits.html.haml index e413bd78789..293500a6c31 100644 --- a/app/views/projects/commits/_commits.html.haml +++ b/app/views/projects/commits/_commits.html.haml @@ -1,8 +1,10 @@ - merge_request = local_assigns.fetch(:merge_request, nil) - project = local_assigns.fetch(:project) { merge_request&.project } - ref = local_assigns.fetch(:ref) { merge_request&.source_branch } +- can_update_merge_request = can?(current_user, :update_merge_request, @merge_request) - commits = @commits +- context_commits = @context_commits - hidden = @hidden_commit_count - commits.chunk { |c| c.committed_date.in_time_zone.to_date }.each do |day, daily_commits| @@ -14,11 +16,26 @@ %ul.content-list.commit-list.flex-list = render partial: 'projects/commits/commit', collection: daily_commits, locals: { project: project, ref: ref, merge_request: merge_request } +- if context_commits.present? + %li.commit-header.js-commit-header + %span.font-weight-bold= n_("%d previously merged commit", "%d previously merged commits", context_commits.count) % context_commits.count + - if project.context_commits_enabled? && can_update_merge_request + %button.btn.btn-default.ml-3.add-review-item-modal-trigger{ type: "button", data: { context_commits_empty: 'false' } } + = _('Add/remove') + + %li.commits-row + %ul.content-list.commit-list.flex-list + = render partial: 'projects/commits/commit', collection: context_commits, locals: { project: project, ref: ref, merge_request: merge_request } + - if hidden > 0 %li.alert.alert-warning = n_('%s additional commit has been omitted to prevent performance issues.', '%s additional commits have been omitted to prevent performance issues.', hidden) % number_with_delimiter(hidden) -- if commits.size == 0 +- if project.context_commits_enabled? && can_update_merge_request && context_commits&.empty? + %button.btn.btn-default.mt-3.add-review-item-modal-trigger{ type: "button", data: { context_commits_empty: 'true' } } + = _('Add previously merged commits') + +- if commits.size == 0 && context_commits.nil? .mt-4.text-center .bold = _('Your search didn\'t match any commits.') |