Merge pull request #1 from ksjdragon/master
Testing this new branch setup
This commit is contained in:
commit
7a3c536a27
@ -123,7 +123,7 @@ p.text {
|
|||||||
bottom: 0;
|
bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.login-button {
|
.login-buttons {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -164,6 +164,7 @@ Template.registerHelper('pref', (val) => { // Obtains all user preferences.
|
|||||||
|
|
||||||
Template.main.helpers({
|
Template.main.helpers({
|
||||||
schoolName() { // Finds the name of the user's school.
|
schoolName() { // Finds the name of the user's school.
|
||||||
|
if(Meteor.user().profile.school === undefined) return;
|
||||||
return " - " + Meteor.user().profile.school;
|
return " - " + Meteor.user().profile.school;
|
||||||
},
|
},
|
||||||
iconColor(icon) { // Sidebar status color
|
iconColor(icon) { // Sidebar status color
|
||||||
@ -279,6 +280,7 @@ Template.main.helpers({
|
|||||||
if(jsEvent.target.className.includes("fc-past")) return;
|
if(jsEvent.target.className.includes("fc-past")) return;
|
||||||
calCreWork = true;
|
calCreWork = true;
|
||||||
calWorkDate = date.format();
|
calWorkDate = date.format();
|
||||||
|
Session.set("newWork", true);
|
||||||
Session.set("sidebar","menuContainer");
|
Session.set("sidebar","menuContainer");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -782,7 +784,7 @@ function closeDivFade(div) {
|
|||||||
|
|
||||||
function sendData(funcName) { // Call Meteor function, and do actions after function is completed depending on function.
|
function sendData(funcName) { // Call Meteor function, and do actions after function is completed depending on function.
|
||||||
Meteor.call(funcName, serverData , function(err,result) {
|
Meteor.call(funcName, serverData , function(err,result) {
|
||||||
if((funcName === "editWork" || funcName === "createWork") && Session.get("mode") === "calendar") {
|
if((funcName === "editWork" || funcName === "createWork" || funcName === "deleteWork") && Session.get("mode") === "calendar") {
|
||||||
$("#fullcalendar").fullCalendar( 'refetchEvents' );
|
$("#fullcalendar").fullCalendar( 'refetchEvents' );
|
||||||
} else if(funcName === "toggleWork") {
|
} else if(funcName === "toggleWork") {
|
||||||
var workId = Session.get("currentWork")._id;
|
var workId = Session.get("currentWork")._id;
|
||||||
|
|||||||
@ -420,7 +420,7 @@
|
|||||||
|
|
||||||
#mainpage, #logout2 {
|
#mainpage, #logout2 {
|
||||||
font-size: 90%;
|
font-size: 90%;
|
||||||
padding: 0;
|
padding: 0.3%;
|
||||||
background-color: #617C9E;
|
background-color: #617C9E;
|
||||||
|
|
||||||
box-shadow: -1px 2px 5px 1px #333;
|
box-shadow: -1px 2px 5px 1px #333;
|
||||||
@ -441,7 +441,8 @@
|
|||||||
top: 0;
|
top: 0;
|
||||||
left: 85%;
|
left: 85%;
|
||||||
}
|
}
|
||||||
#mainpage:active,#logout2:active {
|
|
||||||
|
#mainpage:active, #logout2:active {
|
||||||
background-color: #56708D;
|
background-color: #56708D;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -20,7 +20,7 @@ Router.route('/', {
|
|||||||
Router.route('/login', function() {
|
Router.route('/login', function() {
|
||||||
if (!Meteor.userId()) {
|
if (!Meteor.userId()) {
|
||||||
this.render("login");
|
this.render("login");
|
||||||
} else if (Object.keys(Meteor.user().profile).length <= 1) {
|
} else if (!Meteor.user().profile.school) {
|
||||||
this.redirect('/profile');
|
this.redirect('/profile');
|
||||||
} else {
|
} else {
|
||||||
this.redirect('/');
|
this.redirect('/');
|
||||||
|
|||||||
@ -7,7 +7,6 @@ import {
|
|||||||
} from 'meteor/mongo';
|
} from 'meteor/mongo';
|
||||||
|
|
||||||
// Defines who the admins are - not added
|
// Defines who the admins are - not added
|
||||||
|
|
||||||
var superadmins = [
|
var superadmins = [
|
||||||
"ybq987@gmail.com",
|
"ybq987@gmail.com",
|
||||||
"ksjdragon@gmail.com",
|
"ksjdragon@gmail.com",
|
||||||
@ -40,14 +39,14 @@ Meteor.publish('classes', function() {
|
|||||||
return classes.find();
|
return classes.find();
|
||||||
} else {
|
} else {
|
||||||
// Return user classes and all _public_ classes.
|
// Return user classes and all _public_ classes.
|
||||||
var userprofile = Meteor.users.findOne(this.userId).profile;
|
var userprofile = Meteor.users.findOne(this.userId);
|
||||||
if (userprofile !== undefined && userprofile.classes !== undefined) {
|
if (userprofile !== undefined && userprofile.profile.classes !== undefined) {
|
||||||
return classes.find({
|
return classes.find({
|
||||||
$or: [{
|
$or: [{
|
||||||
privacy: false
|
privacy: false
|
||||||
}, {
|
}, {
|
||||||
_id: {
|
_id: {
|
||||||
$in: userprofile.classes
|
$in: userprofile.profile.classes
|
||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
}, {
|
}, {
|
||||||
@ -67,11 +66,8 @@ Meteor.publish('classes', function() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
var empty;
|
Meteor.call('createProfile', this.userId);
|
||||||
Meteor.call('createProfile', this.userId, function(error, result) {
|
return classes.find({_id: null});
|
||||||
empty = result;
|
|
||||||
});
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -82,20 +78,17 @@ 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 {
|
||||||
var userprofile = Meteor.users.findOne(this.userId).profile;
|
var userprofile = Meteor.users.findOne(this.userId);
|
||||||
if (userprofile !== undefined && userprofile.classes !== undefined) {
|
if (userprofile !== undefined && userprofile.profile.classes !== undefined) {
|
||||||
return work.find({
|
return work.find({
|
||||||
// Only return work of enrolled classes
|
// Only return work of enrolled classes
|
||||||
class: {
|
class: {
|
||||||
$in: userprofile.classes
|
$in: userprofile.profile.classes
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
var empty;
|
Meteor.call('createProfile', this.userId);
|
||||||
Meteor.call('createProfile', this.userId, function(error, result) {
|
return classes.find({_id: null});
|
||||||
empty = result;
|
|
||||||
});
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -518,9 +511,6 @@ Meteor.methods({
|
|||||||
profile: current
|
profile: current
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return classes.find({
|
|
||||||
_id: null
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
'joinClass': function(input) {
|
'joinClass': function(input) {
|
||||||
var change = input[0];
|
var change = input[0];
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user