mobile support

This commit is contained in:
yamanq 2016-02-11 18:10:16 -05:00
parent fb377b2625
commit 3014336d6c
5 changed files with 38 additions and 2 deletions

View File

@ -26,3 +26,4 @@ ongoworks:security
percolate:synced-cron percolate:synced-cron
momentjs:moment momentjs:moment
fortawesome:fontawesome fortawesome:fontawesome
mystor:device-detection

View File

@ -53,6 +53,7 @@ mobile-status-bar@1.0.6
momentjs:moment@2.11.2 momentjs:moment@2.11.2
mongo@1.1.3 mongo@1.1.3
mongo-id@1.0.1 mongo-id@1.0.1
mystor:device-detection@0.2.0
npm-mongo@1.4.39_1 npm-mongo@1.4.39_1
oauth@1.1.6 oauth@1.1.6
oauth2@1.1.5 oauth2@1.1.5

View File

@ -3,7 +3,11 @@
</head> </head>
<body> <body>
{{> client}} {{#if isDesktop}}
{{> client}}
{{else}}
{{> phone}}
{{/if}}
</body> </body>
@ -60,3 +64,8 @@
</div> </div>
</div> </div>
</template> </template>
<template name="phone">
<p class="type">{{aftertext}} </p><p class="date">{{pretext}} </p>
<button class="nextb">Next</button>
</template>

View File

@ -3,6 +3,7 @@ var clicked = false;
allowedu["ybq987@gmail.com"] = true; allowedu["ybq987@gmail.com"] = true;
allowedu["dweinger@bloomfield.org"] = true; allowedu["dweinger@bloomfield.org"] = true;
allowedu["ksjdragon@gmail.com"]= true; allowedu["ksjdragon@gmail.com"]= true;
currentcard = 0;
Meteor.subscribe('schedule'); Meteor.subscribe('schedule');
@ -159,5 +160,29 @@ function getScale(index, start) {
} }
Template.phone.helpers({
pretext: function() {
cole = schedule.find({}, {sort: {timestamp: 1}}).fetch();
date = moment(cole[currentcard].pretext);
date = date.calendar(null, {
sameDay: '[Today]',
nextDay: '[Tomorrow]',
nextWeek: 'dddd',
lastDay: '[Yesterday]',
lastWeek: '[Last] dddd',
sameElse: 'DD/MM/YYYY'
});
return date
},
aftertext: function() {
cole = schedule.find({}, {sort: {timestamp: 1}}).fetch();
return cole[currentcard].aftertext;
}
});
Template.phone.events({
'click nextb': function() {
currentcard += 1;
}
});

View File

@ -10,7 +10,7 @@ schedule.permit(['insert', 'update', 'remove']).never().apply();
SyncedCron.add({ SyncedCron.add({
name: 'Remove Entries past today', name: 'Remove Entries past today',
schedule: function(parser) { schedule: function(parser) {
return parser.recur().on('07:46:00').time(); return parser.recur().on('00:00:00').time();
}, },
job: function() { job: function() {
var today = moment().format("X"); var today = moment().format("X");