summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/views/projects/buttons/_download.html.haml20
-rw-r--r--app/views/projects/buttons/_download_links.html.haml9
2 files changed, 11 insertions, 18 deletions
diff --git a/app/views/projects/buttons/_download.html.haml b/app/views/projects/buttons/_download.html.haml
index e3f5a2990ba..acd63de2277 100644
--- a/app/views/projects/buttons/_download.html.haml
+++ b/app/views/projects/buttons/_download.html.haml
@@ -10,28 +10,12 @@
%ul.dropdown-menu.dropdown-menu-right{ role: 'menu' }
%li.dropdown-bold-header= _('Download source code')
%li.dropdown-menu-content
- %ul
- %li.d-inline-block.m-0.p-0
- = link_to 'zip', project_archive_path(project, id: tree_join(ref, archive_prefix), format: 'zip'), rel: 'nofollow', download: '', class: 'btn btn-primary btn-xs'
- %li.d-inline-block.m-0.p-0
- = link_to 'tar.gz', project_archive_path(project, id: tree_join(ref, archive_prefix), format: 'tar.gz'), rel: 'nofollow', download: '', class: 'btn btn-xs'
- %li.d-inline-block.m-0.p-0
- = link_to 'tar.bz2', project_archive_path(project, id: tree_join(ref, archive_prefix), format: 'tar.bz2'), rel: 'nofollow', download: '', class: 'btn btn-xs'
- %li.d-inline-block.m-0.p-0
- = link_to 'tar', project_archive_path(project, id: tree_join(ref, archive_prefix), format: 'tar'), rel: 'nofollow', download: '', class: 'btn btn-xs'
+ = render 'projects/buttons/download_links', project: project, ref: ref, archive_prefix: archive_prefix, path: nil
- if directory?
%li.separator
%li.dropdown-bold-header= _('Download this directory')
%li.dropdown-menu-content
- %ul
- %li.d-inline-block.m-0.p-0
- = link_to 'zip', project_archive_path(project, id: tree_join(ref, archive_prefix), path: @path, format: 'zip'), rel: 'nofollow', download: '', class: 'btn btn-primary btn-xs'
- %li.d-inline-block.m-0.p-0
- = link_to 'tar.gz', project_archive_path(project, id: tree_join(ref, archive_prefix), path: @path, format: 'tar.gz'), rel: 'nofollow', download: '', class: 'btn btn-xs'
- %li.d-inline-block.m-0.p-0
- = link_to 'tar.bz2', project_archive_path(project, id: tree_join(ref, archive_prefix), path: @path, format: 'tar.bz2'), rel: 'nofollow', download: '', class: 'btn btn-xs'
- %li.d-inline-block.m-0.p-0
- = link_to 'tar', project_archive_path(project, id: tree_join(ref, archive_prefix), path: @path, format: 'tar'), rel: 'nofollow', download: '', class: 'btn btn-xs'
+ = render 'projects/buttons/download_links', project: project, ref: ref, archive_prefix: archive_prefix, path: @path
- if pipeline && pipeline.latest_builds_with_artifacts.any?
%li.separator
%li.dropdown-bold-header= _('Download artifacts')
diff --git a/app/views/projects/buttons/_download_links.html.haml b/app/views/projects/buttons/_download_links.html.haml
new file mode 100644
index 00000000000..47a1704f946
--- /dev/null
+++ b/app/views/projects/buttons/_download_links.html.haml
@@ -0,0 +1,9 @@
+%ul
+ %li.d-inline-block.m-0.p-0
+ = link_to 'zip', project_archive_path(project, id: tree_join(ref, archive_prefix), path: path, format: 'zip'), rel: 'nofollow', download: '', class: 'btn btn-primary btn-xs'
+ %li.d-inline-block.m-0.p-0
+ = link_to 'tar.gz', project_archive_path(project, id: tree_join(ref, archive_prefix), path: path, format: 'tar.gz'), rel: 'nofollow', download: '', class: 'btn btn-xs'
+ %li.d-inline-block.m-0.p-0
+ = link_to 'tar.bz2', project_archive_path(project, id: tree_join(ref, archive_prefix), path: path, format: 'tar.bz2'), rel: 'nofollow', download: '', class: 'btn btn-xs'
+ %li.d-inline-block.m-0.p-0
+ = link_to 'tar', project_archive_path(project, id: tree_join(ref, archive_prefix), path: path, format: 'tar'), rel: 'nofollow', download: '', class: 'btn btn-xs'