mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 06:03:45 +01:00
added custom user dashboard page
This commit is contained in:
@@ -89,6 +89,14 @@ module.exports = SubscriptionController =
|
||||
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) ->
|
||||
SecurityManager.getCurrentUser req, (error, user) ->
|
||||
return next(error) if error?
|
||||
|
||||
@@ -10,6 +10,9 @@ module.exports =
|
||||
app.get '/user/subscription/plans', SubscriptionController.plansPage
|
||||
|
||||
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/billing-details/edit', AuthenticationController.requireLogin(), SubscriptionController.editBillingDetailsPage
|
||||
|
||||
@@ -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", ->
|
||||
@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", ->
|
||||
|
||||
Reference in New Issue
Block a user