Download project action button

This commit is contained in:
Alasdair Smith 2018-05-17 14:28:34 +01:00
parent ffc06f2a3b
commit 2354f4156b
2 changed files with 12 additions and 6 deletions

View file

@ -59,6 +59,7 @@ if settings.overleaf
tooltip=translate('download'),
tooltip-placement="top",
tooltip-append-to-body="true",
ng-click="download($event)"
)
i.icon.fa.fa-cloud-download
button.btn.btn-link.action-btn(

View file

@ -438,13 +438,14 @@ define [
)
$scope.downloadSelectedProjects = () ->
selected_project_ids = $scope.getSelectedProjectIds()
event_tracking.send 'project-list-page-interaction', 'project action', 'Download Zip'
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"
$scope.downloadProjectsById($scope.getSelectedProjectIds())
$scope.downloadProjectsById = (projectIds) ->
event_tracking.send 'project-list-page-interaction', 'project action', 'Download Zip'
if projectIds.length > 1
path = "/project/download/zip?project_ids=#{projectIds.join(',')}"
else
path = "/project/#{projectIds[0]}/download/zip"
window.location = path
$scope.openV1ImportModal = (project) ->
@ -492,6 +493,10 @@ define [
if value?
$scope.updateSelectedProjects()
$scope.download = (e) ->
e.stopPropagation()
$scope.downloadProjectsById([$scope.project.id])
$scope.archive = (e) ->
e.stopPropagation()
$scope.archiveOrLeaveProjects([$scope.project])