Merge pull request #814 from sharelatex/as-fix-delete-modal-copy

Fix delete wording on archive modal
This commit is contained in:
Alasdair Smith 2018-08-16 16:33:30 +01:00 committed by GitHub
commit b9e63421a8
4 changed files with 20 additions and 3 deletions

View file

@ -333,3 +333,8 @@ module.exports = (app, webRouter, privateApiRouter, publicApiRouter)->
defaultLineHeight : if isOl then 'normal' else 'compact'
renderAnnouncements : !isOl
next()
webRouter.use (req, res, next) ->
res.locals.ExposedSettings =
isOverleaf: Settings.overleaf?
next()

View file

@ -70,6 +70,7 @@ html(itemscope, itemtype='http://schema.org/Product')
window.systemMessages = !{JSON.stringify(systemMessages).replace(/\//g, '\\/')};
window.ab = {};
window.user_id = '#{getLoggedInUserId()}';
window.ExposedSettings = JSON.parse('!{JSON.stringify(ExposedSettings).replace(/\//g, "\\/")}');
- if (typeof(settings.algolia) != "undefined")
script.

View file

@ -192,11 +192,14 @@ 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")}
h3(ng-if="action == 'archive-and-leave'") #{translate("archive_and_leave_projects")}
.modal-body
div(ng-show="projectsToDelete.length > 0")
p #{translate("about_to_delete_projects")}
p(ng-if="action == 'delete' || action == 'delete-and-leave'") #{translate("about_to_delete_projects")}
p(ng-if="action == 'archive' || action == 'archive-and-leave'") #{translate("about_to_archive_projects")}
ul
li(ng-repeat="project in projectsToDelete | orderBy:'name'")
strong {{project.name}}

View file

@ -101,11 +101,19 @@ 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"
if $scope.projectsToArchive.length > 0 and window.ExposedSettings.isOverleaf
$scope.action = "archive-and-leave"
else
$scope.action = "delete-and-leave"
else if $scope.projectsToLeave.length == 0 and $scope.projectsToDelete.length > 0
$scope.action = "delete"
if $scope.projectsToArchive.length > 0 and window.ExposedSettings.isOverleaf
$scope.action = "archive"
else
$scope.action = "delete"
else
$scope.action = "leave"