server issues, collection management, security issues
This commit is contained in:
parent
ce9f9da8b7
commit
942b1b1911
@ -22,3 +22,5 @@ rajit:bootstrap3-datepicker
|
|||||||
twbs:bootstrap
|
twbs:bootstrap
|
||||||
accounts-google
|
accounts-google
|
||||||
accounts-ui
|
accounts-ui
|
||||||
|
ongoworks:security
|
||||||
|
percolate:synced-cron
|
||||||
|
|||||||
@ -55,7 +55,9 @@ npm-mongo@1.4.39_1
|
|||||||
oauth@1.1.6
|
oauth@1.1.6
|
||||||
oauth2@1.1.5
|
oauth2@1.1.5
|
||||||
observe-sequence@1.0.7
|
observe-sequence@1.0.7
|
||||||
|
ongoworks:security@1.3.0
|
||||||
ordered-dict@1.0.4
|
ordered-dict@1.0.4
|
||||||
|
percolate:synced-cron@1.3.0
|
||||||
promise@0.5.1
|
promise@0.5.1
|
||||||
rajit:bootstrap3-datepicker@1.5.0
|
rajit:bootstrap3-datepicker@1.5.0
|
||||||
random@1.0.5
|
random@1.0.5
|
||||||
|
|||||||
@ -11,12 +11,14 @@
|
|||||||
|
|
||||||
|
|
||||||
<template name="client">
|
<template name="client">
|
||||||
|
<input type="text" class="form-control" id="date">
|
||||||
|
|
||||||
|
{{#if allowed}}
|
||||||
|
<select id="post">
|
||||||
|
<option value="AC">AC</option>
|
||||||
|
<option value="Health">Health</option>
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="post">
|
<button>Submit</button>
|
||||||
<option value="AC">AC</option>
|
{{/if}}
|
||||||
<option value="Health">Health</option>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<button>Submit</button>
|
|
||||||
<input type="text" class="form-control" id="date">
|
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@ -1,30 +1,46 @@
|
|||||||
|
var allowedu = {};
|
||||||
|
allowedu["ybq987@gmail.com"] = true;
|
||||||
|
allowedu["dweinger@bloomfield.org"] = true;
|
||||||
|
|
||||||
|
var done = false;
|
||||||
|
|
||||||
Meteor.subscribe('schedule');
|
Meteor.subscribe('schedule');
|
||||||
|
|
||||||
Template.client.rendered=function() {
|
Template.client.rendered=function() {
|
||||||
today = new Date()
|
|
||||||
$('#date').datepicker({
|
|
||||||
startDate: today.toLocaleDateString(),
|
|
||||||
orientation: "top auto",
|
|
||||||
daysOfWeekDisabled: "0,6",
|
|
||||||
autoclose: true,
|
|
||||||
todayHighlight: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// schedule.find({}, {sort: {timestamp: 1}, limit: 2}).fetch()
|
||||||
|
|
||||||
Template.client.helpers({
|
Template.client.helpers({
|
||||||
|
|
||||||
|
allowed: function() {
|
||||||
status_class: function() {
|
if (!(Meteor.user() === undefined) && Meteor.user().services.google.email in allowedu) {
|
||||||
return statusmap[this.status];
|
return true
|
||||||
}
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
Template.client.events({
|
Template.client.events({
|
||||||
|
"focus input": function() {
|
||||||
|
if (!done) {
|
||||||
|
today = new Date()
|
||||||
|
$('#date').datepicker({
|
||||||
|
startDate: today.toLocaleDateString(),
|
||||||
|
orientation: "top auto",
|
||||||
|
daysOfWeekDisabled: "0,6",
|
||||||
|
autoclose: true,
|
||||||
|
todayHighlight: true
|
||||||
|
});
|
||||||
|
done = true;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
"click button": function() {
|
"click button": function() {
|
||||||
pre = document.getElementById("date").value;
|
pre = document.getElementById("date").value;
|
||||||
document.getElementById("date").value = "";
|
document.getElementById("date").value = "";
|
||||||
|
|||||||
@ -1,15 +1,31 @@
|
|||||||
var currentpass = "test";
|
|
||||||
var allowed = {};
|
var allowed = {};
|
||||||
allowed["ybq987@gmail.com"] = true;
|
allowed["ybq987@gmail.com"] = true;
|
||||||
allowed["dweinger@bloomfield.org"] = true;
|
allowed["dweinger@bloomfield.org"] = true;
|
||||||
|
|
||||||
|
|
||||||
// schedule.permit(['insert', 'update', 'remove']).never().apply();
|
schedule.remove({})
|
||||||
|
schedule.permit(['insert', 'update', 'remove']).never().apply();
|
||||||
|
|
||||||
|
SyncedCron.add({
|
||||||
|
name: 'Remove Entries past today',
|
||||||
|
schedule: function(parser) {
|
||||||
|
return parser.recur().on('00:00:00').time();
|
||||||
|
},
|
||||||
|
job: function() {
|
||||||
|
var today = new Date();
|
||||||
|
|
||||||
|
// Remove matchng Documents
|
||||||
|
schedule.remove({timestamp: {$lt: today}});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
SyncedCron.start();
|
||||||
|
|
||||||
|
|
||||||
Meteor.methods({
|
Meteor.methods({
|
||||||
|
|
||||||
add_button: function(chrome, pre, post) {
|
add_button: function(chrome, pre, post) {
|
||||||
if (Meteor.user().services.google.email in allowed) {
|
if (Meteor.user() != undefined && Meteor.user().services.google.email in allowed) {
|
||||||
|
|
||||||
madate = pre.split("/");
|
madate = pre.split("/");
|
||||||
date = new Date();
|
date = new Date();
|
||||||
@ -19,7 +35,8 @@ Meteor.methods({
|
|||||||
|
|
||||||
schedule.insert({
|
schedule.insert({
|
||||||
"pretext": date.toDateString().slice(0,date.length),
|
"pretext": date.toDateString().slice(0,date.length),
|
||||||
"aftertext": post
|
"aftertext": post,
|
||||||
|
"timestamp": date
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user