Hook up front end download

This commit is contained in:
James Allen 2014-06-18 16:43:37 +01:00
parent 2b349039c3
commit 5513a0b436
2 changed files with 12 additions and 1 deletions

View file

@ -173,7 +173,7 @@ block content
data-original-title="Download",
data-toggle="tooltip",
data-placement="bottom",
title=""
ng-click="downloadSelectedProjects()"
)
i.fa.fa-cloud-download
a.btn.btn-default(

View file

@ -400,6 +400,17 @@ define [
controller: "UploadProjectModalController"
)
$scope.downloadSelectedProjects = () ->
selected_project_ids = $scope.getSelectedProjectIds()
if selected_project_ids.length > 1
path = "/project/download/zip?project_ids=#{selected_project_ids.join(',')}"
else
path = "/project/#{selected_project_ids[0]}/download/zip"
window.location = path
App.controller "ProjectListItemController", ($scope) ->
$scope.onSelectedChange = () ->
$scope.$emit "selected:on-change"