mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
added custom user dashboard page
This commit is contained in:
parent
3ba3a91043
commit
b90003b11e
4 changed files with 36 additions and 0 deletions
|
@ -89,6 +89,14 @@ module.exports = SubscriptionController =
|
||||||
subscriptionTabActive: true
|
subscriptionTabActive: true
|
||||||
|
|
||||||
|
|
||||||
|
userCustomSubscriptionPage: (req, res, next)->
|
||||||
|
SecurityManager.getCurrentUser req, (error, user) ->
|
||||||
|
LimitationsManager.userHasSubscriptionOrIsGroupMember user, (err, hasSubOrIsGroupMember, subscription)->
|
||||||
|
res.render "subscriptions/custom_account",
|
||||||
|
title: "your_subscription"
|
||||||
|
subscription: subscription
|
||||||
|
|
||||||
|
|
||||||
editBillingDetailsPage: (req, res, next) ->
|
editBillingDetailsPage: (req, res, next) ->
|
||||||
SecurityManager.getCurrentUser req, (error, user) ->
|
SecurityManager.getCurrentUser req, (error, user) ->
|
||||||
return next(error) if error?
|
return next(error) if error?
|
||||||
|
|
|
@ -10,6 +10,9 @@ module.exports =
|
||||||
app.get '/user/subscription/plans', SubscriptionController.plansPage
|
app.get '/user/subscription/plans', SubscriptionController.plansPage
|
||||||
|
|
||||||
app.get '/user/subscription', AuthenticationController.requireLogin(), SubscriptionController.userSubscriptionPage
|
app.get '/user/subscription', AuthenticationController.requireLogin(), SubscriptionController.userSubscriptionPage
|
||||||
|
|
||||||
|
app.get '/user/subscription/custom_account', AuthenticationController.requireLogin(), SubscriptionController.userCustomSubscriptionPage
|
||||||
|
|
||||||
|
|
||||||
app.get '/user/subscription/new', AuthenticationController.requireLogin(), SubscriptionController.paymentPage
|
app.get '/user/subscription/new', AuthenticationController.requireLogin(), SubscriptionController.paymentPage
|
||||||
app.get '/user/subscription/billing-details/edit', AuthenticationController.requireLogin(), SubscriptionController.editBillingDetailsPage
|
app.get '/user/subscription/billing-details/edit', AuthenticationController.requireLogin(), SubscriptionController.editBillingDetailsPage
|
||||||
|
|
15
services/web/app/views/subscriptions/custom_account.jade
Normal file
15
services/web/app/views/subscriptions/custom_account.jade
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
extends ../layout
|
||||||
|
|
||||||
|
block content
|
||||||
|
.content.content-alt
|
||||||
|
.container
|
||||||
|
.row
|
||||||
|
.col-md-8.col-md-offset-2
|
||||||
|
.card
|
||||||
|
.page-header
|
||||||
|
h1 #{translate("your_subscription")}
|
||||||
|
div To make changes to your subscription please contact team@sharelatex.com
|
||||||
|
div
|
||||||
|
div
|
||||||
|
-if(subscription.groupPlan)
|
||||||
|
a(href="/subscription/group").btn.btn-success !{translate("manage_group")}
|
|
@ -193,6 +193,16 @@ describe "SubscriptionController sanboxed", ->
|
||||||
it "should redirect to /user/subscription/custom_account", ->
|
it "should redirect to /user/subscription/custom_account", ->
|
||||||
@res.redirectedTo.should.equal("/user/subscription/custom_account")
|
@res.redirectedTo.should.equal("/user/subscription/custom_account")
|
||||||
|
|
||||||
|
describe "userCustomSubscriptionPage", ->
|
||||||
|
beforeEach (done) ->
|
||||||
|
@res.callback = done
|
||||||
|
@LimitationsManager.userHasSubscriptionOrIsGroupMember.callsArgWith(1, null, true)
|
||||||
|
@SubscriptionController.userCustomSubscriptionPage @req, @res
|
||||||
|
|
||||||
|
it "should render the page", (done)->
|
||||||
|
@res.rendered.should.equal true
|
||||||
|
@res.renderedTemplate.should.equal "subscriptions/custom_account"
|
||||||
|
done()
|
||||||
|
|
||||||
|
|
||||||
describe "createSubscription", ->
|
describe "createSubscription", ->
|
||||||
|
|
Loading…
Reference in a new issue