Vulcan/client/main.js

60 lines
1.2 KiB
JavaScript
Raw Normal View History

// Session variables
2012-12-11 10:47:11 +09:00
Session.set('initialLoad', true);
2013-10-12 12:24:41 +09:00
Session.set('today', new Date());
2013-10-12 13:01:16 +09:00
Session.set('view', 'top');
2013-11-16 17:44:33 +09:00
Session.set('postsLimit', getSetting('postsPerPage', 10));
Session.set('sessionId', Meteor.default_connection._lastSessionId);
2012-12-11 10:47:11 +09:00
2014-02-18 14:46:53 +09:00
STATUS_PENDING=1;
STATUS_APPROVED=2;
STATUS_REJECTED=3;
2014-06-23 11:40:21 +09:00
navItems.push('adminMenu');
viewNav = viewNav.concat([
{
route: 'posts_top',
label: 'Top'
},
{
route: 'posts_new',
label: 'New'
},
{
route: 'posts_best',
label: 'Best'
},
{
route: 'posts_digest',
label: 'Digest'
}
]);
2012-11-17 13:24:19 +09:00
adminNav = adminNav.concat([
{
route: 'posts_pending',
label: 'Pending'
},
{
route: 'all-users',
label: 'Users'
},
{
route: 'settings',
label: 'Settings'
},
{
route: 'toolbox',
label: 'Toolbox'
}
]);
// Notifications - only load if user is logged in
// Not mandatory, because server won't publish anything even if we try to load.
// Remember about Deps.autorun - user can log in and log out several times
Deps.autorun(function() {
// userId() can be changed before user(), because loading profile takes time
if(Meteor.userId()) {
Meteor.subscribe('notifications');
}
2014-02-18 14:46:53 +09:00
});