Merge branch 'master' of https://github.com/ksjdragon/hourglass
This commit is contained in:
commit
06ee977072
@ -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
29
hourglass/lib/router.js
Normal 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"
|
||||
});
|
||||
Loading…
x
Reference in New Issue
Block a user