Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-04-15 15:09:18 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-04-15 15:09:18 +0300
commitb7c735c8ac11b8182807070fc6f84f2606e15427 (patch)
treee74b4d25abb8bbf23546f001dd94515e2840a3a3 /app/helpers
parent221b529789f4090341a825695aeb49b8df6dd11d (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/snippets_helper.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/app/helpers/snippets_helper.rb b/app/helpers/snippets_helper.rb
index fd7e58826b5..a9f90a8f5e4 100644
--- a/app/helpers/snippets_helper.rb
+++ b/app/helpers/snippets_helper.rb
@@ -160,4 +160,14 @@ module SnippetsHelper
title: 'Download',
rel: 'noopener noreferrer')
end
+
+ def snippet_file_name(snippet)
+ blob = if Feature.enabled?(:version_snippets, current_user) && !snippet.repository.empty?
+ snippet.blobs.first
+ else
+ snippet.blob
+ end
+
+ blob.name
+ end
end