From 009c5c363b1b5cca57cf22b5f054384115fef425 Mon Sep 17 00:00:00 2001 From: Alasdair Smith Date: Mon, 13 Aug 2018 13:52:21 +0100 Subject: [PATCH] Also fix modal body for archiving projects --- services/web/app/views/project/list/modals.pug | 3 ++- .../coffee/main/project-list/modal-controllers.coffee | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/services/web/app/views/project/list/modals.pug b/services/web/app/views/project/list/modals.pug index 9ac969b518..3fd8b5b1f6 100644 --- a/services/web/app/views/project/list/modals.pug +++ b/services/web/app/views/project/list/modals.pug @@ -197,7 +197,8 @@ script(type='text/ng-template', id='deleteProjectsModalTemplate') h3(ng-if="action == 'delete-and-leave'") #{translate("delete_and_leave_projects")} .modal-body div(ng-show="projectsToDelete.length > 0") - p #{translate("about_to_delete_projects")} + p(ng-if="action == 'delete'") #{translate("about_to_delete_projects")} + p(ng-if="action == 'archive'") #{translate("about_to_archive_projects")} ul li(ng-repeat="project in projectsToDelete | orderBy:'name'") strong {{project.name}} diff --git a/services/web/public/coffee/main/project-list/modal-controllers.coffee b/services/web/public/coffee/main/project-list/modal-controllers.coffee index a8e5d5ec8f..bec9a8efb4 100644 --- a/services/web/public/coffee/main/project-list/modal-controllers.coffee +++ b/services/web/public/coffee/main/project-list/modal-controllers.coffee @@ -101,13 +101,13 @@ define [ App.controller 'DeleteProjectsModalController', ($scope, $modalInstance, $timeout, projects) -> $scope.projectsToDelete = projects.filter (project) -> project.accessLevel == "owner" $scope.projectsToLeave = projects.filter (project) -> project.accessLevel != "owner" - + $scope.projectsToArchive = projects.filter (project) -> + project.accessLevel == "owner" and !project.archived 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 - projectsToArchive = $scope.projectsToDelete.filter (project) -> !project.archived - if projectsToArchive.length > 0 and window.ExposedSettings.isOverleaf + if $scope.projectsToArchive.length > 0 and window.ExposedSettings.isOverleaf $scope.action = "archive" else $scope.action = "delete"