This commit is contained in:
Yaman Qalieh 2016-09-03 21:36:46 -04:00
commit ae1c9ea1d1
4 changed files with 7 additions and 6 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";
@ -147,8 +147,7 @@ Template.profile.helpers({
classHolderHeight() { // Dimensions the container for the classes classHolderHeight() { // Dimensions the container for the classes
return 0.26 * window.innerHeight.toString() + "px"; return 0.26 * window.innerHeight.toString() + "px";
}, },
profClassTabColor(status) { // Change this [Supposed to show the current mode that's selected via color] profClassTabColor(status) { // Change this [Supposed to show the current mode that's selected via color]    
     
if (Session.equals("profClassTab",status)) {             if (Session.equals("profClassTab",status)) {            
return themeColors[Meteor.user().profile.preferences.theme].highlightText;         return themeColors[Meteor.user().profile.preferences.theme].highlightText;        
} else {             } else {            
@ -156,7 +155,7 @@ Template.profile.helpers({
}     }    
}, },
profClassTab(tab) { // Tells current class profClassTab(tab) { // Tells current class
if (Session.get("profClassTab",tab)) { if (Session.equals("profClassTab",tab)) {
return true; return true;
} else { } else {
return false; return false;

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) {
@ -79,7 +79,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({