2014-02-12 10:23:40 +00:00
|
|
|
logger = require('logger-sharelatex')
|
|
|
|
ReferalHandler = require('./ReferalHandler')
|
2016-09-05 14:58:31 +00:00
|
|
|
AuthenticationController = require('../Authentication/AuthenticationController')
|
2014-02-12 10:23:40 +00:00
|
|
|
|
2016-09-05 14:58:31 +00:00
|
|
|
module.exports =
|
2014-02-12 10:23:40 +00:00
|
|
|
bonus: (req, res)->
|
2016-09-05 14:58:31 +00:00
|
|
|
user_id = AuthenticationController.getLoggedInUserId(req)
|
|
|
|
ReferalHandler.getReferedUserIds user_id, (err, refered_users)->
|
2014-02-12 10:23:40 +00:00
|
|
|
res.render "referal/bonus",
|
2014-08-01 12:47:14 +00:00
|
|
|
title: "bonus_please_recommend_us"
|
2014-02-12 10:23:40 +00:00
|
|
|
refered_users: refered_users
|
|
|
|
refered_user_count: (refered_users or []).length
|