diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-06-06 16:28:06 -0500 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-06-14 10:12:21 -0500 |
commit | 794425456322864f37dbd862aca9bc6b6447591a (patch) | |
tree | e04869a293f434756527fcdf80505bcde12bc3f6 /app/helpers | |
parent | 64e85fdaffcd03ef52ff74953b1a4e0caf5a23e8 (diff) | |
download | gitlab-ce-794425456322864f37dbd862aca9bc6b6447591a.tar.gz |
Implement diff viewers
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/diff_helper.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/app/helpers/diff_helper.rb b/app/helpers/diff_helper.rb index 2ae3a616933..06822747d11 100644 --- a/app/helpers/diff_helper.rb +++ b/app/helpers/diff_helper.rb @@ -124,6 +124,30 @@ module DiffHelper !diff_file.deleted_file? && @merge_request && @merge_request.source_project end + def diff_render_error_reason(viewer) + case viewer.render_error + when :too_large + "it is too large" + when :server_side_but_stored_externally + case viewer.diff_file.external_storage + when :lfs + 'it is stored in LFS' + else + 'it is stored externally' + end + end + end + + def diff_render_error_options(viewer) + diff_file = viewer.diff_file + options = [] + + blob_url = namespace_project_blob_path(@project.namespace, @project, tree_join(diff_file.content_sha, diff_file.file_path)) + options << link_to('view the blob', blob_url) + + options + end + private def diff_btn(title, name, selected) |