diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-04-13 19:57:43 +0300 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-04-27 20:23:26 +0300 |
commit | 0d1ec11e8974b38b0d749a08fde2817c61326441 (patch) | |
tree | acecd60b7c7cd90fea299d788aab739645b0e77f /app/helpers | |
parent | 5cb27e9fa74c7234195e10ade933e8a475cff403 (diff) |
Use Blob methods instead of BlobHelper helpers
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/blob_helper.rb | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/app/helpers/blob_helper.rb b/app/helpers/blob_helper.rb index ade9e19cea8..e2092b8bfbf 100644 --- a/app/helpers/blob_helper.rb +++ b/app/helpers/blob_helper.rb @@ -52,7 +52,7 @@ module BlobHelper if !on_top_of_branch?(project, ref) button_tag label, class: "#{common_classes} disabled has-tooltip", title: "You can only #{action} files when you are on a branch", data: { container: 'body' } - elsif blob.lfs_pointer? + elsif blob.valid_lfs_pointer? button_tag label, class: "#{common_classes} disabled has-tooltip", title: "It is not possible to #{action} files that are stored in LFS using the web interface", data: { container: 'body' } elsif can_modify_blob?(blob, project, ref) button_tag label, class: "#{common_classes}", 'data-target' => "#modal-#{modal_type}-blob", 'data-toggle' => 'modal' @@ -95,7 +95,7 @@ module BlobHelper end def can_modify_blob?(blob, project = @project, ref = @ref) - !blob.lfs_pointer? && can_edit_tree?(project, ref) + !blob.valid_lfs_pointer? && can_edit_tree?(project, ref) end def leave_edit_message @@ -118,22 +118,6 @@ module BlobHelper icon("#{file_type_icon_class('file', mode, name)} fw") end - def blob_text_viewable?(blob) - blob && blob.text? && !blob.lfs_pointer? && !blob.only_display_raw? - end - - def blob_rendered_as_text?(blob) - blob_text_viewable?(blob) && blob.to_partial_path(@project) == 'text' - end - - def blob_size(blob) - if blob.lfs_pointer? - blob.lfs_size - else - blob.size - end - end - def blob_raw_url namespace_project_raw_path(@project.namespace, @project, @id) end |