_download.html.haml 2.02 KB
Newer Older
1 2
- pipeline = local_assigns.fetch(:pipeline) { project.pipelines.latest_successful_for(ref) }

3
- if !project.empty_repo? && can?(current_user, :download_code, project)
4
  .project-action-button.dropdown.inline>
5
    %button.btn.has-tooltip{ title: 'Download', 'data-toggle' => 'dropdown', 'aria-label' => 'Download' }
Annabel Dunstone Gray's avatar
Annabel Dunstone Gray committed
6 7 8 9 10 11 12
      = icon('download')
      = icon("caret-down")
      %span.sr-only
        Select Archive Format
    %ul.dropdown-menu.dropdown-menu-align-right{ role: 'menu' }
      %li.dropdown-header Source code
      %li
13
        = link_to archive_namespace_project_repository_path(project.namespace, project, ref: ref, format: 'zip'), rel: 'nofollow', download: '' do
Annabel Dunstone Gray's avatar
Annabel Dunstone Gray committed
14 15 16
          %i.fa.fa-download
          %span Download zip
      %li
17
        = link_to archive_namespace_project_repository_path(project.namespace, project, ref: ref, format: 'tar.gz'), rel: 'nofollow', download: '' do
Annabel Dunstone Gray's avatar
Annabel Dunstone Gray committed
18 19 20
          %i.fa.fa-download
          %span Download tar.gz
      %li
21
        = link_to archive_namespace_project_repository_path(project.namespace, project, ref: ref, format: 'tar.bz2'), rel: 'nofollow', download: '' do
Annabel Dunstone Gray's avatar
Annabel Dunstone Gray committed
22 23 24
          %i.fa.fa-download
          %span Download tar.bz2
      %li
25
        = link_to archive_namespace_project_repository_path(project.namespace, project, ref: ref, format: 'tar'), rel: 'nofollow', download: '' do
Annabel Dunstone Gray's avatar
Annabel Dunstone Gray committed
26 27
          %i.fa.fa-download
          %span Download tar
28

Annabel Dunstone Gray's avatar
Annabel Dunstone Gray committed
29 30 31 32 33 34 35 36 37 38 39
      - if pipeline
        - artifacts = pipeline.builds.latest.with_artifacts
        - if 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
          - artifacts.each do |job|
            %li
40
              = link_to latest_succeeded_namespace_project_artifacts_path(project.namespace, project, "#{ref}/download", job: job.name), rel: 'nofollow', download: '' do
Annabel Dunstone Gray's avatar
Annabel Dunstone Gray committed
41 42
                %i.fa.fa-download
                %span Download '#{job.name}'