Merge branch 'master' of https://github.com/ksjdragon/hourglass
@ -1267,7 +1267,6 @@ input, textarea {
|
|||||||
height: 9vh;
|
height: 9vh;
|
||||||
margin: -6.5vh 0 0 -5.25vh;
|
margin: -6.5vh 0 0 -5.25vh;
|
||||||
|
|
||||||
border: 0.5vh solid #0D0D0D;
|
|
||||||
-moz-border-radius: 50%;
|
-moz-border-radius: 50%;
|
||||||
-webkit-border-radius: 50%;
|
-webkit-border-radius: 50%;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
|
|||||||
@ -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("refetchEvents", null); // Stores whether to get calendar events again.
|
||||||
Session.set("commentRestrict", ""); // Stores text for comment character restriction.
|
Session.set("commentRestrict", ""); // Stores text for comment character restriction.
|
||||||
|
|
||||||
|
|
||||||
Template.login.rendered = function() {
|
Template.login.rendered = function() {
|
||||||
Accounts._loginButtonsSession.set('dropdownVisible', true);
|
Accounts._loginButtonsSession.set('dropdownVisible', true);
|
||||||
};
|
};
|
||||||
|
|
||||||
Template.main.rendered = function() {
|
Template.main.rendered = function() {
|
||||||
Accounts._loginButtonsSession.set('dropdownVisible', true);
|
Accounts._loginButtonsSession.set('dropdownVisible', true);
|
||||||
dragula([document.querySelector('#classesMode'), document.querySelector('#nonexistant')]);
|
setTimeout(startDragula, 300);
|
||||||
};
|
};
|
||||||
|
|
||||||
Template.profile.rendered = function() {
|
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)) {
|
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) {
|
if(thisWork[j] !== "no" && Session.get("user").preferences.hideReport && (thisWork[j].confirmations.length/thisWork[j].reports.length) <= 0.9) {
|
||||||
@ -209,7 +210,7 @@ Template.registerHelper('myClasses', () => { // Gets all classes and respective
|
|||||||
}
|
}
|
||||||
} else if (ratio >= 2) {
|
} else if (ratio >= 2) {
|
||||||
thisWork[j].doneRatio = "#33DD33";
|
thisWork[j].doneRatio = "#33DD33";
|
||||||
} else if (ratio <= .9) {
|
} else if (ratio <= 0.9) {
|
||||||
thisWork[j].doneRatio = "#FF1A1A";
|
thisWork[j].doneRatio = "#FF1A1A";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -237,6 +238,26 @@ Template.registerHelper('commentLength', () => { // Returns characters left for
|
|||||||
return Session.get("commentRestrict");
|
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({
|
Template.main.helpers({
|
||||||
schoolName() { // Finds the name of the user's school.
|
schoolName() { // Finds the name of the user's school.
|
||||||
if(Session.get("user").school === undefined) return;
|
if(Session.get("user").school === undefined) return;
|
||||||
@ -252,7 +273,7 @@ Template.main.helpers({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
avatar() { // Returns avatar.
|
avatar() { // Returns avatar.
|
||||||
return Session.get("user").avatar;
|
return Meteor.user().services.google.picture;
|
||||||
},
|
},
|
||||||
username() { // Returns user name.
|
username() { // Returns user name.
|
||||||
return Session.get("user").name;
|
return Session.get("user").name;
|
||||||
@ -548,6 +569,7 @@ Template.main.events({
|
|||||||
Session.set("mode", "classes");
|
Session.set("mode", "classes");
|
||||||
openDivFade(modeHolder);
|
openDivFade(modeHolder);
|
||||||
}, 300);
|
}, 300);
|
||||||
|
setTimeout(startDragula, 500);
|
||||||
Session.set("sidebar", null); // Closes all sidebars.
|
Session.set("sidebar", null); // Closes all sidebars.
|
||||||
Session.set("calCreWork", null);
|
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].user = user.profile.name;
|
||||||
resort[re].date = moment(comments[k].date).fromNow();
|
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;
|
resort[re].email = user.services.google.email;
|
||||||
}
|
}
|
||||||
return resort;
|
return resort;
|
||||||
@ -1049,7 +1071,7 @@ function formReadable(input, val) { // Makes work information readable by users.
|
|||||||
|
|
||||||
input.done[i] = {
|
input.done[i] = {
|
||||||
"user": user.profile.name,
|
"user": user.profile.name,
|
||||||
"avatar": user.profile.avatar,
|
"avatar": user.services.google.picture,
|
||||||
"email": user.services.google.email
|
"email": user.services.google.email
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -1079,7 +1101,7 @@ function formReadable(input, val) { // Makes work information readable by users.
|
|||||||
case "avatar":
|
case "avatar":
|
||||||
return Meteor.users.findOne({
|
return Meteor.users.findOne({
|
||||||
_id: input.creator
|
_id: input.creator
|
||||||
}).profile.avatar;
|
}).services.google.picture;
|
||||||
case "creator":
|
case "creator":
|
||||||
return Meteor.users.findOne({
|
return Meteor.users.findOne({
|
||||||
_id: input.creator
|
_id: input.creator
|
||||||
|
|||||||
@ -70,7 +70,7 @@ Template.profile.helpers({
|
|||||||
return Session.get("user").banner;
|
return Session.get("user").banner;
|
||||||
},
|
},
|
||||||
avatar() { // Returns avatar
|
avatar() { // Returns avatar
|
||||||
return Session.get("user").avatar;
|
return Meteor.user().services.google.picture;
|
||||||
},
|
},
|
||||||
username() { //Returns current user's username
|
username() { //Returns current user's username
|
||||||
return Session.get("user").name;
|
return Session.get("user").name;
|
||||||
|
|||||||
BIN
hourglass/public/icons/license/license.pdf
Normal file
BIN
hourglass/public/icons/png/animal.png
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
hourglass/public/icons/png/avatar.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
hourglass/public/icons/png/book-1.png
Normal file
|
After Width: | Height: | Size: 5.2 KiB |
BIN
hourglass/public/icons/png/book-2.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
hourglass/public/icons/png/book-3.png
Normal file
|
After Width: | Height: | Size: 7.1 KiB |
BIN
hourglass/public/icons/png/book-4.png
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
BIN
hourglass/public/icons/png/book-5.png
Normal file
|
After Width: | Height: | Size: 8.4 KiB |
BIN
hourglass/public/icons/png/book-6.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
hourglass/public/icons/png/book-7.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
hourglass/public/icons/png/book-8.png
Normal file
|
After Width: | Height: | Size: 7.8 KiB |
BIN
hourglass/public/icons/png/book.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
hourglass/public/icons/png/chemistry.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
hourglass/public/icons/png/comedy-1.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
hourglass/public/icons/png/comedy.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
hourglass/public/icons/png/construction-1.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
hourglass/public/icons/png/construction.png
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
hourglass/public/icons/png/cup.png
Normal file
|
After Width: | Height: | Size: 9.0 KiB |
BIN
hourglass/public/icons/png/diploma-1.png
Normal file
|
After Width: | Height: | Size: 4.0 KiB |
BIN
hourglass/public/icons/png/diploma.png
Normal file
|
After Width: | Height: | Size: 4.1 KiB |
BIN
hourglass/public/icons/png/draw.png
Normal file
|
After Width: | Height: | Size: 6.7 KiB |
BIN
hourglass/public/icons/png/earth-1.png
Normal file
|
After Width: | Height: | Size: 8.7 KiB |
BIN
hourglass/public/icons/png/earth.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
hourglass/public/icons/png/education-1.png
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
hourglass/public/icons/png/education-2.png
Normal file
|
After Width: | Height: | Size: 4.0 KiB |
BIN
hourglass/public/icons/png/education.png
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
hourglass/public/icons/png/energy.png
Normal file
|
After Width: | Height: | Size: 5.1 KiB |
BIN
hourglass/public/icons/png/file.png
Normal file
|
After Width: | Height: | Size: 5.1 KiB |
BIN
hourglass/public/icons/png/fruit.png
Normal file
|
After Width: | Height: | Size: 6.5 KiB |
BIN
hourglass/public/icons/png/graduate.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
hourglass/public/icons/png/graduation.png
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
hourglass/public/icons/png/greek.png
Normal file
|
After Width: | Height: | Size: 7.1 KiB |
BIN
hourglass/public/icons/png/interface-1.png
Normal file
|
After Width: | Height: | Size: 5.2 KiB |
BIN
hourglass/public/icons/png/interface-2.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
hourglass/public/icons/png/interface.png
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
BIN
hourglass/public/icons/png/magnet.png
Normal file
|
After Width: | Height: | Size: 5.7 KiB |
BIN
hourglass/public/icons/png/mark.png
Normal file
|
After Width: | Height: | Size: 8.7 KiB |
BIN
hourglass/public/icons/png/medical-1.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
hourglass/public/icons/png/medical-2.png
Normal file
|
After Width: | Height: | Size: 5.5 KiB |
BIN
hourglass/public/icons/png/medical.png
Normal file
|
After Width: | Height: | Size: 6.3 KiB |
BIN
hourglass/public/icons/png/molecule.png
Normal file
|
After Width: | Height: | Size: 7.1 KiB |
BIN
hourglass/public/icons/png/monuments.png
Normal file
|
After Width: | Height: | Size: 6.7 KiB |
BIN
hourglass/public/icons/png/mouse.png
Normal file
|
After Width: | Height: | Size: 7.6 KiB |
BIN
hourglass/public/icons/png/people-1.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
hourglass/public/icons/png/people.png
Normal file
|
After Width: | Height: | Size: 8.4 KiB |
BIN
hourglass/public/icons/png/planet.png
Normal file
|
After Width: | Height: | Size: 8.6 KiB |
BIN
hourglass/public/icons/png/potion.png
Normal file
|
After Width: | Height: | Size: 8.2 KiB |
BIN
hourglass/public/icons/png/reading.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
hourglass/public/icons/png/research.png
Normal file
|
After Width: | Height: | Size: 7.9 KiB |
BIN
hourglass/public/icons/png/school.png
Normal file
|
After Width: | Height: | Size: 4.7 KiB |
BIN
hourglass/public/icons/png/science-1.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
hourglass/public/icons/png/science-10.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
hourglass/public/icons/png/science-2.png
Normal file
|
After Width: | Height: | Size: 9.7 KiB |
BIN
hourglass/public/icons/png/science-3.png
Normal file
|
After Width: | Height: | Size: 5.5 KiB |
BIN
hourglass/public/icons/png/science-4.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
hourglass/public/icons/png/science-5.png
Normal file
|
After Width: | Height: | Size: 9.6 KiB |
BIN
hourglass/public/icons/png/science-6.png
Normal file
|
After Width: | Height: | Size: 4.5 KiB |
BIN
hourglass/public/icons/png/science-7.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
hourglass/public/icons/png/science-8.png
Normal file
|
After Width: | Height: | Size: 6.9 KiB |
BIN
hourglass/public/icons/png/science-9.png
Normal file
|
After Width: | Height: | Size: 5.8 KiB |
BIN
hourglass/public/icons/png/science.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
hourglass/public/icons/png/search.png
Normal file
|
After Width: | Height: | Size: 7.3 KiB |
BIN
hourglass/public/icons/png/shapes.png
Normal file
|
After Width: | Height: | Size: 6.2 KiB |
BIN
hourglass/public/icons/png/space.png
Normal file
|
After Width: | Height: | Size: 9.7 KiB |
BIN
hourglass/public/icons/png/speech-balloon-1.png
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
hourglass/public/icons/png/speech-balloon.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
hourglass/public/icons/png/sports.png
Normal file
|
After Width: | Height: | Size: 4.4 KiB |
BIN
hourglass/public/icons/png/stars-1.png
Normal file
|
After Width: | Height: | Size: 7.2 KiB |
BIN
hourglass/public/icons/png/stars.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
hourglass/public/icons/png/technology.png
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
hourglass/public/icons/png/tool.png
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
BIN
hourglass/public/icons/png/transfer.png
Normal file
|
After Width: | Height: | Size: 5.1 KiB |
BIN
hourglass/public/icons/png/write-1.png
Normal file
|
After Width: | Height: | Size: 6.4 KiB |
BIN
hourglass/public/icons/png/write-2.png
Normal file
|
After Width: | Height: | Size: 7.4 KiB |
BIN
hourglass/public/icons/png/write.png
Normal file
|
After Width: | Height: | Size: 7.5 KiB |
BIN
hourglass/public/icons/png/writing.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
@ -28,7 +28,9 @@ for (var i = 0; i < superadmins.length; i++) {
|
|||||||
});
|
});
|
||||||
if (superadmin !== undefined && !(Roles.userIsInRole(superadmin._id, 'superadmin'))) {
|
if (superadmin !== undefined && !(Roles.userIsInRole(superadmin._id, 'superadmin'))) {
|
||||||
Roles.addUsersToRoles(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
|
// Only return necessary fields
|
||||||
fields: {
|
fields: {
|
||||||
'services.google.email': 1,
|
'services.google.email': 1,
|
||||||
'profile.avatar': 1,
|
|
||||||
'profile.banner': 1,
|
'profile.banner': 1,
|
||||||
'profile.grade': 1,
|
'profile.grade': 1,
|
||||||
'profile.description': 1,
|
'profile.description': 1,
|
||||||
@ -360,7 +361,7 @@ Meteor.methods({
|
|||||||
$set: change
|
$set: change
|
||||||
});
|
});
|
||||||
} else if ((currentwork.class === Meteor.userId() ||
|
} 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) &&
|
Meteor.userId() === currentwork.creator) &&
|
||||||
change.name.length <= 50 && change.description.length <= 150 &&
|
change.name.length <= 50 && change.description.length <= 150 &&
|
||||||
change.dueDate instanceof Date && change.dueDate.getTime() >= ref &&
|
change.dueDate instanceof Date && change.dueDate.getTime() >= ref &&
|
||||||
@ -391,8 +392,8 @@ Meteor.methods({
|
|||||||
var user = Meteor.userId();
|
var user = Meteor.userId();
|
||||||
if (typeof comment === "string" && comment.length <= 200 &&
|
if (typeof comment === "string" && comment.length <= 200 &&
|
||||||
(workobject.class === Meteor.userId() ||
|
(workobject.class === Meteor.userId() ||
|
||||||
(_.contains(currentclass.subscribers, Meteor.userId()) &&
|
(_.contains(currentclass.subscribers, Meteor.userId()) &&
|
||||||
!_.contains(currentclass.banned, Meteor.userId())))) {
|
!_.contains(currentclass.banned, Meteor.userId())))) {
|
||||||
var commentInfo = {
|
var commentInfo = {
|
||||||
"comment": input[0],
|
"comment": input[0],
|
||||||
"user": user,
|
"user": user,
|
||||||
@ -468,7 +469,6 @@ Meteor.methods({
|
|||||||
"grade": change.grade,
|
"grade": change.grade,
|
||||||
"classes": current.classes,
|
"classes": current.classes,
|
||||||
"description": change.description,
|
"description": change.description,
|
||||||
"avatar": change.avatar,
|
|
||||||
"banner": change.banner,
|
"banner": change.banner,
|
||||||
"preferences": change.preferences,
|
"preferences": change.preferences,
|
||||||
"name": current.name
|
"name": current.name
|
||||||
@ -486,7 +486,8 @@ Meteor.methods({
|
|||||||
},
|
},
|
||||||
'reorderClasses': function(newOrder) {
|
'reorderClasses': function(newOrder) {
|
||||||
var current = Meteor.user().profile;
|
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;
|
current.classes = newOrder;
|
||||||
Meteor.users.update({
|
Meteor.users.update({
|
||||||
_id: Meteor.userId()
|
_id: Meteor.userId()
|
||||||
@ -504,7 +505,6 @@ Meteor.methods({
|
|||||||
_id: userId
|
_id: userId
|
||||||
}).profile;
|
}).profile;
|
||||||
current.banner = "/Banners/defaultcover.jpg";
|
current.banner = "/Banners/defaultcover.jpg";
|
||||||
current.avatar = "/Avatars/" + (Math.floor(Math.random() * 10) + 1).toString() + ".png";
|
|
||||||
current.classes = [userId];
|
current.classes = [userId];
|
||||||
current.preferences = {
|
current.preferences = {
|
||||||
"theme": "light",
|
"theme": "light",
|
||||||
|
|||||||