55 lines
1.3 KiB
JavaScript
Raw Normal View History

Template.admin.helpers({
chromebooks: function() {
return Chromebooks.find({}, {sort: {number: 1}});
2015-01-11 20:41:35 -05:00
},
carts: function() {
return carts.find();
2015-01-12 21:13:48 -05:00
},
2015-01-11 19:29:30 -05:00
tabs: function () {
// Every tab object MUST have a name and a slug!
return [
{ name: 'Single', slug: 'single' },
{ name: 'Carts', slug: 'carts' }
];
}
});
2015-01-12 21:13:48 -05:00
ReactiveTabs.createInterface({
template: 'teacherTabs',
onChange: function (slug, template) {
}
});
Template.admin.events({
2015-02-07 11:27:10 -05:00
"submit .add, click .add": function () {
Meteor.call('addchromebook', $("input[name='anumber']")[0].value, $("input[name='aserial']")[0].value);
2015-01-01 23:20:45 -05:00
$("input[name='anumber']")[0].value = "";
$("input[name='aserial']")[0].value = "";
2015-02-07 11:27:10 -05:00
$("input[name='anumber']")[0].focus();
return false;
2015-01-01 23:20:45 -05:00
},
2015-01-11 20:41:35 -05:00
2015-02-07 11:27:10 -05:00
"submit .addc, click .addc": function (event) {
Meteor.call('addcart', $("input[name='acnumber']")[0].value);
2015-01-11 20:41:35 -05:00
$("input[name='acnumber']")[0].value = "";
return false;
},
2015-02-07 11:27:10 -05:00
2015-01-01 23:20:45 -05:00
'click .cross' : function() {
2015-02-07 11:27:10 -05:00
Meteor.call('removechromebook', this);
2015-01-01 23:20:45 -05:00
},
2015-02-07 11:27:10 -05:00
2015-01-11 20:41:35 -05:00
'click .crossc' : function() {
2015-02-07 11:27:10 -05:00
Meteor.call('removecart', this);
2015-01-11 20:41:35 -05:00
},
2015-02-07 11:27:10 -05:00
2015-01-11 20:41:35 -05:00
'click .yieldc' : function() {
2015-02-07 11:27:10 -05:00
Meteor.call('yieldcart', this);
2015-01-11 20:41:35 -05:00
},
2015-02-07 11:27:10 -05:00
2015-01-01 23:20:45 -05:00
'click .yield' : function() {
2015-02-07 11:27:10 -05:00
Meteor.call('yieldchromebook', this);
}
2015-01-18 18:57:17 -05:00
});