mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #814 from sharelatex/as-fix-delete-modal-copy
Fix delete wording on archive modal
This commit is contained in:
commit
b9e63421a8
4 changed files with 20 additions and 3 deletions
|
@ -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()
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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}}
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
Loading…
Reference in a new issue