66 lines
1.3 KiB
JavaScript
66 lines
1.3 KiB
JavaScript
var allowedu = {};
|
|
allowedu["ybq987@gmail.com"] = true;
|
|
allowedu["dweinger@bloomfield.org"] = true;
|
|
|
|
Meteor.subscribe('schedule');
|
|
|
|
|
|
Template.client.helpers({
|
|
|
|
sched: function() {
|
|
return schedule.find({}, {sort: {timestamp: 1}, limit: 5}).fetch();
|
|
},
|
|
|
|
mostrecent: function() {
|
|
return schedule.find({}, {sort: {timestamp: 1}, limit: 1}).fetch();
|
|
},
|
|
|
|
allowed: function() {
|
|
if (!(Meteor.user() === undefined) && Meteor.user().services.google.email in allowedu) {
|
|
return true
|
|
} else {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
|
|
});
|
|
|
|
Template.client.events({
|
|
"focus input": function() {
|
|
today = new Date()
|
|
$('#date').datepicker({
|
|
startDate: today.toLocaleDateString(),
|
|
orientation: "top auto",
|
|
daysOfWeekDisabled: "0,6",
|
|
autoclose: true,
|
|
todayHighlight: true
|
|
});
|
|
},
|
|
|
|
"click button": function() {
|
|
pre = document.getElementById("date").value;
|
|
document.getElementById("date").value = "";
|
|
post = document.getElementById('post').value;
|
|
Meteor.call('add_button', this, pre, post);
|
|
}
|
|
});
|
|
|
|
Template.day.helpers({
|
|
pretext: function() {
|
|
return this.pretext;
|
|
},
|
|
aftertext: function() {
|
|
return this.aftertext;
|
|
}
|
|
});
|
|
|
|
Template.recent.helpers({
|
|
pretext: function() {
|
|
return this.pretext;
|
|
},
|
|
aftertext: function() {
|
|
return this.aftertext;
|
|
}
|
|
});
|