Show confirmation for deleting projects forever

This commit is contained in:
James Allen 2014-06-16 16:17:28 +01:00
parent 0a334939ce
commit 608e9476b6
2 changed files with 13 additions and 1 deletions

View file

@ -177,7 +177,7 @@ block content
data-original-title="Delete Forever",
data-toggle="tooltip",
data-placement="bottom",
ng-click="deleteSelectedProjects()"
ng-click="openDeleteProjectsModal()"
) Delete Forever
.row.row-spaced

View file

@ -345,6 +345,18 @@ ProjectPageApp.controller "ProjectPageController", ($scope, $modal, $http, $q) -
$scope.updateVisibleProjects()
$scope.openDeleteProjectsModal = () ->
modalInstance = $modal.open(
templateUrl: "deleteProjectsModalTemplate"
controller: "DeleteProjectsModalController"
resolve:
projects: () -> $scope.getSelectedProjects()
)
modalInstance.result.then () ->
$scope.deleteSelectedProjects()
$scope.deleteSelectedProjects = () ->
selected_projects = $scope.getSelectedProjects()
selected_project_ids = $scope.getSelectedProjectIds()