summaryrefslogtreecommitdiff
path: root/app/helpers
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2017-05-02 15:25:26 +0000
committerSean McGivern <sean@mcgivern.me.uk>2017-05-02 15:25:26 +0000
commitc5dee301f8bb6496c09c2aef54f9665b350c535f (patch)
treeae6354684944ff91413a5c2cceb9126014aff893 /app/helpers
parentd32ecb23eb10065b1cc5eea95f4271ef402f0059 (diff)
parent0ca6ff67e438a8218ac53edd6280041d2f4b7a9c (diff)
downloadgitlab-ce-c5dee301f8bb6496c09c2aef54f9665b350c535f.tar.gz
Merge branch 'dm-snippet-download-button' into 'master'
Add download button to project snippets See merge request !11004
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/snippets_helper.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/helpers/snippets_helper.rb b/app/helpers/snippets_helper.rb
index 979264c9421..2fd64b3441e 100644
--- a/app/helpers/snippets_helper.rb
+++ b/app/helpers/snippets_helper.rb
@@ -8,6 +8,14 @@ module SnippetsHelper
end
end
+ def download_snippet_path(snippet)
+ if snippet.project_id
+ raw_namespace_project_snippet_path(@project.namespace, @project, snippet, inline: false)
+ else
+ raw_snippet_path(snippet, inline: false)
+ end
+ end
+
# Return the path of a snippets index for a user or for a project
#
# @returns String, path to snippet index