From 64061f007984672e9504171fdbb896167a9b3870 Mon Sep 17 00:00:00 2001 From: Alasdair Smith Date: Fri, 11 May 2018 10:11:27 +0100 Subject: [PATCH 1/2] Switch name of deleted projects to archived projects to reduce confusion --- services/web/app/views/project/list/side-bar.pug | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/web/app/views/project/list/side-bar.pug b/services/web/app/views/project/list/side-bar.pug index d01938b72d..e342b792a5 100644 --- a/services/web/app/views/project/list/side-bar.pug +++ b/services/web/app/views/project/list/side-bar.pug @@ -41,7 +41,7 @@ li(ng-class="{active: (filter == 'shared')}", ng-click="filterProjects('shared')") a(href) #{translate("shared_with_you")} li(ng-class="{active: (filter == 'archived')}", ng-click="filterProjects('archived')") - a(href) #{translate("deleted_projects")} + a(href) #{settings.overleaf ? translate("archived_projects") : translate("deleted_projects")} if isShowingV1Projects li(ng-class="{active: (filter == 'v1')}", ng-click="filterProjects('v1')") a(href) #{translate("v1_projects")} From df9294816e95eeb8af4e3748f239eb7997e7e5be Mon Sep 17 00:00:00 2001 From: Alasdair Smith Date: Fri, 11 May 2018 10:10:47 +0100 Subject: [PATCH 2/2] Show archive or leave icon based on selected projects --- services/web/app/views/project/list/project-list.pug | 6 ++++-- .../web/public/coffee/main/project-list/project-list.coffee | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/services/web/app/views/project/list/project-list.pug b/services/web/app/views/project/list/project-list.pug index 240f62bd54..df3c2bf681 100644 --- a/services/web/app/views/project/list/project-list.pug +++ b/services/web/app/views/project/list/project-list.pug @@ -32,14 +32,16 @@ ng-click="downloadSelectedProjects()" ) i.fa.fa-cloud-download + - var archiveButtonString = settings.overleaf ? translate("archive") : translate("delete") + - var archiveButtonIcon = settings.overleaf ? "fa-inbox" : "fa-trash-o" a.btn.btn-default( href, - tooltip=translate('delete'), + tooltip=`{{ isArchiveableProjectSelected ? '${archiveButtonString}' : '${translate("leave")}' }}`, tooltip-placement="bottom", tooltip-append-to-body="true", ng-click="openArchiveProjectsModal()" ) - i.fa.fa-trash-o + i.fa(ng-class=`isArchiveableProjectSelected ? '${archiveButtonIcon}' : 'fa-sign-out'`) .btn-group.dropdown(ng-hide="selectedProjects.length < 1", dropdown) a.btn.btn-default.dropdown-toggle( diff --git a/services/web/public/coffee/main/project-list/project-list.coffee b/services/web/public/coffee/main/project-list/project-list.coffee index 5880129294..36520d2cc7 100644 --- a/services/web/public/coffee/main/project-list/project-list.coffee +++ b/services/web/public/coffee/main/project-list/project-list.coffee @@ -8,6 +8,7 @@ define [ $scope.notifications = window.data.notifications $scope.allSelected = false $scope.selectedProjects = [] + $scope.isArchiveableProjectSelected = false $scope.filter = "all" $scope.predicate = "lastUpdated" $scope.nUntagged = 0 @@ -85,6 +86,8 @@ define [ $scope.updateSelectedProjects = () -> $scope.selectedProjects = $scope.projects.filter (project) -> project.selected + $scope.isArchiveableProjectSelected = $scope.selectedProjects.some (project) -> + window.user_id == project.owner._id $scope.getSelectedProjects = () -> $scope.selectedProjects