Fixed the helper errors that appeared, fixed #3
This commit is contained in:
parent
09e29aea96
commit
6fc1ec14c9
@ -4,11 +4,6 @@ import {
|
||||
|
||||
import './main.html';
|
||||
|
||||
Meteor.subscribe('schools');
|
||||
Meteor.subscribe('classes');
|
||||
Meteor.subscribe('work');
|
||||
Meteor.subscribe('users');
|
||||
|
||||
var openValues = {
|
||||
"menu": "-25%",
|
||||
"options": "-20%"
|
||||
@ -178,9 +173,11 @@ Template.main.helpers({
|
||||
return "width:"+w.toString()+"px;height:"+h.toString()+"px;margin-left:"+-0.5*w.toString()+"px;margin-top:"+-0.5*h.toString()+"px";
|
||||
},
|
||||
work(value) {
|
||||
if(Session.get("currentWork") === null) return;
|
||||
return Session.get("currentReadableWork")[value];
|
||||
},
|
||||
workType() {
|
||||
if(Session.get("currentWork") === null) return;
|
||||
type = Session.get("currentWork").type;
|
||||
if(type.includes("edit")) {
|
||||
return;
|
||||
|
||||
@ -195,6 +195,7 @@ Template.profile.helpers({
|
||||
return Session.get("confirmText");
|
||||
},
|
||||
selectedClass(val) {
|
||||
if(Session.get("selectedClass") === null) return;
|
||||
var usertype = ["moderators","banned"];
|
||||
var attribute = Session.get("selectClassId");
|
||||
var array = classes.findOne({_id:attribute});
|
||||
|
||||
@ -1,7 +1,17 @@
|
||||
Router.route('/', function() {
|
||||
if (!Meteor.userId()) {
|
||||
this.redirect('/login');
|
||||
} else {
|
||||
Router.route('/', {
|
||||
waitOn: function() {
|
||||
if (!Meteor.userId()) {
|
||||
this.redirect('/login');
|
||||
} else {
|
||||
return [
|
||||
Meteor.subscribe('classes',this.params._id),
|
||||
Meteor.subscribe('schools',this.params._id),
|
||||
Meteor.subscribe('work',this.params._id),
|
||||
Meteor.subscribe('users',this.params._id)
|
||||
];
|
||||
}
|
||||
},
|
||||
action: function() {
|
||||
this.render("main");
|
||||
}
|
||||
});
|
||||
@ -16,10 +26,20 @@ Router.route('/login', function() {
|
||||
}
|
||||
});
|
||||
|
||||
Router.route('/profile', function() {
|
||||
if (!Meteor.userId()) {
|
||||
this.redirect("/login");
|
||||
} else {
|
||||
Router.route('/profile', {
|
||||
waitOn: function() {
|
||||
if (!Meteor.userId()) {
|
||||
this.redirect('/login');
|
||||
} else {
|
||||
return [
|
||||
Meteor.subscribe('classes',this.params._id),
|
||||
Meteor.subscribe('schools',this.params._id),
|
||||
Meteor.subscribe('work',this.params._id),
|
||||
Meteor.subscribe('users',this.params._id)
|
||||
];
|
||||
}
|
||||
},
|
||||
action: function() {
|
||||
this.render("profile");
|
||||
}
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user