This commit is contained in:
Yaman Qalieh 2016-08-12 19:11:07 -04:00
commit 3f984fca63
4 changed files with 16 additions and 15 deletions

View File

@ -31,7 +31,7 @@
</div>
<div id="classListHolder">
<h3>Enrolled</h3>
{{#each myclasses}}
{{#each myClasses}}
{{> sidebarClasses}}
{{/each}}
</div>

View File

@ -55,6 +55,19 @@ Template.registerHelper('overlayDim', (part) => {
return width + height + margin + bg;
});
Template.registerHelper('myClasses', () => {
if (Meteor.user().profile.classes === undefined || Meteor.user().profile.classes.length === 0) {
return [];
} else {
var array = [];
var courses = Meteor.user().profile.classes;
for(var i = 0; i < courses.length; i++) {
array.push(classes.findOne({_id:courses[i]}));
}
return array;
}
})
Template.main.helpers({
schoolName() {
Session.set("calendarclasses", Meteor.user().profile.classes);
@ -71,7 +84,7 @@ Template.main.helpers({
},
bgSrc() {
var dim = [window.innerWidth, window.innerHeight];
var pic = themeColors[Cookie.get("theme")].background;
var pic = "Backgrounds/"+themeColors[Cookie.get("theme")].background;
return pic;
},
menuStatus() {
@ -139,18 +152,6 @@ Template.main.helpers({
var width = window.innerWidth * 0.865;
var height = window.innerHeight * 0.76;
return "width:" + width.toString() + "px;height:" + height.toString() + "px;margin-left:" + (0.5 * window.innerWidth - 0.5 * width).toString() + "px;margin-top:" + (0.47 * window.innerHeight - 0.5 * height).toString() + "px";
},
myclasses() {
if (Meteor.user().profile.classes === undefined || Meteor.user().profile.classes.length === 0) {
return [];
} else {
var array = [];
var courses = Meteor.user().profile.classes;
for(var i = 0; i < courses.length; i++) {
array.push(classes.findOne({_id:courses[i]}));
}
return array;
}
}
});

View File

@ -56,7 +56,7 @@
<span class="subscriptions classText">Members</span>
</div>
<div class="classHolder" style="max-height:{{classHolderHeight}}">
{{#each myclasses}}
{{#each myClasses}}
{{> classDisplay}}
{{/each}}
</div>

Binary file not shown.

After

Width:  |  Height:  |  Size: 312 KiB