Commit 5fa6af05 authored by Annabel Dunstone's avatar Annabel Dunstone

Add artifacts to view branch page download dropdown

parent e00fb385
- ref = ref || nil - ref = ref || nil
- btn_class = btn_class || '' - btn_class = btn_class || ''
- split_button = split_button || false %span.btn-group{class: btn_class}
- if split_button == true .dropdown.inline
%span.btn-group{class: btn_class} %button.btn{ 'data-toggle' => 'dropdown' }
= link_to archive_namespace_project_repository_path(@project.namespace, @project, ref: ref, format: 'zip'), class: 'btn col-xs-10', rel: 'nofollow' do = icon('download')
%i.fa.fa-download
%span Download zip
%a.col-xs-2.btn.dropdown-toggle{ 'data-toggle' => 'dropdown' }
%span.caret %span.caret
%span.sr-only %span.sr-only
Select Archive Format Select Archive Format
%ul.col-xs-10.dropdown-menu.dropdown-menu-align-right{ role: 'menu' } %ul.dropdown-menu.dropdown-menu-align-right{ role: 'menu' }
%li.dropdown-header Source code
%li %li
= link_to archive_namespace_project_repository_path(@project.namespace, @project, ref: ref, format: 'zip'), rel: 'nofollow' do = link_to archive_namespace_project_repository_path(@project.namespace, @project, ref: ref, format: 'zip'), rel: 'nofollow' do
%i.fa.fa-download %i.fa.fa-download
...@@ -27,11 +25,10 @@ ...@@ -27,11 +25,10 @@
= link_to archive_namespace_project_repository_path(@project.namespace, @project, ref: ref, format: 'tar'), rel: 'nofollow' do = link_to archive_namespace_project_repository_path(@project.namespace, @project, ref: ref, format: 'tar'), rel: 'nofollow' do
%i.fa.fa-download %i.fa.fa-download
%span Download tar %span Download tar
- else - artifacts = @project.latest_success_builds_for(@ref)
%span.btn-group{class: btn_class} - if artifacts.any?
= link_to archive_namespace_project_repository_path(@project.namespace, @project, ref: ref, format: 'zip'), class: 'btn', rel: 'nofollow' do %li.dropdown-header Artifacts
%i.fa.fa-download - artifacts.each do |job|
%span zip %li
= link_to archive_namespace_project_repository_path(@project.namespace, @project, ref: ref, format: 'tar.gz'), class: 'btn', rel: 'nofollow' do = link_to download_namespace_project_build_artifacts_path(@project.namespace, @project, job), rel: 'nofollow' do
%i.fa.fa-download %span Download '#{job.name}'
%span tar.gz
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
.tree-controls .tree-controls
= render 'projects/find_file_link' = render 'projects/find_file_link'
- if can? current_user, :download_code, @project - if can? current_user, :download_code, @project
= render 'projects/repositories/download_archive', ref: @ref, btn_class: 'hidden-xs hidden-sm btn-grouped', split_button: true = render 'projects/repositories/download_archive', ref: @ref, btn_class: 'hidden-xs hidden-sm btn-grouped'
#tree-holder.tree-holder.clearfix #tree-holder.tree-holder.clearfix
.nav-block .nav-block
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment