diff --git a/scheduleac/.gitignore b/scheduleac/.gitignore new file mode 100644 index 0000000..f47cb20 --- /dev/null +++ b/scheduleac/.gitignore @@ -0,0 +1 @@ +*.out diff --git a/scheduleac/.meteor/.finished-upgraders b/scheduleac/.meteor/.finished-upgraders new file mode 100644 index 0000000..61ee313 --- /dev/null +++ b/scheduleac/.meteor/.finished-upgraders @@ -0,0 +1,12 @@ +# This file contains information which helps Meteor properly upgrade your +# app when you run 'meteor update'. You should check it into version control +# with your project. + +notices-for-0.9.0 +notices-for-0.9.1 +0.9.4-platform-file +notices-for-facebook-graph-api-2 +1.2.0-standard-minifiers-package +1.2.0-meteor-platform-split +1.2.0-cordova-changes +1.2.0-breaking-changes diff --git a/scheduleac/.meteor/.gitignore b/scheduleac/.meteor/.gitignore new file mode 100644 index 0000000..4083037 --- /dev/null +++ b/scheduleac/.meteor/.gitignore @@ -0,0 +1 @@ +local diff --git a/scheduleac/.meteor/.id b/scheduleac/.meteor/.id new file mode 100644 index 0000000..9b73a81 --- /dev/null +++ b/scheduleac/.meteor/.id @@ -0,0 +1,7 @@ +# This file contains a token that is unique to your project. +# Check it into your repository along with the rest of this directory. +# It can be used for purposes such as: +# - ensuring you don't accidentally deploy one app on top of another +# - providing package authors with aggregated statistics + +19rhzs13b9azhvowgeq diff --git a/scheduleac/.meteor/packages b/scheduleac/.meteor/packages new file mode 100644 index 0000000..5d22b3a --- /dev/null +++ b/scheduleac/.meteor/packages @@ -0,0 +1,29 @@ +# Meteor packages used by this project, one per line. +# Check this file (and the other files in this directory) into your repository. +# +# 'meteor add' and 'meteor remove' will edit this file for you, +# but you can also edit it by hand. + +meteor-base # Packages every Meteor app needs to have +mobile-experience # Packages for a great mobile UX +mongo # The database Meteor supports right now +blaze-html-templates # Compile .html files into Meteor Blaze views +session # Client-side reactive dictionary for your app +jquery # Helpful client-side library +tracker # Meteor's client-side reactive programming library + +standard-minifiers # JS/CSS minifiers run for production mode +es5-shim # ECMAScript 5 compatibility for older browsers. +ecmascript # Enable ECMAScript2015+ syntax in app code + +autopublish # Publish all data to the clients (for prototyping) +insecure # Allow all DB writes from clients (for prototyping) +rajit:bootstrap3-datepicker +twbs:bootstrap +accounts-google +accounts-ui +ongoworks:security +percolate:synced-cron +momentjs:moment +fortawesome:fontawesome +mystor:device-detection diff --git a/scheduleac/.meteor/platforms b/scheduleac/.meteor/platforms new file mode 100644 index 0000000..efeba1b --- /dev/null +++ b/scheduleac/.meteor/platforms @@ -0,0 +1,2 @@ +server +browser diff --git a/scheduleac/.meteor/release b/scheduleac/.meteor/release new file mode 100644 index 0000000..3a05e0a --- /dev/null +++ b/scheduleac/.meteor/release @@ -0,0 +1 @@ +METEOR@1.2.1 diff --git a/scheduleac/.meteor/versions b/scheduleac/.meteor/versions new file mode 100644 index 0000000..30713b7 --- /dev/null +++ b/scheduleac/.meteor/versions @@ -0,0 +1,86 @@ +accounts-base@1.2.2 +accounts-google@1.0.6 +accounts-oauth@1.1.8 +accounts-ui@1.1.6 +accounts-ui-unstyled@1.1.8 +autopublish@1.0.4 +autoupdate@1.2.4 +babel-compiler@5.8.24_1 +babel-runtime@0.1.4 +base64@1.0.4 +binary-heap@1.0.4 +blaze@2.1.3 +blaze-html-templates@1.0.1 +blaze-tools@1.0.4 +boilerplate-generator@1.0.4 +caching-compiler@1.0.0 +caching-html-compiler@1.0.2 +callback-hook@1.0.4 +check@1.1.0 +ddp@1.2.2 +ddp-client@1.2.1 +ddp-common@1.2.2 +ddp-rate-limiter@1.0.0 +ddp-server@1.2.2 +deps@1.0.9 +diff-sequence@1.0.1 +ecmascript@0.1.6 +ecmascript-runtime@0.2.6 +ejson@1.0.7 +es5-shim@4.1.14 +fastclick@1.0.7 +fortawesome:fontawesome@4.5.0 +geojson-utils@1.0.4 +google@1.1.7 +hot-code-push@1.0.0 +html-tools@1.0.5 +htmljs@1.0.5 +http@1.1.1 +id-map@1.0.4 +insecure@1.0.4 +jquery@1.11.4 +launch-screen@1.0.4 +less@2.5.1 +livedata@1.0.15 +localstorage@1.0.5 +logging@1.0.8 +meteor@1.1.10 +meteor-base@1.0.1 +minifiers@1.1.7 +minimongo@1.0.10 +mobile-experience@1.0.1 +mobile-status-bar@1.0.6 +momentjs:moment@2.11.2 +mongo@1.1.3 +mongo-id@1.0.1 +mystor:device-detection@0.2.0 +npm-mongo@1.4.39_1 +oauth@1.1.6 +oauth2@1.1.5 +observe-sequence@1.0.7 +ongoworks:security@1.3.0 +ordered-dict@1.0.4 +percolate:synced-cron@1.3.0 +promise@0.5.1 +rajit:bootstrap3-datepicker@1.5.0 +random@1.0.5 +rate-limit@1.0.0 +reactive-dict@1.1.3 +reactive-var@1.0.6 +reload@1.1.4 +retry@1.0.4 +routepolicy@1.0.6 +service-configuration@1.0.5 +session@1.1.1 +spacebars@1.0.7 +spacebars-compiler@1.0.7 +standard-minifiers@1.0.2 +templating@1.1.5 +templating-tools@1.0.0 +tracker@1.0.9 +twbs:bootstrap@3.3.6 +ui@1.0.8 +underscore@1.0.4 +url@1.0.5 +webapp@1.2.3 +webapp-hashing@1.0.5 diff --git a/scheduleac/README.md b/scheduleac/README.md new file mode 100644 index 0000000..ebf6f6a --- /dev/null +++ b/scheduleac/README.md @@ -0,0 +1,4 @@ +# scheduleac +Website for tracking if AC/Health class is Health or AC + +Live at http://actoday.tk/ diff --git a/scheduleac/client/client.css b/scheduleac/client/client.css new file mode 100644 index 0000000..5222e16 --- /dev/null +++ b/scheduleac/client/client.css @@ -0,0 +1,233 @@ +@font-face { + font-family: 'Lato'; + src: url('./lato-light.woff'); +} + +html { + -webkit-touch-callout: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; +} + +body { + background-image: url('./bg.png'); + overflow-x: hidden; +} + +h1 { + font-family: Lato; + font-size: 300%; + margin-left: 4.2%; +} + +.datepicker { + margin-top: 10.3%; +} + +#date { + margin-top:4%; + margin-left: 3.5%; + max-width: 50%; +} + +#other { + margin-top: 3%; + margin-bottom: 2%; + width: 89%; + margin-left: 3%; + padding-left:5%; +} + +.selection { + font-size: 150%; + width: 35%; + min-height: 50%; + float: right; + margin-right: 8%; +} + +#post { + margin-top: -18%; +} + +#day { + margin-top: -4%; +} + +#button { + margin-left: 3.5%; + margin-top: 3%; + font-size: 200%; + width: 88%; + color: #fff; + background-color: #DD655D; + border: 0; + cursor: pointer; + text-decoration: none; + text-align: left; + outline: none; + + -webkit-transition: background-color 0.5s ease; + -moz-transition: background-color 0.5s ease; + -ms-transition: background-color 0.5s ease; + transition: background-color 0.5s ease; +} + +#button:hover { + background-color: #EA4D4D; +} + +.login-display-name { + display: none !important; +} + +.login-button { + margin-left: 20% !important; + width: 100% !important; + height: 28px !important; +} +.eachDay { + position: relative; + font-family: Lato; + max-width: 30%; + box-shadow: 4px 5px 3px 2px #444; + margin-left: auto; + margin-right: auto; + margin-bottom:2%; + padding-top: 1.5%; + padding-bottom: 1%; + padding-left: 3%; + padding-right: 5%; + + -webkit-transition: transform 0.5s ease, background-color 0.5s ease; + -moz-transition: transform 0.5s ease, background-color 0.5s ease; + -ms-transition: transform 0.5s ease, background-color 0.5s ease; + transition: transform 0.5s ease, background-color 0.5s ease; +} + +.eachDay:hover { + -webkit-transform: scale(1.02); + -moz-transform: scale(1.02); + -ms-transform: scale(1.02); + transform: scale(1.02); +} + +.recent { + color: #353535; + font-size: 160%; + min-width:45%; + max-width:45%; + padding-top:3%; + padding-bottom:3%; +} + +.scheduleList { + margin-top: 10%; +} + +.type { + font-size:600%; + max-width:30%; +} + +.date { + font-size:250%; + padding-top:2%; +} + +.AC { + background-color: #5BEF78; +} + +.Health { + background-color: #136FB5; +} + +.pulltab { + position:fixed; + margin-top:0%; + width: 0; + height: 0; + border-top: 40px solid transparent; + border-bottom: 40px solid transparent; + + border-left: 40px solid #FF746B; + + -webkit-transition: transform 0.2s ease, border 0.2s ease, margin 0.3s ease; + -moz-transition: transform 0.2s ease, border 0.2s ease, margin 0.3s ease; + -ms-transition: transform 0.2s ease, border 0.2s ease, margin 0.3s ease; + transition: transform 0.2s ease, border 0.2s ease, margin 0.3s ease; + +} + +.pulltab:hover { + -webkit-transform: scale(1.3); + -moz-transform: scale(1.3); + -ms-transform: scale(1.3); + transform: scale(1.3); +} + +.sidebar { + position:absolute; + min-height:100%; + + background-color: #FF746B; + box-shadow: 2px 2px 5px 3px #444; + padding-left: 7%; + padding-right: 2%; + padding-top: 2%; +} + +.scale { + font-family: Lato; + min-height: 100%; + min-width: 17%; + position: fixed; + top: 0; + left: -20%; + + -webkit-transition: transform 0.3s ease; + -moz-transition: transform 0.3s ease; + -ms-transition: transform 0.3s ease; + transition: transform 0.3s ease; +} + +.fa { + float:right; + clear:right; + position: absolute; + top: 3%; + right: 2.3%; + + -webkit-transition: color 0.5s ease; + -moz-transition: color 0.5s ease; + -ms-transition: color 0.5s ease; + transition: color 0.5s ease; +} + +.fa:hover { + color: #FF746B; +} + +.about { + position: absolute; + bottom: 3%; + max-width: 70%; + margin-left: 3.5%; + font-size: 110%; +} + +.github { + font-size: 120%; + + -webkit-transition: color 0.3s ease; + -moz-transition: color 0.3s ease; + -ms-transition: color 0.3s ease; + transition: color 0.3s ease; + +} +.github:hover { + text-decoration: none; + color: #69CBE4; +} \ No newline at end of file diff --git a/scheduleac/client/client.html b/scheduleac/client/client.html new file mode 100644 index 0000000..e924eeb --- /dev/null +++ b/scheduleac/client/client.html @@ -0,0 +1,86 @@ + + AC/Health Schedule + + + + + + {{#if isDesktop}} + {{> client}} + {{else}} + {{> phone}} + {{/if}} + + + + + + + + + + + diff --git a/scheduleac/client/client.js b/scheduleac/client/client.js new file mode 100644 index 0000000..e91b503 --- /dev/null +++ b/scheduleac/client/client.js @@ -0,0 +1,193 @@ +var allowedu = {}; +var clicked = false; +allowedu["ybq987@gmail.com"] = true; +allowedu["dweinger@bloomfield.org"] = true; +allowedu["ksjdragon@gmail.com"] = true; +currentcard = 0; + +Meteor.subscribe('schedule'); + +Template.client.helpers({ + sched: function() { + beforeslice = schedule.find({}, { + sort: { + timestamp: 1 + }, + limit: 9 + }).fetch(); + return beforeslice.slice(1, beforeslice.length); + }, + mostrecent: function() { + return schedule.find({}, { + sort: { + timestamp: 1 + }, + limit: 1 + }).fetch(); + } + +}); + +Template.client.events({ + "click button": function() { + pre = document.getElementById("date").value; + document.getElementById("date").value = ""; + post = document.getElementById('post').value; + day = document.getElementById('day').value; + other = document.getElementById("other").value; + document.getElementById("other").value = ""; + Meteor.call('add_button', this, pre, post, day, other); + }, + "keypress input": function(event) { + if (event.keyCode === 13) { + pre = document.getElementById("date").value; + document.getElementById("date").value = ""; + post = document.getElementById('post').value; + other = document.getElementById("other").value; + document.getElementById("other").value = ""; + Meteor.call('add_button', this, pre, post, day, other); + } + }, + "click .pulltab": function() { + clicked = !clicked; + Session.set("sidebar", clicked); + if (clicked) { + $(".pulltab").css("border-left", "40px solid #DD655D").css("margin-left", "17%"); + $(".scale") + .css("-webkit-transform", "translateX(117%)") + .css("-moz-transform", "translateX(117%)") + .css("-ms-transform", "translateX(117%)") + .css("transform", "translateX(117%)"); + } else { + $(".pulltab").css("border-left", "40px solid #FF746B").css("margin-left", "0"); + $(".scale") + .css("-webkit-transform", "translateX(-59%)") + .css("-moz-transform", "translateX(-59%)") + .css("-ms-transform", "translateX(-59%)") + .css("transform", "translateX(-59%)"); + } + } +}); + +Template.day.helpers({ + pretext: function() { + date = moment(this.pretext); + date = date.calendar(null, { + sameDay: '[Today]', + nextDay: '[Tomorrow]', + nextWeek: 'dddd', + lastDay: '[Yesterday]', + lastWeek: '[Last] dddd', + sameElse: 'MM/DD/YYYY' + }); + if (this.day !== undefined) { + date = date + " (" + this.day + ")" + } + return date + }, + aftertext: function() { + return this.aftertext; + }, + other: function() { + return this.other; + }, + allowed: function() { + return (Meteor.user() !== undefined && Meteor.user().services.google.email in allowedu); + } +}); + +Template.day.events({ + 'click .fa': function() { + Meteor.call('remove', this); + }, + 'click .eachDay': function() { + var user_id = Session.get('user_id') + console.log(user_id); + } +}) + +Template.recent.events({ + 'click .fa': function() { + Meteor.call('remove', this); + } +}) + +Template.recent.helpers({ + pretext: function() { + date = moment(this.pretext); + date = date.calendar(null, { + sameDay: '[Today]', + nextDay: '[Tomorrow]', + nextWeek: 'dddd', + lastDay: '[Yesterday]', + lastWeek: '[Last] dddd', + sameElse: 'MM/DD/YYYY' + }); + if (this.day != undefined) { + date = date + " (" + this.day + ")" + } + return date + }, + aftertext: function() { + return this.aftertext; + }, + other: function() { + return this.other; + }, + allowed: function() { + if (!(Meteor.user() === undefined) && Meteor.user().services.google.email in allowedu) { + return true; + } else { + return false; + } + } +}); + +Template.sidebar.helpers({ + allowed: function() { + if (!(Meteor.user() === undefined) && Meteor.user().services.google.email in allowedu) { + return true; + } else { + return false; + } + } +}); + +Template.sidebar.events({ + "focus input": function() { + today = new Date() + $('#date').datepicker({ + startDate: today.toLocaleDateString(), + orientation: "top auto", + daysOfWeekDisabled: "0,6", + autoclose: true, + todayHighlight: true + }); + } +}) + +/*Template.day.rendered = function() { + $('.eachDay').each(function ( index ) { + $('.eachDay').eq(index) + .css("z-index", 100-index) + .css("-webkit-transform", "scale(" + getScale(index, 0) + ")") + .css("-moz-transform", "scale(" + getScale(index, 0) + ")") + .css("-ms-transform", "scale(" + getScale(index, 0) + ")") + .css("transform", "scale(" + getScale(index, 0) + ")"); + }) +} + +function getScale(index, start) { + return Math.abs(index-start) * -0.2 + 1.5 +}*/ + +Template.phone.helpers({ + phone: function() { + return schedule.find({}, { + sort: { + timestamp: 1 + }, + limit: 10 + }).fetch(); + } +}); diff --git a/scheduleac/collections/schedule.js b/scheduleac/collections/schedule.js new file mode 100644 index 0000000..f3ead9b --- /dev/null +++ b/scheduleac/collections/schedule.js @@ -0,0 +1 @@ +schedule = new Mongo.Collection("schedule"); \ No newline at end of file diff --git a/scheduleac/public/bg.png b/scheduleac/public/bg.png new file mode 100644 index 0000000..d870b50 Binary files /dev/null and b/scheduleac/public/bg.png differ diff --git a/scheduleac/public/favicon.ico b/scheduleac/public/favicon.ico new file mode 100644 index 0000000..96549e3 Binary files /dev/null and b/scheduleac/public/favicon.ico differ diff --git a/scheduleac/public/lato-light.woff b/scheduleac/public/lato-light.woff new file mode 100644 index 0000000..42ce43c Binary files /dev/null and b/scheduleac/public/lato-light.woff differ diff --git a/scheduleac/server/serve.js b/scheduleac/server/serve.js new file mode 100644 index 0000000..18fd171 --- /dev/null +++ b/scheduleac/server/serve.js @@ -0,0 +1,56 @@ +var allowed = {}; +allowed["ybq987@gmail.com"] = true; +allowed["dweinger@bloomfield.org"] = true; +//allowed["ksjdragon@gmail.com"] = true; + +schedule.permit(['insert', 'update', 'remove']).never().apply(); + +// schedule.remove({}); + +SyncedCron.add({ + name: 'Remove Entries past today', + schedule: function(parser) { + return parser.recur().on('14:35:00').time(); + }, + job: function() { + var thedate = moment(); + var today = thedate.format("X"); + + // Remove matching Documents + schedule.remove({timestamp: {$lt: today}}); + console.log(thedate.format()); + } +}); + +SyncedCron.start(); + + +Meteor.methods({ + + add_button: function(chrome, pre, post, day, other) { + if ((Meteor.user() != undefined) && (Meteor.user().services.google.email in allowed) && !(pre === "")) { + mymoment = moment(pre.replace("/", "-"), "MM-DD-YYYY"); + thepretext = mymoment.toISOString().split("T")[0]; + time = mymoment.format("X"); + previous = schedule.find({"pretext": thepretext}).fetch(); + if (previous.length > 0) { + entry = previous[0] + schedule.update(entry._id, {"aftertext": post, "pretext": entry.pretext, "day": day, "other": other, "timestamp": entry.timestamp}); + } else { + schedule.insert({ + "pretext": thepretext, + "aftertext": post, + "day": day, + "other": other, + "timestamp": time + }); + } + + } + }, + remove: function(chrome) { + if (Meteor.user() != undefined && Meteor.user().services.google.email in allowed) { + schedule.remove(chrome._id); + } + } +})