Fixed adding work bug
This commit is contained in:
parent
15f1ba4085
commit
6cac521b59
@ -78,13 +78,14 @@ Template.registerHelper('myClasses', () => {
|
|||||||
array[i].thisClassWork = thisWork;
|
array[i].thisClassWork = thisWork;
|
||||||
}
|
}
|
||||||
Session.set("noclass",false);
|
Session.set("noclass",false);
|
||||||
|
console.log(array);
|
||||||
return array;
|
return array;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Template.main.helpers({
|
Template.main.helpers({
|
||||||
schoolName() {
|
schoolName() {
|
||||||
Session.set("calendarclasses", Meteor.user().profile.classes);
|
Session.set("calendarclasses", Meteor.user().profile.classes);
|
||||||
return " - " + Meteor.user().profile.school;
|
return " - " + Meteor.user().profile.school;
|
||||||
},
|
},
|
||||||
iconColor(icon) {
|
iconColor(icon) {
|
||||||
@ -136,7 +137,7 @@ Template.main.helpers({
|
|||||||
calendarOptions() {
|
calendarOptions() {
|
||||||
var events = [];
|
var events = [];
|
||||||
calendarclasses = Session.get("calendarclasses");
|
calendarclasses = Session.get("calendarclasses");
|
||||||
var cursor = work.find({class: {$in: userclasses}});
|
var cursor = work.find({class: {$in: calendarclasses}});
|
||||||
cursor.forEach(function(current) {
|
cursor.forEach(function(current) {
|
||||||
backgroundColor = calendarColors[current.type];
|
backgroundColor = calendarColors[current.type];
|
||||||
title = current.name;
|
title = current.name;
|
||||||
@ -304,12 +305,14 @@ Template.main.events({
|
|||||||
openDivFade(document.getElementsByClassName("overlay")[0]);
|
openDivFade(document.getElementsByClassName("overlay")[0]);
|
||||||
},
|
},
|
||||||
'click .change' (event) {
|
'click .change' (event) {
|
||||||
if(!(Meteor.userId() === Session.get("currentWork").creator ||
|
if(!Session.get("newWork")) {
|
||||||
Roles.userIsInRole(Meteor.userId(), ['superadmin', 'admin']) ||
|
if(!(Meteor.userId() === Session.get("currentWork").creator ||
|
||||||
classes.findOne({_id: Session.get("currentWork")._id}).moderators.indexOf(Meteor.userId()) !== -1 ||
|
Roles.userIsInRole(Meteor.userId(), ['superadmin', 'admin']) ||
|
||||||
classes.findOne({_id: Session.get("currentWork")._id}).blockEdit.indexOf(Meteor.userId()) !== -1 ||
|
classes.findOne({_id: Session.get("currentWork")._id}).moderators.indexOf(Meteor.userId()) !== -1 ||
|
||||||
classes.findOne({_id: Session.get("currentWork")._id}).banned.indexOf(Meteor.userId()) !== -1
|
classes.findOne({_id: Session.get("currentWork")._id}).blockEdit.indexOf(Meteor.userId()) !== -1 ||
|
||||||
)) return;
|
classes.findOne({_id: Session.get("currentWork")._id}).banned.indexOf(Meteor.userId()) !== -1
|
||||||
|
)) return;
|
||||||
|
}
|
||||||
|
|
||||||
var ele = event.target;
|
var ele = event.target;
|
||||||
var sessval = Session.get("modifying");
|
var sessval = Session.get("modifying");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user