Show different message if user comes from SL rather than OL v2

This commit is contained in:
James Allen 2018-01-24 16:56:51 +00:00
parent 626f652c77
commit 3ed805a65a
3 changed files with 15 additions and 6 deletions

View file

@ -157,7 +157,7 @@ module.exports = ProjectController =
hasSubscription: (cb)->
LimitationsManager.userHasSubscriptionOrIsGroupMember currentUser, cb
user: (cb) ->
User.findById user_id, "featureSwitches", cb
User.findById user_id, "featureSwitches overleaf", cb
}, (err, results)->
if err?
logger.err err:err, "error getting data for project list page"

View file

@ -93,6 +93,10 @@ module.exports = (app, webRouter, privateApiRouter, publicApiRouter)->
req.externalAuthenticationSystemUsed = Features.externalAuthenticationSystemUsed
res.locals.externalAuthenticationSystemUsed = Features.externalAuthenticationSystemUsed
req.hasFeature = res.locals.hasFeature = Features.hasFeature
res.locals.userIsFromOLv1 = (user) ->
user.overleaf?.id?
res.locals.userIsFromSL = (user) ->
!user.overleaf?.id?
next()
webRouter.use (req, res, next)->

View file

@ -64,13 +64,18 @@ block content
aside.project-list-sidebar.col-md-2.col-xs-3
include ./list/side-bar
if isShowingV1Projects && settings.overleaf && settings.overleaf.host
if settings.accountMerge && settings.overleaf
.project-list-sidebar-v2-pane.col-md-2.col-xs-3
span Welcome to the Overleaf v2 alpha! #[a(href="https://www.overleaf.com/help/342-overleaf-v2-faq") Find out more].
span To tag or rename your v1 projects, please go back to Overleaf v1.
a.project-list-sidebar-v1-link(
href=settings.overleaf.host + "/dash?prefer-v1-dash=1"
) Go back to v1
if userIsFromOLv1(user)
span To tag or rename your v1 projects, please go back to Overleaf v1.
a.project-list-sidebar-v1-link(
href=settings.accountMerge.betaHost + "/dash?prefer-v1-dash=1"
) Go back to v1
if userIsFromSL(user)
a.project-list-sidebar-v1-link(
href=settings.accountMerge.sharelatexHost
) Go back to ShareLaTeX
.project-list-main.col-md-10.col-xs-9
include ./list/notifications