From a59371a8faef32e06a0e1dfb7964dad34d67df48 Mon Sep 17 00:00:00 2001 From: ksjdragon Date: Sun, 18 Jan 2015 19:23:54 -0500 Subject: [PATCH] special users redirect --- chromebook-checkout-meteor/client/checkout.html | 2 -- chromebook-checkout-meteor/client/chromebook.css | 11 ----------- chromebook-checkout-meteor/client/router.js | 10 ++++++---- 3 files changed, 6 insertions(+), 17 deletions(-) diff --git a/chromebook-checkout-meteor/client/checkout.html b/chromebook-checkout-meteor/client/checkout.html index 72c4a1a..49d3427 100644 --- a/chromebook-checkout-meteor/client/checkout.html +++ b/chromebook-checkout-meteor/client/checkout.html @@ -12,7 +12,5 @@ {{/each}} - - \ No newline at end of file diff --git a/chromebook-checkout-meteor/client/chromebook.css b/chromebook-checkout-meteor/client/chromebook.css index 5074619..84a0299 100644 --- a/chromebook-checkout-meteor/client/chromebook.css +++ b/chromebook-checkout-meteor/client/chromebook.css @@ -25,7 +25,6 @@ body { outline: #25abd9 solid 3px; } - .timestamp { color: #6D6E6D; float: right; @@ -39,16 +38,6 @@ body { transition: color 0.5s; } -.edit, .teacher { - color: #C4C4C4; - transition: color 0.5s; -} - - -.edit:hover, .teacher:hover { - color: #25abd9; -} - .cross:hover, .crossc:hover{ color: #E14C2B; } diff --git a/chromebook-checkout-meteor/client/router.js b/chromebook-checkout-meteor/client/router.js index bae15ce..20910f5 100644 --- a/chromebook-checkout-meteor/client/router.js +++ b/chromebook-checkout-meteor/client/router.js @@ -11,12 +11,14 @@ Router.route('/checkout', function() { }); Router.route('/login', function() { - if (Meteor.user()) { - this.redirect('/checkout'); + if (Roles.userIsInRole(Meteor.userId(), ['teacher'])) { + this.redirect('/teacher'); } else if (Roles.userIsInRole(Meteor.userId(), ['admin'])) { this.redirect('/admin'); - } else if (Roles.userIsInRole(Meteor.userId(), ['teacher'])) { - this.redirect('/teacher'); + } else if (Roles.userIsInRole(Meteor.userId(), ['admin', 'teacher'])) { + this.redirect('/admin'); + } else if (Meteor.user()) { + this.redirect('/checkout'); } else { this.render("login"); }