diff options
author | Patrick Bajao <ebajao@gitlab.com> | 2019-04-04 10:53:01 +0300 |
---|---|---|
committer | Patrick Bajao <ebajao@gitlab.com> | 2019-04-04 11:10:40 +0300 |
commit | 68a0ba941966e742f7c5eb21a26928b1f1d6b156 (patch) | |
tree | b655da0d5e177d472dde07c81830f3b00f97e17a /app | |
parent | 71ec6a4dcf405d9b50478cb37ba8dced386c6361 (diff) |
Add download_links partial to DRY up a bit
Diffstat (limited to 'app')
-rw-r--r-- | app/views/projects/buttons/_download.html.haml | 20 | ||||
-rw-r--r-- | app/views/projects/buttons/_download_links.html.haml | 9 |
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' |