3 var renderChat = require('./chat-internal');
4 var orgRenderer = require('./org');
6 function renderView(req, res, next, options) {
7 var uriContext = options.uriContext;
8 var troupe = uriContext.troupe;
9 var group = uriContext.group;
13 return renderChat(req, res, next, {
14 uriContext: uriContext,
15 template: 'chat-template',
19 // We're doing this so we correctly redirect a logged out
20 // user to the right chat post login
21 var url = req.originalUrl;
22 req.session.returnTo = url.replace(/\/~\w+(\?.*)?$/, '');
24 return renderChat(req, res, next, {
25 uriContext: uriContext,
26 template: 'chat-nli-template',
27 script: 'router-nli-chat'
33 return orgRenderer.renderOrgPage(req, res, next);
38 renderView: renderView