2015-09-25 13:11:11 -04:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
|
|
var user = require('../../user'),
|
|
|
|
|
helpers = require('../helpers');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var notificationsController = {};
|
|
|
|
|
|
2016-10-13 11:43:39 +02:00
|
|
|
notificationsController.get = function (req, res, next) {
|
|
|
|
|
user.notifications.getAll(req.uid, 0, 39, function (err, notifications) {
|
2015-09-25 13:11:11 -04:00
|
|
|
if (err) {
|
|
|
|
|
return next(err);
|
|
|
|
|
}
|
|
|
|
|
res.render('notifications', {
|
|
|
|
|
notifications: notifications,
|
2015-10-19 12:48:26 -04:00
|
|
|
nextStart: 40,
|
2015-09-25 13:11:11 -04:00
|
|
|
title: '[[pages:notifications]]',
|
|
|
|
|
breadcrumbs: helpers.buildBreadcrumbs([{text: '[[pages:notifications]]'}])
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
module.exports = notificationsController;
|