Merge branch with master
This commit is contained in:
commit
80459a006b
@ -12,3 +12,4 @@ notices-for-facebook-graph-api-2
|
||||
1.2.0-breaking-changes
|
||||
1.3.0-split-minifiers-package
|
||||
1.4.0-remove-old-dev-bundle-link
|
||||
1.4.1-add-shell-server-package
|
||||
|
||||
@ -6,23 +6,23 @@
|
||||
|
||||
meteor-base@1.0.4 # Packages every Meteor app needs to have
|
||||
mobile-experience@1.0.4 # Packages for a great mobile UX
|
||||
mongo@1.1.10 # The database Meteor supports right now
|
||||
mongo@1.1.11 # The database Meteor supports right now
|
||||
blaze-html-templates@1.0.4 # Compile .html files into Meteor Blaze views
|
||||
reactive-var@1.0.10 # Reactive variable for tracker
|
||||
jquery@1.11.9 # Helpful client-side library
|
||||
tracker@1.1.0 # Meteor's client-side reactive programming library
|
||||
|
||||
standard-minifier-css@1.1.8 # CSS minifier run for production mode
|
||||
standard-minifier-js@1.1.8 # JS minifier run for production mode
|
||||
es5-shim@4.6.13 # ECMAScript 5 compatibility for older browsers.
|
||||
ecmascript@0.5.7 # Enable ECMAScript2015+ syntax in app code
|
||||
standard-minifier-css@1.2.0 # CSS minifier run for production mode
|
||||
standard-minifier-js@1.2.0 # JS minifier run for production mode
|
||||
es5-shim@4.6.14 # ECMAScript 5 compatibility for older browsers.
|
||||
ecmascript@0.5.8 # Enable ECMAScript2015+ syntax in app code
|
||||
|
||||
fortawesome:fontawesome
|
||||
session
|
||||
session@1.1.6
|
||||
proyk:meteor-cookies
|
||||
aldeed:simple-schema
|
||||
accounts-google
|
||||
accounts-ui
|
||||
accounts-google@1.0.10
|
||||
accounts-ui@1.1.9
|
||||
iron:router
|
||||
ongoworks:security
|
||||
mizzao:autocomplete
|
||||
@ -30,3 +30,4 @@ alanning:roles
|
||||
rzymek:fullcalendar
|
||||
momentjs:moment
|
||||
eternicode:bootstrap-datepicker
|
||||
shell-server
|
||||
|
||||
@ -1 +1 @@
|
||||
METEOR@1.4.0.1
|
||||
METEOR@1.4.1
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
accounts-base@1.2.9
|
||||
accounts-base@1.2.11
|
||||
accounts-google@1.0.10
|
||||
accounts-oauth@1.1.13
|
||||
accounts-ui@1.1.9
|
||||
@ -6,41 +6,41 @@ accounts-ui-unstyled@1.1.12
|
||||
alanning:roles@1.2.15
|
||||
aldeed:simple-schema@1.5.3
|
||||
allow-deny@1.0.5
|
||||
autoupdate@1.2.11
|
||||
babel-compiler@6.9.0
|
||||
babel-runtime@0.1.10
|
||||
autoupdate@1.3.11
|
||||
babel-compiler@6.9.1
|
||||
babel-runtime@0.1.11
|
||||
base64@1.0.9
|
||||
binary-heap@1.0.9
|
||||
blaze@2.1.8
|
||||
blaze-html-templates@1.0.4
|
||||
blaze-tools@1.0.9
|
||||
boilerplate-generator@1.0.9
|
||||
caching-compiler@1.0.6
|
||||
caching-compiler@1.1.7
|
||||
caching-html-compiler@1.0.6
|
||||
callback-hook@1.0.9
|
||||
check@1.2.3
|
||||
coffeescript@1.0.17
|
||||
coffeescript@1.2.4
|
||||
dandv:caret-position@2.1.1
|
||||
ddp@1.2.5
|
||||
ddp-client@1.2.9
|
||||
ddp-client@1.3.1
|
||||
ddp-common@1.2.6
|
||||
ddp-rate-limiter@1.0.5
|
||||
ddp-server@1.2.10
|
||||
ddp-server@1.3.10
|
||||
deps@1.0.12
|
||||
diff-sequence@1.0.6
|
||||
ecmascript@0.5.7
|
||||
ecmascript-runtime@0.3.12
|
||||
ecmascript@0.5.8
|
||||
ecmascript-runtime@0.3.14
|
||||
ejson@1.0.12
|
||||
es5-shim@4.6.13
|
||||
es5-shim@4.6.14
|
||||
eternicode:bootstrap-datepicker@1.6.0_3
|
||||
fastclick@1.0.12
|
||||
fortawesome:fontawesome@4.5.0
|
||||
geojson-utils@1.0.9
|
||||
google@1.1.13
|
||||
google@1.1.14
|
||||
hot-code-push@1.0.4
|
||||
html-tools@1.0.10
|
||||
htmljs@1.0.10
|
||||
http@1.1.8
|
||||
http@1.2.9
|
||||
id-map@1.0.8
|
||||
iron:controller@1.0.12
|
||||
iron:core@1.0.11
|
||||
@ -52,31 +52,31 @@ iron:router@1.0.13
|
||||
iron:url@1.0.11
|
||||
jquery@1.11.9
|
||||
launch-screen@1.0.12
|
||||
less@2.6.5
|
||||
less@2.7.5
|
||||
livedata@1.0.18
|
||||
localstorage@1.0.11
|
||||
logging@1.1.14
|
||||
mdg:validation-error@0.2.0
|
||||
meteor@1.2.16
|
||||
logging@1.1.15
|
||||
mdg:validation-error@0.5.1
|
||||
meteor@1.2.17
|
||||
meteor-base@1.0.4
|
||||
minifier-css@1.2.13
|
||||
minifier-js@1.2.13
|
||||
minifier-css@1.2.14
|
||||
minifier-js@1.2.14
|
||||
minimongo@1.0.17
|
||||
mizzao:autocomplete@0.5.1
|
||||
mobile-experience@1.0.4
|
||||
mobile-status-bar@1.0.12
|
||||
modules@0.7.5
|
||||
modules-runtime@0.7.5
|
||||
momentjs:moment@2.8.4
|
||||
mongo@1.1.10
|
||||
modules@0.7.6
|
||||
modules-runtime@0.7.6
|
||||
momentjs:moment@2.14.4
|
||||
mongo@1.1.11
|
||||
mongo-id@1.0.5
|
||||
npm-mongo@1.5.45
|
||||
npm-mongo@1.5.46
|
||||
oauth@1.1.11
|
||||
oauth2@1.1.10
|
||||
observe-sequence@1.0.12
|
||||
ongoworks:security@2.0.1
|
||||
ordered-dict@1.0.8
|
||||
promise@0.8.3
|
||||
promise@0.8.4
|
||||
proyk:meteor-cookies@0.0.1
|
||||
random@1.0.10
|
||||
rate-limit@1.0.5
|
||||
@ -88,15 +88,16 @@ routepolicy@1.0.11
|
||||
rzymek:fullcalendar@2.7.2
|
||||
service-configuration@1.0.10
|
||||
session@1.1.6
|
||||
shell-server@0.2.1
|
||||
spacebars@1.0.12
|
||||
spacebars-compiler@1.0.12
|
||||
standard-minifier-css@1.1.8
|
||||
standard-minifier-js@1.1.8
|
||||
templating@1.1.14
|
||||
standard-minifier-css@1.2.0
|
||||
standard-minifier-js@1.2.0
|
||||
templating@1.2.14
|
||||
templating-tools@1.0.4
|
||||
tracker@1.1.0
|
||||
ui@1.0.11
|
||||
underscore@1.0.9
|
||||
url@1.0.10
|
||||
webapp@1.3.10
|
||||
webapp@1.3.11
|
||||
webapp-hashing@1.0.9
|
||||
|
||||
@ -72,20 +72,35 @@ Template.registerHelper('myClasses', () => {
|
||||
var thisWork = work.find({class: courses[i]}).fetch();
|
||||
|
||||
for(var j = 0; j < thisWork.length; j++) {
|
||||
thisWork[j].dueDate = getReadableDate(thisWork[j].dueDate);
|
||||
thisWork[j].dueDate = moment(thisWork[j].dueDate).calendar(null, {
|
||||
sameDay: '[Today]',
|
||||
nextDay: '[Tomorrow]',
|
||||
nextWeek: 'dddd',
|
||||
lastDay: '[Yesterday]',
|
||||
lastWeek: '[Last] dddd',
|
||||
sameElse: 'MMMM Do'
|
||||
});
|
||||
thisWork[j].typeColor = workColors[thisWork[j].type];
|
||||
}
|
||||
array[i].thisClassWork = thisWork;
|
||||
}
|
||||
Session.set("noclass",false);
|
||||
<<<<<<< HEAD
|
||||
console.log(array);
|
||||
return array;
|
||||
=======
|
||||
return array;
|
||||
>>>>>>> afd60acb9ab69a32ee86ae92e86e0d67e39af7be
|
||||
}
|
||||
});
|
||||
|
||||
Template.main.helpers({
|
||||
schoolName() {
|
||||
<<<<<<< HEAD
|
||||
Session.set("calendarclasses", Meteor.user().profile.classes);
|
||||
=======
|
||||
Session.set("calendarclasses", Meteor.user().profile.classes);
|
||||
>>>>>>> afd60acb9ab69a32ee86ae92e86e0d67e39af7be
|
||||
return " - " + Meteor.user().profile.school;
|
||||
},
|
||||
iconColor(icon) {
|
||||
@ -451,8 +466,9 @@ Template.main.events({
|
||||
'focus #workDatea' () {
|
||||
$('#workDatea').datepicker({
|
||||
format: 'DD, MM d, yyyy',
|
||||
startDate: 'mm-dd-yyyy',
|
||||
autoclose: true,
|
||||
startDate: 'd',
|
||||
todayHighlight: true,
|
||||
autoclose: true
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@ -5,17 +5,12 @@ import {
|
||||
Mongo
|
||||
} from 'meteor/mongo';
|
||||
|
||||
_uuid4 = function(cc) {
|
||||
var rr = Math.random() * 16 | 0;
|
||||
return (cc === 'x' ? rr : (rr & 0x3 | 0x8)).toString(16);
|
||||
};
|
||||
|
||||
superadmins = [
|
||||
"ybq987@gmail.com",
|
||||
"ksjdragon@gmail.com"
|
||||
];
|
||||
|
||||
worktype = ["test", "quiz", "project", "normal"];
|
||||
worktype = ["test", "quiz", "project", "normal", "other"];
|
||||
var possiblelist = ["moderators", "banned"];
|
||||
|
||||
for (var i = 0; i < superadmins.length; i++) {
|
||||
@ -81,7 +76,11 @@ Meteor.publish('users', function() {
|
||||
if (Roles.userIsInRole(this.userId, ['superadmin', 'admin'])) {
|
||||
return Meteor.users.find();
|
||||
} else {
|
||||
return Meteor.users.find({}, {fields: {'services.google.email': 1}});
|
||||
return Meteor.users.find({}, {
|
||||
fields: {
|
||||
'services.google.email': 1
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@ -89,7 +88,7 @@ Security.permit(['insert', 'update', 'remove']).collections([schools, classes, w
|
||||
|
||||
Meteor.methods({
|
||||
'genCode': function() {
|
||||
return 'xxxxxx'.replace(/[x]/g, _uuid4);
|
||||
return Math.random().toString(36).substring(7);
|
||||
},
|
||||
'createSchool': function(schoolname) {
|
||||
if (Meteor.user() !== null &&
|
||||
@ -160,34 +159,62 @@ Meteor.methods({
|
||||
}
|
||||
},
|
||||
'changeAdmin': function(input) {
|
||||
var found = Meteor.users.find({_id: input[0]});
|
||||
var foundclass = classes.find({_id: input[1]});
|
||||
var found = Meteor.users.find({
|
||||
_id: input[0]
|
||||
});
|
||||
var foundclass = classes.find({
|
||||
_id: input[1]
|
||||
});
|
||||
if (Roles.userIsInRole(Meteor.userId(), ['superadmin', 'admin'])) {
|
||||
classes.update({_id: input[1]}, {$set: {admin: input[0]}});
|
||||
classes.update({
|
||||
_id: input[1]
|
||||
}, {
|
||||
$set: {
|
||||
admin: input[0]
|
||||
}
|
||||
});
|
||||
} else if (found && foundclass && foundclass.admin == Meteor.userId() &&
|
||||
foundclass.banned.indexOf(input[0]) === -1 &&
|
||||
foundclass.subscribers.indexOf(input[0]) !== -1) {
|
||||
classes.update({_id: input[1]}, {$set: {admin: input[0]}});
|
||||
classes.update({
|
||||
_id: input[1]
|
||||
}, {
|
||||
$set: {
|
||||
admin: input[0]
|
||||
}
|
||||
});
|
||||
} else {
|
||||
throw "Unauthorized";
|
||||
}
|
||||
},
|
||||
'trackUserInClass': function(input) {
|
||||
var foundclass = classes.findOne({_id: input[1]});
|
||||
var foundclass = classes.findOne({
|
||||
_id: input[1]
|
||||
});
|
||||
var userlist = input[2];
|
||||
var index = possiblelist.indexOf(input[2]);
|
||||
var set = {};
|
||||
set[userlist] = foundclass[userlist].concat(input[0]);
|
||||
if (Roles.userIsInRole(Meteor.userId(), ['superadmin', 'admin'])) {
|
||||
classes.update({_id: input[1]}, {$set: set});
|
||||
classes.update({
|
||||
_id: input[1]
|
||||
}, {
|
||||
$set: set
|
||||
});
|
||||
} else if (foundclass && foundclass.admin == Meteor.userId() && index !== -1 &&
|
||||
(index === 1 || foundclass.moderators.indexOf(Meteor.userId()) !== -1) &&
|
||||
foundclass[userlist].indexOf(input[0]) === -1) {
|
||||
classes.update({_id: input[1]}, {$set: set});
|
||||
classes.update({
|
||||
_id: input[1]
|
||||
}, {
|
||||
$set: set
|
||||
});
|
||||
}
|
||||
},
|
||||
'untrackUserInClass': function(input) {
|
||||
var foundclass = classes.findOne({_id: input[1]});
|
||||
var foundclass = classes.findOne({
|
||||
_id: input[1]
|
||||
});
|
||||
var userlist = input[2];
|
||||
var index = possiblelist.indexOf(input[2]);
|
||||
var set = {};
|
||||
@ -195,11 +222,19 @@ Meteor.methods({
|
||||
set[userlist] = foundclass[userlist];
|
||||
|
||||
if (Roles.userIsInRole(Meteor.userId(), ['superadmin', 'admin'])) {
|
||||
classes.update({_id: input[1]}, {$set: set});
|
||||
classes.update({
|
||||
_id: input[1]
|
||||
}, {
|
||||
$set: set
|
||||
});
|
||||
} else if (foundclass && foundclass.admin == Meteor.userId() && index !== -1 &&
|
||||
(index === 1 || foundclass.moderators.indexOf(Meteor.userId()) !== -1) &&
|
||||
foundclass[userlist].indexOf(input[0]) !== -1) {
|
||||
classes.update({_id: input[1]}, {$set: set});
|
||||
classes.update({
|
||||
_id: input[1]
|
||||
}, {
|
||||
$set: set
|
||||
});
|
||||
}
|
||||
},
|
||||
'deleteClass': function(classid) {
|
||||
@ -209,7 +244,9 @@ Meteor.methods({
|
||||
if (Meteor.user() !== null && found !== null &&
|
||||
(found.admin === Meteor.user()._id || Roles.userIsInRole(Meteor.userId(), ['superadmin', 'admin']))) {
|
||||
for (var i = 0; i < found.subscribers.length; i++) {
|
||||
var current = Meteor.users.findOne({_id:found.subscribers[i]}).profile;
|
||||
var current = Meteor.users.findOne({
|
||||
_id: found.subscribers[i]
|
||||
}).profile;
|
||||
var index = current.classes.indexOf(classid);
|
||||
current.classes.splice(index, 1);
|
||||
Meteor.users.update({
|
||||
@ -226,7 +263,9 @@ Meteor.methods({
|
||||
}
|
||||
},
|
||||
'createWork': function(input) {
|
||||
var ref = new Date().getTime();
|
||||
var ref = new Date();
|
||||
ref.setHours(0,0,0,0);
|
||||
ref = ref.getTime();
|
||||
input.creator = Meteor.userId();
|
||||
work.schema.validate(input);
|
||||
var found = classes.findOne({
|
||||
@ -251,8 +290,9 @@ Meteor.methods({
|
||||
|
||||
},
|
||||
'editWork': function(change) {
|
||||
var ref = new Date().getTime();
|
||||
|
||||
var ref = new Date();
|
||||
ref.setHours(0,0,0,0);
|
||||
ref = ref.getTime();
|
||||
var currentclass = classes.findOne({
|
||||
_id: work.findOne({
|
||||
_id: change._id
|
||||
@ -331,8 +371,7 @@ Meteor.methods({
|
||||
var currentclass = classes.findOne({
|
||||
_id: workobject.class
|
||||
});
|
||||
if (currentclass.subscribers.indexOf(Meteor.userId()) != -1 &&
|
||||
["confirmations", "reports", "done"].indexOf(input[1]) != -1) {
|
||||
if (currentclass.subscribers.indexOf(Meteor.userId()) != -1 && ["confirmations", "reports", "done"].indexOf(input[1]) != -1) {
|
||||
userindex = workobject[input[1]].indexOf(Meteor.userId());
|
||||
if (userindex === -1) {
|
||||
workobject[input[1]] = workobject[input[1]].concat(Meteor.userId());
|
||||
@ -406,7 +445,13 @@ Meteor.methods({
|
||||
found !== null &&
|
||||
pass === found.code &&
|
||||
prof.classes.indexOf(change) === -1) {
|
||||
classes.update({_id: found._id}, {$set: {subscribers: found.subscribers.concat(Meteor.userId())}});
|
||||
classes.update({
|
||||
_id: found._id
|
||||
}, {
|
||||
$set: {
|
||||
subscribers: found.subscribers.concat(Meteor.userId())
|
||||
}
|
||||
});
|
||||
var current = Meteor.user().profile;
|
||||
current.classes = current.classes.concat(change);
|
||||
Meteor.users.update({
|
||||
@ -422,13 +467,29 @@ Meteor.methods({
|
||||
}
|
||||
},
|
||||
'joinPrivateClass': function(input) {
|
||||
var found = classes.findOne({status: true, privacy: true, code:input});
|
||||
var found = classes.findOne({
|
||||
status: true,
|
||||
privacy: true,
|
||||
code: input
|
||||
});
|
||||
var current = Meteor.user().profile;
|
||||
if (found !== undefined && input !== undefined &&
|
||||
current.classes.indexOf(found._id) === -1) {
|
||||
classes.update({_id: found._id}, {$set: {subscribers: found.subscribers.concat(Meteor.userId())}});
|
||||
classes.update({
|
||||
_id: found._id
|
||||
}, {
|
||||
$set: {
|
||||
subscribers: found.subscribers.concat(Meteor.userId())
|
||||
}
|
||||
});
|
||||
current.classes = current.classes.concat(found._id);
|
||||
Meteor.users.update({_id: Meteor.userId()}, {$set: {profile: current}});
|
||||
Meteor.users.update({
|
||||
_id: Meteor.userId()
|
||||
}, {
|
||||
$set: {
|
||||
profile: current
|
||||
}
|
||||
});
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
@ -450,8 +511,16 @@ Meteor.methods({
|
||||
profile: current
|
||||
}
|
||||
});
|
||||
var newstudents = classes.findOne({_id: change}).subscribers.splice(Meteor.userId(), 1);
|
||||
classes.update({_id: change}, {$set: {subscribers: newstudents}});
|
||||
var newstudents = classes.findOne({
|
||||
_id: change
|
||||
}).subscribers.splice(Meteor.userId(), 1);
|
||||
classes.update({
|
||||
_id: change
|
||||
}, {
|
||||
$set: {
|
||||
subscribers: newstudents
|
||||
}
|
||||
});
|
||||
return 1;
|
||||
} else {
|
||||
throw "You are currently the admin of this class. Transfer ownership in order to leave this class.";
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user