gitlab-org--gitlab-foss/app/views/projects/buttons/_download.html.haml

38 lines
1.9 KiB
Text
Raw Normal View History

- pipeline = local_assigns.fetch(:pipeline) { project.latest_successful_pipeline_for(ref) }
- if !project.empty_repo? && can?(current_user, :download_code, project)
- archive_prefix = "#{project.path}-#{ref.tr('/', '-')}"
.project-action-button.dropdown.inline>
2017-06-09 09:08:39 -04:00
%button.btn.has-tooltip{ title: s_('DownloadSource|Download'), 'data-toggle' => 'dropdown', 'aria-label' => s_('DownloadSource|Download') }
= sprite_icon('download')
2016-12-05 13:55:57 -05:00
= icon("caret-down")
2017-06-07 16:13:44 -04:00
%span.sr-only= _('Select Archive Format')
2016-12-05 13:55:57 -05:00
%ul.dropdown-menu.dropdown-menu-align-right{ role: 'menu' }
2017-06-07 16:13:44 -04:00
%li.dropdown-header
#{ _('Source code') }
2016-12-05 13:55:57 -05:00
%li
= link_to project_archive_path(project, id: tree_join(ref, archive_prefix), format: 'zip'), rel: 'nofollow', download: '' do
2017-06-07 16:13:44 -04:00
%span= _('Download zip')
2016-12-05 13:55:57 -05:00
%li
= link_to project_archive_path(project, id: tree_join(ref, archive_prefix), format: 'tar.gz'), rel: 'nofollow', download: '' do
2017-06-07 16:13:44 -04:00
%span= _('Download tar.gz')
2016-12-05 13:55:57 -05:00
%li
= link_to project_archive_path(project, id: tree_join(ref, archive_prefix), format: 'tar.bz2'), rel: 'nofollow', download: '' do
2017-06-07 16:13:44 -04:00
%span= _('Download tar.bz2')
2016-12-05 13:55:57 -05:00
%li
= link_to project_archive_path(project, id: tree_join(ref, archive_prefix), format: 'tar'), rel: 'nofollow', download: '' do
2017-06-07 16:13:44 -04:00
%span= _('Download tar')
- if pipeline && pipeline.latest_builds_with_artifacts.any?
%li.dropdown-header Artifacts
- unless pipeline.latest?
- latest_pipeline = project.pipeline_for(ref)
%li
.unclickable= ci_status_for_statuseable(latest_pipeline)
%li.dropdown-header Previous Artifacts
- pipeline.latest_builds_with_artifacts.each do |job|
%li
= link_to latest_succeeded_project_artifacts_path(project, "#{ref}/download", job: job.name), rel: 'nofollow', download: '' do
%span
#{s_('DownloadArtifacts|Download')} '#{job.name}'