summaryrefslogtreecommitdiff
path: root/app/views/projects
diff options
context:
space:
mode:
authorPaco Guzman <pacoguzmanp@gmail.com>2016-08-25 09:24:27 +0200
committerPaco Guzman <pacoguzmanp@gmail.com>2016-08-25 09:24:27 +0200
commitb3bdd9e8651df2d42abae9d2dae814e04d7c4642 (patch)
treea09780a46e4b12118ec4a7c16c285cb201c72d55 /app/views/projects
parentb2bf01f4c271be66e93ed6f4b48a1da4d50e558d (diff)
downloadgitlab-ce-diff-file-cache-html-content.tar.gz
DiffFile cache html rendered contentdiff-file-cache-html-content
Diffstat (limited to 'app/views/projects')
-rw-r--r--app/views/projects/diffs/_content.html.haml9
-rw-r--r--app/views/projects/diffs/_text_file.html.haml1
2 files changed, 5 insertions, 5 deletions
diff --git a/app/views/projects/diffs/_content.html.haml b/app/views/projects/diffs/_content.html.haml
index d37961c4e40..8af44021cb4 100644
--- a/app/views/projects/diffs/_content.html.haml
+++ b/app/views/projects/diffs/_content.html.haml
@@ -13,10 +13,11 @@
.nothing-here-block.diff-collapsed{data: { diff_for_path: url } }
This diff is collapsed. Click to expand it.
- elsif diff_file.diff_lines.length > 0
- - if diff_view == :parallel
- = render "projects/diffs/parallel_view", diff_file: diff_file, project: project, blob: blob
- - else
- = render "projects/diffs/text_file", diff_file: diff_file
+ = cache_if(diff_file_content_cacheable?(diff_file), diff_file_content_cache_key(diff_file, diff_view), skip_digest: true) do
+ - if diff_view == :parallel
+ = render "projects/diffs/parallel_view", diff_file: diff_file
+ - else
+ = render "projects/diffs/text_file", diff_file: diff_file
- else
- if diff_file.mode_changed?
.nothing-here-block File mode changed
diff --git a/app/views/projects/diffs/_text_file.html.haml b/app/views/projects/diffs/_text_file.html.haml
index f1d2d4bf268..2a8bdc6916c 100644
--- a/app/views/projects/diffs/_text_file.html.haml
+++ b/app/views/projects/diffs/_text_file.html.haml
@@ -4,7 +4,6 @@
%a.show-suppressed-diff.js-show-suppressed-diff Changes suppressed. Click to show.
%table.text-file.code.js-syntax-highlight{ data: diff_view_data, class: too_big ? 'hide' : '' }
- - last_line = 0
- discussions = @grouped_diff_discussions unless @diff_notes_disabled
= render partial: "projects/diffs/line",
collection: diff_file.highlighted_diff_lines,