This commit is contained in:
Kenneth Jao 2016-09-20 09:47:18 -04:00
commit 6f1c7203ff
81 changed files with 42 additions and 21 deletions

View File

@ -1267,7 +1267,6 @@ input, textarea {
height: 9vh;
margin: -6.5vh 0 0 -5.25vh;
border: 0.5vh solid #0D0D0D;
-moz-border-radius: 50%;
-webkit-border-radius: 50%;
border-radius: 50%;

View File

@ -36,7 +36,7 @@
<h3>Filters</h3>
{{#each types}}
{{> sideTypeFilter}}
{{/each}}
{{/each}}
</div>
<div id="classListHolder">
<h3>By Class </h3>
@ -49,7 +49,7 @@
{{/if}}
<div id="sideClassWrapper">
{{#each myClasses}}
{{> sidebarClasses}}
{{> sidebarClasses}}
{{/each}}
</div>
</div>
@ -358,4 +358,4 @@
{{/if}}
</div>
</div>
</template>
</template>

View File

@ -61,13 +61,14 @@ Session.set("classDispHover", null); // Stores current hovered class filter.
Session.set("refetchEvents", null); // Stores whether to get calendar events again.
Session.set("commentRestrict", ""); // Stores text for comment character restriction.
Template.login.rendered = function() {
Accounts._loginButtonsSession.set('dropdownVisible', true);
};
Template.main.rendered = function() {
Accounts._loginButtonsSession.set('dropdownVisible', true);
dragula([document.querySelector('#classesMode'), document.querySelector('#nonexistant')]);
setTimeout(startDragula, 300);
};
Template.profile.rendered = function() {
@ -164,7 +165,7 @@ Template.registerHelper('myClasses', () => { // Gets all classes and respective
}
if (thisWork[j] !== "no" && sideFilter.length !== 0 && !_.contains(sideFilter, thisWork[j].type)) {
thisWork[j] = "no"
thisWork[j] = "no";
}
if(thisWork[j] !== "no" && Session.get("user").preferences.hideReport && (thisWork[j].confirmations.length/thisWork[j].reports.length) <= 0.9) {
@ -206,10 +207,10 @@ Template.registerHelper('myClasses', () => { // Gets all classes and respective
thisWork[j].doneRatio = normalColor;
} else {
thisWork[j].doneRatio = "#F9F906";
}
}
} else if (ratio >= 2) {
thisWork[j].doneRatio = "#33DD33";
} else if (ratio <= .9) {
} else if (ratio <= 0.9) {
thisWork[j].doneRatio = "#FF1A1A";
}
}
@ -237,6 +238,26 @@ Template.registerHelper('commentLength', () => { // Returns characters left for
return Session.get("commentRestrict");
});
function startDragula() {
dragula([document.querySelector('#classesMode'), document.querySelector('#nonexistant')],
{
moves: function(el, container, handle) {
// return handle.classList.contains("classInfo") || handle.classList.contains("mainClassName");
return _.intersection(["classInfo", "mainClassName", "mainClassHour", "mainClassTeacher"], handle.classList).length > 0;
}
})
.on('out', function(el) {
var els = document.getElementsByClassName("classWrapper");
var final = [];
for(var i = 0; i < els.length; i++) {
var classid = els[i].getElementsByClassName("creWork")[0].getAttribute("classid");
final.push(classid);
}
Meteor.call("reorderClasses", final);
});
console.log("Started!");
}
Template.main.helpers({
schoolName() { // Finds the name of the user's school.
if(Session.get("user").school === undefined) return;
@ -252,7 +273,7 @@ Template.main.helpers({
}
},
avatar() { // Returns avatar.
return Session.get("user").avatar;
return Meteor.user().services.google.picture;
},
username() { // Returns user name.
return Session.get("user").name;
@ -548,6 +569,7 @@ Template.main.events({
Session.set("mode", "classes");
openDivFade(modeHolder);
}, 300);
setTimeout(startDragula, 500);
Session.set("sidebar", null); // Closes all sidebars.
Session.set("calCreWork", null);
},
@ -1036,7 +1058,7 @@ function formReadable(input, val) { // Makes work information readable by users.
});
resort[re].user = user.profile.name;
resort[re].date = moment(comments[k].date).fromNow();
resort[re].avatar = user.profile.avatar;
resort[re].avatar = user.services.google.picture;
resort[re].email = user.services.google.email;
}
return resort;
@ -1049,7 +1071,7 @@ function formReadable(input, val) { // Makes work information readable by users.
input.done[i] = {
"user": user.profile.name,
"avatar": user.profile.avatar,
"avatar": user.services.google.picture,
"email": user.services.google.email
};
}
@ -1079,7 +1101,7 @@ function formReadable(input, val) { // Makes work information readable by users.
case "avatar":
return Meteor.users.findOne({
_id: input.creator
}).profile.avatar;
}).services.google.picture;
case "creator":
return Meteor.users.findOne({
_id: input.creator

View File

@ -70,7 +70,7 @@ Template.profile.helpers({
return Session.get("user").banner;
},
avatar() { // Returns avatar
return Session.get("user").avatar;
return Meteor.user().services.google.picture;
},
username() { //Returns current user's username
return Session.get("user").name;

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@ -28,7 +28,9 @@ for (var i = 0; i < superadmins.length; i++) {
});
if (superadmin !== undefined && !(Roles.userIsInRole(superadmin._id, 'superadmin'))) {
Roles.addUsersToRoles(superadmin._id, 'superadmin');
Houston._admins.insert({user_id: superadmin._id});
Houston._admins.insert({
user_id: superadmin._id
});
}
}
@ -125,7 +127,6 @@ Meteor.publish('users', function() {
// Only return necessary fields
fields: {
'services.google.email': 1,
'profile.avatar': 1,
'profile.banner': 1,
'profile.grade': 1,
'profile.description': 1,
@ -360,7 +361,7 @@ Meteor.methods({
$set: change
});
} else if ((currentwork.class === Meteor.userId() ||
_.contains(currentclass.moderators.concat(currentclass.admin), Meteor.userId()) ||
_.contains(currentclass.moderators.concat(currentclass.admin), Meteor.userId()) ||
Meteor.userId() === currentwork.creator) &&
change.name.length <= 50 && change.description.length <= 150 &&
change.dueDate instanceof Date && change.dueDate.getTime() >= ref &&
@ -391,8 +392,8 @@ Meteor.methods({
var user = Meteor.userId();
if (typeof comment === "string" && comment.length <= 200 &&
(workobject.class === Meteor.userId() ||
(_.contains(currentclass.subscribers, Meteor.userId()) &&
!_.contains(currentclass.banned, Meteor.userId())))) {
(_.contains(currentclass.subscribers, Meteor.userId()) &&
!_.contains(currentclass.banned, Meteor.userId())))) {
var commentInfo = {
"comment": input[0],
"user": user,
@ -468,7 +469,6 @@ Meteor.methods({
"grade": change.grade,
"classes": current.classes,
"description": change.description,
"avatar": change.avatar,
"banner": change.banner,
"preferences": change.preferences,
"name": current.name
@ -486,7 +486,8 @@ Meteor.methods({
},
'reorderClasses': function(newOrder) {
var current = Meteor.user().profile;
if(newOrder.every(elem => _.contains(current.classes, elem))) {
if (newOrder.every(elem => _.contains(current.classes, elem)) &&
newOrder.length === current.classes.length) {
current.classes = newOrder;
Meteor.users.update({
_id: Meteor.userId()
@ -504,7 +505,6 @@ Meteor.methods({
_id: userId
}).profile;
current.banner = "/Banners/defaultcover.jpg";
current.avatar = "/Avatars/" + (Math.floor(Math.random() * 10) + 1).toString() + ".png";
current.classes = [userId];
current.preferences = {
"theme": "light",