debian-mirror-gitlab/app/views/projects/buttons/_download.html.haml

38 lines
2 KiB
Text
Raw Normal View History

2018-03-17 18:26:18 +05:30
- pipeline = local_assigns.fetch(:pipeline) { project.latest_successful_pipeline_for(ref) }
2017-08-17 22:00:37 +05:30
2016-09-29 09:46:39 +05:30
- if !project.empty_repo? && can?(current_user, :download_code, project)
2018-05-09 12:01:36 +05:30
- archive_prefix = "#{project.path}-#{ref.tr('/', '-')}"
2017-08-17 22:00:37 +05:30
.project-action-button.dropdown.inline>
2018-11-08 19:23:39 +05:30
%button.btn.has-tooltip{ title: s_('DownloadSource|Download'), 'data-toggle' => 'dropdown', 'aria-label' => s_('DownloadSource|Download'), 'data-display' => 'static' }
2018-03-17 18:26:18 +05:30
= sprite_icon('download')
2017-09-10 17:25:29 +05:30
%span.sr-only= _('Select Archive Format')
2019-02-15 15:39:39 +05:30
= sprite_icon("arrow-down")
2018-11-08 19:23:39 +05:30
%ul.dropdown-menu.dropdown-menu-right{ role: 'menu' }
2017-09-10 17:25:29 +05:30
%li.dropdown-header
#{ _('Source code') }
2017-08-17 22:00:37 +05:30
%li
2018-05-09 12:01:36 +05:30
= link_to project_archive_path(project, id: tree_join(ref, archive_prefix), format: 'zip'), rel: 'nofollow', download: '' do
2017-09-10 17:25:29 +05:30
%span= _('Download zip')
2017-08-17 22:00:37 +05:30
%li
2018-05-09 12:01:36 +05:30
= link_to project_archive_path(project, id: tree_join(ref, archive_prefix), format: 'tar.gz'), rel: 'nofollow', download: '' do
2017-09-10 17:25:29 +05:30
%span= _('Download tar.gz')
2017-08-17 22:00:37 +05:30
%li
2018-05-09 12:01:36 +05:30
= link_to project_archive_path(project, id: tree_join(ref, archive_prefix), format: 'tar.bz2'), rel: 'nofollow', download: '' do
2017-09-10 17:25:29 +05:30
%span= _('Download tar.bz2')
2017-08-17 22:00:37 +05:30
%li
2018-05-09 12:01:36 +05:30
= link_to project_archive_path(project, id: tree_join(ref, archive_prefix), format: 'tar'), rel: 'nofollow', download: '' do
2017-09-10 17:25:29 +05:30
%span= _('Download tar')
2016-09-29 09:46:39 +05:30
2018-03-17 18:26:18 +05:30
- 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}'