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 http@1.2.9
underscore underscore
houston:admin houston:admin
ahref:dragula

View File

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

View File

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