diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-21 10:08:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-21 10:08:36 +0300 |
commit | 48aff82709769b098321c738f3444b9bdaa694c6 (patch) | |
tree | e00c7c43e2d9b603a5a6af576b1685e400410dee /app/helpers/blob_helper.rb | |
parent | 879f5329ee916a948223f8f43d77fba4da6cd028 (diff) |
Add latest changes from gitlab-org/gitlab@13-5-stable-eev13.5.0-rc42
Diffstat (limited to 'app/helpers/blob_helper.rb')
-rw-r--r-- | app/helpers/blob_helper.rb | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/app/helpers/blob_helper.rb b/app/helpers/blob_helper.rb index 2eff87ae0ec..806fea3ab44 100644 --- a/app/helpers/blob_helper.rb +++ b/app/helpers/blob_helper.rb @@ -1,12 +1,6 @@ # frozen_string_literal: true module BlobHelper - def highlight(file_name, file_content, language: nil, plain: false) - highlighted = Gitlab::Highlight.highlight(file_name, file_content, plain: plain, language: language) - - raw %(<pre class="code highlight"><code>#{highlighted}</code></pre>) - end - def no_highlight_files %w(credits changelog news copying copyright license authors) end @@ -33,11 +27,19 @@ module BlobHelper end def ide_fork_and_edit_path(project = @project, ref = @ref, path = @path, options = {}) - if current_user - project_forks_path(project, - namespace_key: current_user&.namespace&.id, - continue: edit_blob_fork_params(ide_edit_path(project, ref, path))) - end + fork_path_for_current_user(project, ide_edit_path(project, ref, path)) + end + + def fork_and_edit_path(project = @project, ref = @ref, path = @path, options = {}) + fork_path_for_current_user(project, edit_blob_path(project, ref, path, options)) + end + + def fork_path_for_current_user(project, path) + return unless current_user + + project_forks_path(project, + namespace_key: current_user.namespace&.id, + continue: edit_blob_fork_params(path)) end def encode_ide_path(path) @@ -148,7 +150,7 @@ module BlobHelper # mode - File unix mode # mode - File name def blob_icon(mode, name) - icon("#{file_type_icon_class('file', mode, name)} fw") + sprite_icon(file_type_icon_class('file', mode, name)) end def blob_raw_url(**kwargs) |