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-original-title="Download",
data-toggle="tooltip", data-toggle="tooltip",
data-placement="bottom", data-placement="bottom",
title="" ng-click="downloadSelectedProjects()"
) )
i.fa.fa-cloud-download i.fa.fa-cloud-download
a.btn.btn-default( a.btn.btn-default(

View file

@ -400,6 +400,17 @@ define [
controller: "UploadProjectModalController" 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) -> App.controller "ProjectListItemController", ($scope) ->
$scope.onSelectedChange = () -> $scope.onSelectedChange = () ->
$scope.$emit "selected:on-change" $scope.$emit "selected:on-change"