diff --git a/hourglass/client/main/main.css b/hourglass/client/main/main.css index 8bb506a..470a3e2 100644 --- a/hourglass/client/main/main.css +++ b/hourglass/client/main/main.css @@ -1079,8 +1079,8 @@ input, textarea { #markDone p, #markConfirm p, #markReport p { margin: 0; display: inline; -} +} #markDone, #markConfirm, #markReport { padding: 5%; background-color: rgba(0,0,0,0.1); @@ -1160,7 +1160,7 @@ input, textarea { } #userDropdownAvatar p { - width: 9vh; + width: 15vw; margin: 0 auto 0 auto; padding-top: 12vh; text-align: center; diff --git a/hourglass/lib/router.js b/hourglass/lib/router.js index 4c6e2b2..8039b40 100644 --- a/hourglass/lib/router.js +++ b/hourglass/lib/router.js @@ -47,7 +47,6 @@ Router.route('/profile', { }); Router.route('/user/:email', { - template: 'user', data: function() { return Meteor.users.findOne({'services.google.email': this.params.email}); }, @@ -55,9 +54,31 @@ Router.route('/user/:email', { return [ Meteor.subscribe('users', this.params._id) ]; + }, + action: function() { + if(Meteor.users.findOne({'services.google.email': this.params.email}) !== undefined) { + if(this.params.email === Meteor.user().services.google.email) { + this.redirect('/profile'); + } else { + this.render('user'); + } + } else { + this.render("NotFound"); + } } }); +/*Router.route('/admin', { + action: function() { + console.log("hi"); + if (!Roles.userIsInRole(Meteor.userId(), ['admin', 'superadmin'])) { + this.redirect("/"); + } else { + this.render("admin"); + } + } +});*/ + Router.configure({ notFoundTemplate: "NotFound" });