Minor bugs, fixed #75

This commit is contained in:
Kenneth Jao 2016-09-03 02:02:09 -04:00
parent 9df47a896a
commit cbb8f22f50
4 changed files with 5 additions and 3 deletions

View File

@ -129,6 +129,7 @@ p.text {
#github { #github {
font-size: 150%; font-size: 150%;
color: #000 !important;
margin: 0; margin: 0;
padding: 1%; padding: 1%;

View File

@ -157,6 +157,7 @@ Template.registerHelper('myClasses', () => { // Gets all classes and respective
}); });
Template.registerHelper('pref', (val) => { // Obtains all user preferences. Template.registerHelper('pref', (val) => { // Obtains all user preferences.
if(Meteor.user() === null) return;
var preferences = Meteor.user().profile.preferences; var preferences = Meteor.user().profile.preferences;
if(val === 'timeHide' || val === 'done') { if(val === 'timeHide' || val === 'done') {
var invert = _.invert(ref); var invert = _.invert(ref);

View File

@ -68,7 +68,7 @@ Template.profile.helpers({
banner() { // Styles the banner banner() { // Styles the banner
var width = window.innerWidth * 1600 / 1920; var width = window.innerWidth * 1600 / 1920;
var height = width * 615 / 1600; var height = width * 615 / 1600;
if (Meteor.user().profile.banner !== undefined) { if (Meteor.user().profile.banner !== undefined || Meteor.user().profile.banner !== null) {
var banner = Meteor.user().profile.banner; var banner = Meteor.user().profile.banner;
} else { } else {
var banner = "Banners/defaultcover.jpg"; var banner = "Banners/defaultcover.jpg";

View File

@ -37,7 +37,7 @@ Meteor.publish('schools', function() {
Meteor.publish('classes', function() { Meteor.publish('classes', function() {
if (Roles.userIsInRole(this.userId, ['superadmin', 'admin'])) { if (Roles.userIsInRole(this.userId, ['superadmin', 'admin'])) {
return classes.find(); return classes.find();
} else { } else if(this.userId !== null) {
// Return user classes and all _public_ classes. // Return user classes and all _public_ classes.
var userprofile = Meteor.users.findOne(this.userId); var userprofile = Meteor.users.findOne(this.userId);
if (userprofile !== undefined && userprofile.profile.classes !== undefined) { if (userprofile !== undefined && userprofile.profile.classes !== undefined) {
@ -77,7 +77,7 @@ Meteor.publish('classes', function() {
Meteor.publish('work', function() { Meteor.publish('work', function() {
if (Roles.userIsInRole(this.userId, ['superadmin', 'admin'])) { if (Roles.userIsInRole(this.userId, ['superadmin', 'admin'])) {
return work.find(); return work.find();
} else { } else if(this.userId !== null) {
var userprofile = Meteor.users.findOne(this.userId); var userprofile = Meteor.users.findOne(this.userId);
if (userprofile !== undefined && userprofile.profile.classes !== undefined) { if (userprofile !== undefined && userprofile.profile.classes !== undefined) {
return work.find({ return work.find({