diff options
author | Douwe Maan <douwe@gitlab.com> | 2017-03-13 21:14:06 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2017-03-13 21:14:06 +0000 |
commit | 88206d67c38e87685bbacc14cfd60ee9dc42ac7f (patch) | |
tree | f8cc004731fd7d31254a36280e72ef9c6c0034a4 /app | |
parent | db3c2c233145ca5c7aaead5e93cf2850d82762b4 (diff) | |
parent | 7849683766e93cfd91e0c864f3deb08500ea35d9 (diff) | |
download | gitlab-ce-88206d67c38e87685bbacc14cfd60ee9dc42ac7f.tar.gz |
Merge branch 'feature/custom-lfs' into 'master'
Do not show LFS object when LFS is disabled
Closes #28817
See merge request !9779
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/projects/raw_controller.rb | 2 | ||||
-rw-r--r-- | app/models/blob.rb | 8 | ||||
-rw-r--r-- | app/views/projects/blob/_blob.html.haml | 2 |
3 files changed, 8 insertions, 4 deletions
diff --git a/app/controllers/projects/raw_controller.rb b/app/controllers/projects/raw_controller.rb index 10d24da16d7..c55b37ae0dd 100644 --- a/app/controllers/projects/raw_controller.rb +++ b/app/controllers/projects/raw_controller.rb @@ -15,7 +15,7 @@ class Projects::RawController < Projects::ApplicationController return if cached_blob? - if @blob.lfs_pointer? + if @blob.lfs_pointer? && project.lfs_enabled? send_lfs_object else send_git_blob @repository, @blob diff --git a/app/models/blob.rb b/app/models/blob.rb index ab92e820335..1376b86fdad 100644 --- a/app/models/blob.rb +++ b/app/models/blob.rb @@ -54,9 +54,13 @@ class Blob < SimpleDelegator UploaderHelper::VIDEO_EXT.include?(extname.downcase.delete('.')) end - def to_partial_path + def to_partial_path(project) if lfs_pointer? - 'download' + if project.lfs_enabled? + 'download' + else + 'text' + end elsif image? || svg? 'image' elsif text? diff --git a/app/views/projects/blob/_blob.html.haml b/app/views/projects/blob/_blob.html.haml index 24ff74ecb3b..bf8801bb1e3 100644 --- a/app/views/projects/blob/_blob.html.haml +++ b/app/views/projects/blob/_blob.html.haml @@ -33,4 +33,4 @@ = number_to_human_size(blob_size(blob)) .file-actions.hidden-xs = render "actions" - = render blob, blob: blob + = render blob.to_partial_path(@project), blob: blob |