mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Also fix modal body for archiving projects
This commit is contained in:
parent
5836c029c8
commit
009c5c363b
2 changed files with 5 additions and 4 deletions
|
@ -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}}
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue