Show archive heading if archiving and on OL

This commit is contained in:
Alasdair Smith 2018-08-13 12:33:31 +01:00
parent 274ac8b1ba
commit 5836c029c8
2 changed files with 7 additions and 1 deletions

View file

@ -192,6 +192,7 @@ script(type='text/ng-template', id='deleteProjectsModalTemplate')
ng-click="cancel()"
) ×
h3(ng-if="action == 'delete'") #{translate("delete_projects")}
h3(ng-if="action == 'archive'") #{translate("archive_projects")}
h3(ng-if="action == 'leave'") #{translate("leave_projects")}
h3(ng-if="action == 'delete-and-leave'") #{translate("delete_and_leave_projects")}
.modal-body

View file

@ -102,10 +102,15 @@ define [
$scope.projectsToDelete = projects.filter (project) -> project.accessLevel == "owner"
$scope.projectsToLeave = projects.filter (project) -> project.accessLevel != "owner"
if $scope.projectsToLeave.length > 0 and $scope.projectsToDelete.length > 0
$scope.action = "delete-and-leave"
else if $scope.projectsToLeave.length == 0 and $scope.projectsToDelete.length > 0
$scope.action = "delete"
projectsToArchive = $scope.projectsToDelete.filter (project) -> !project.archived
if projectsToArchive.length > 0 and window.ExposedSettings.isOverleaf
$scope.action = "archive"
else
$scope.action = "delete"
else
$scope.action = "leave"