This commit is contained in:
Kenneth Jao 2016-09-15 08:30:29 -04:00
commit 6b74524b9c
3 changed files with 16 additions and 32 deletions

View File

@ -34,3 +34,4 @@ shell-server@0.2.1
http@1.2.9
underscore
houston:admin
ahref:dragula

View File

@ -4,6 +4,7 @@ accounts-oauth@1.1.13
accounts-password@1.3.0
accounts-ui@1.1.9
accounts-ui-unstyled@1.1.12
ahref:dragula@3.5.4
alanning:roles@1.2.15
aldeed:simple-schema@1.5.3
allow-deny@1.0.5
@ -21,6 +22,7 @@ caching-html-compiler@1.0.6
callback-hook@1.0.9
check@1.2.3
coffeescript@1.2.4_1
cosmos:browserify@0.9.4
dandv:caret-position@2.1.1
dburles:mongo-collection-instances@0.3.5
ddp@1.2.5

View File

@ -30,7 +30,7 @@ var defaultWork = {
dueDate: "Click here to edit...",
description: "Click here to edit...",
type: "Click here to edit..."
}
};
// Creates variables for due dates
@ -68,6 +68,7 @@ Template.login.rendered = function() {
Template.main.rendered = function() {
Accounts._loginButtonsSession.set('dropdownVisible', true);
dragula([document.querySelector('#classesMode'), document.querySelector('#nonexistant')]);
};
Template.profile.rendered = function() {
@ -82,7 +83,7 @@ Template.registerHelper('userProfile', () => {
Template.registerHelper('screen', (multiplier, fraction) => {
if(typeof multiplier !== "string") return screen.width.toString() + "px";
if(typeof fraction !== "string") return (screen.width * parseFloat(multiplier)).toString() + "px"
if(typeof fraction !== "string") return (screen.width * parseFloat(multiplier)).toString() + "px";
return ((screen.width) * parseFloat(multiplier) / parseFloat(fraction)).toString() + "px";
});
@ -759,14 +760,14 @@ Template.main.events({
},
// WORK OVERLAY BUTTONS
'click #commentSubmit' (event) { // Click to submit a comment.
workId = Session.get("currentWorkId")
workId = Session.get("currentWorkId");
var input = document.getElementById('workComment');
comment = input.value;
input.value = "";
Session.set("commentRestrict", null);
if (comment !== "") {
document.getElementById('workComment').value = "";
Meteor.call('addComment', [comment, workId])
Meteor.call('addComment', [comment, workId]);
}
},
'click #workSubmit' () { // Click submit work to create a work.
@ -921,13 +922,14 @@ function getHomeworkFormData() { // Get all data relating to work creation.
}
}
if (stop) return null;
var data;
if (Session.get("newWork")) {
var data = {
data = {
"class": Session.get("currentWorkId")
};
} else {
var data = work.findOne({
data = work.findOne({
_id: Session.get("currentWorkId")
});
}
@ -968,21 +970,11 @@ function toDate(date) { // Turns formatted date back to Date constructor.
function formReadable(input, val) { // Makes work information readable by users.
switch(val) {
case "typeColor":
return input.typeColor = workColors[input.type];
break;
case "name":
return input.name;
break;
case "dueDate":
return getReadableDate(input.dueDate);
break;
case "description":
return input.description;
break;
case "type":
return input.type[0].toUpperCase() + input.type.slice(1);
break;
case "typeColor": return input.typeColor = workColors[input.type];
case "name": return input.name;
case "dueDate": return getReadableDate(input.dueDate);
case "description": return input.description;
case "type": return input.type[0].toUpperCase() + input.type.slice(1);
case "comments":
var comments = input.comments;
var resort = [];
@ -1005,7 +997,6 @@ function formReadable(input, val) { // Makes work information readable by users.
resort[re].email = user.services.google.email;
}
return resort;
break;
case "done":
if (Session.get("newWork")) return [];
for (var i = 0; i < input.done.length; i++) { // Display users who marked as done.
@ -1020,45 +1011,35 @@ function formReadable(input, val) { // Makes work information readable by users.
};
}
return input.done;
break;
case "doneCol":
if (Session.get("newWork")) return "";
if (!_.contains(input.done,Meteor.userId())) return "";
return "#27A127";
break;
case "doneText":
if (Session.get("newWork")) return "";
if (!_.contains(input.done,Meteor.userId())) return "Mark done";
return "Done!";
break;
case "userConfirm":
if(!_.contains(input.confirmations, Meteor.userId())) return "";
return "#27A127";
break;
case "confirmations":
return input.confirmations.length;
break;
case "userReport":
if(!_.contains(input.reports, Meteor.userId())) return "";
return "#FF1A1A";
break;
case "reports":
return input.reports.length;
break;
case "email":
return Meteor.users.findOne({
_id: input.creator
}).services.google.email;
break;
case "avatar":
return Meteor.users.findOne({
_id: input.creator
}).profile.avatar;
break;
case "creator":
return Meteor.users.findOne({
_id: input.creator
}).profile.name;
break;
}
}