This commit is contained in:
Kenneth Jao 2016-08-12 17:35:38 -04:00
commit 06ee977072
2 changed files with 31 additions and 1 deletions

View File

@ -104,8 +104,9 @@ Template.main.helpers({
}
},
calendarOptions() {
var cursor = work.find({});
var events = [];
userclasses = Meteor.user().profile.classes;
var cursor = work.find({class: {$in: userclasses}});
cursor.forEach(function(current) {
backgroundColor = calendarColors[current.type];
title = current.name;

29
hourglass/lib/router.js Normal file
View File

@ -0,0 +1,29 @@
Router.route('/', function() {
if (!Meteor.userId()) {
this.redirect('/login');
} else {
this.render("main");
}
});
Router.route('/login', function() {
if (!Meteor.userId()) {
this.render("login");
} else if (Object.keys(Meteor.user().profile).length <= 1) {
this.redirect('/profile');
} else {
this.redirect('/');
}
});
Router.route('/profile', function() {
if (!Meteor.userId()) {
this.redirect("/login");
} else {
this.render("profile");
}
});
Router.configure({
notFoundTemplate: "NotFound"
});