diff options
author | Kia Mei Somabes <kssomabes@up.edu.ph> | 2018-07-13 12:41:24 +0800 |
---|---|---|
committer | Patrick Bajao <ebajao@gitlab.com> | 2019-04-02 22:06:56 +0800 |
commit | e028276d34571cd5128021ab5daf3088eb538be2 (patch) | |
tree | b77366284ce8555deb5e2f92b39378c0f996eebf /app/helpers | |
parent | 8b9da458ec31d053da0a26cf7b23ecf2f8baa8a6 (diff) | |
download | gitlab-ce-e028276d34571cd5128021ab5daf3088eb538be2.tar.gz |
Add download directory in menu
Add subdirectory params for RepositoriesController#archive
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/projects_helper.rb | 8 | ||||
-rw-r--r-- | app/helpers/workhorse_helper.rb | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index f2abb241753..f5cae40aa86 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -26,6 +26,14 @@ module ProjectsHelper image_tag(src, width: opts[:size], class: classes, alt: '', "data-src" => avatar) end + + def is_directory + @path.empty? ? false : true + end + + def get_directory_path + @path ? "#{@path}/" : '' + end def author_content_tag(author, opts = {}) default_opts = { author_class: 'author', tooltip: false, by_username: false } diff --git a/app/helpers/workhorse_helper.rb b/app/helpers/workhorse_helper.rb index bb5b1555dc4..7c49a6e1c6d 100644 --- a/app/helpers/workhorse_helper.rb +++ b/app/helpers/workhorse_helper.rb @@ -31,6 +31,7 @@ module WorkhorseHelper # Archive a Git repository and send it through Workhorse def send_git_archive(repository, **kwargs) + kwargs.delete(:subdirectory) if kwargs[:subdirectory].nil? headers.store(*Gitlab::Workhorse.send_git_archive(repository, **kwargs)) head :ok end |