summaryrefslogtreecommitdiff
path: root/app/views/projects/diffs/_diffs.html.haml
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/projects/diffs/_diffs.html.haml')
-rw-r--r--app/views/projects/diffs/_diffs.html.haml7
1 files changed, 5 insertions, 2 deletions
diff --git a/app/views/projects/diffs/_diffs.html.haml b/app/views/projects/diffs/_diffs.html.haml
index 8364311796f..2f533b5848d 100644
--- a/app/views/projects/diffs/_diffs.html.haml
+++ b/app/views/projects/diffs/_diffs.html.haml
@@ -1,9 +1,10 @@
- environment = local_assigns.fetch(:environment, nil)
- show_whitespace_toggle = local_assigns.fetch(:show_whitespace_toggle, true)
- can_create_note = !@diff_notes_disabled && can?(current_user, :create_note, diffs.project)
-- diff_files = diffs.diff_files
- diff_page_context = local_assigns.fetch(:diff_page_context, nil)
- load_diff_files_async = Feature.enabled?(:async_commit_diff_files, @project) && diff_page_context == "is-commit"
+- paginate_diffs = local_assigns.fetch(:paginate_diffs, false) && !load_diff_files_async && Feature.enabled?(:paginate_commit_view, @project, type: :development)
+- diff_files = conditionally_paginate_diff_files(diffs, paginate: paginate_diffs)
.content-block.oneline-block.files-changed.diff-files-changed.js-diff-files-changed
.files-changed-inner
@@ -27,7 +28,6 @@
- if render_overflow_warning?(diffs)
= render 'projects/diffs/warning', diff_files: diffs
-
.files{ data: { can_create_note: can_create_note } }
- if load_diff_files_async
- url = url_for(safe_params.merge(action: 'diff_files'))
@@ -36,3 +36,6 @@
%span.spinner.spinner-md
- else
= render partial: 'projects/diffs/file', collection: diff_files, as: :diff_file, locals: { project: diffs.project, environment: environment, diff_page_context: diff_page_context }
+
+ - if paginate_diffs
+ = paginate(diff_files, theme: "gitlab")