diff options
Diffstat (limited to 'app/views/projects/diffs/_content.html.haml')
-rw-r--r-- | app/views/projects/diffs/_content.html.haml | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/app/views/projects/diffs/_content.html.haml b/app/views/projects/diffs/_content.html.haml index 718f129cba8..23f9afe8352 100644 --- a/app/views/projects/diffs/_content.html.haml +++ b/app/views/projects/diffs/_content.html.haml @@ -1,3 +1,12 @@ - diff_file = local_assigns.fetch(:diff_file, nil) +- file_hash = hexdigest(diff_file.file_path) + .diff-content - = render 'projects/diffs/viewer', viewer: diff_file.viewer + - if diff_file.has_renderable? + %div{ id: "#raw-diff-#{file_hash}", data: { file_hash: file_hash, diff_toggle_entity: 'toHide' } } + = render 'projects/diffs/viewer', viewer: diff_file.viewer + %div{ id: "#rendered-diff-#{file_hash}", data: { file_hash: file_hash, diff_toggle_entity: 'toShow' } } + = render 'projects/diffs/viewer', viewer: diff_file.rendered.viewer + - else + = render 'projects/diffs/viewer', viewer: diff_file.viewer + |