2014-12-23 21:09:30 -05:00
|
|
|
Template.checkout.helpers({
|
|
|
|
|
chromebooks: function() {
|
2015-01-28 21:37:43 -05:00
|
|
|
return Chromebooks.find({}, {sort: {number: 1}});
|
2014-12-23 21:09:30 -05:00
|
|
|
}
|
2015-01-01 00:57:53 -05:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Template.checkout.events({
|
2015-01-01 02:39:39 -05:00
|
|
|
'click .edit': function() {
|
|
|
|
|
if (Roles.userIsInRole(Meteor.userId(), ['admin'])) {
|
|
|
|
|
Router.go('/admin');
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
alert("Access Denied");
|
|
|
|
|
}
|
2015-01-11 23:35:30 -05:00
|
|
|
},
|
|
|
|
|
'click .teacher': function() {
|
|
|
|
|
if (Roles.userIsInRole(Meteor.userId(), ['admin', 'teacher'])) {
|
|
|
|
|
Router.go('/teacher');
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
alert("Access Denied");
|
|
|
|
|
}
|
2015-01-01 00:57:53 -05:00
|
|
|
}
|
2015-01-18 18:57:17 -05:00
|
|
|
});
|
|
|
|
|
Template.checkout.rendered = function() {
|
|
|
|
|
|
|
|
|
|
$(".chckChromebooks").mCustomScrollbar({
|
2015-01-28 21:37:43 -05:00
|
|
|
theme: 'dark',
|
|
|
|
|
scrollInertia: 0,
|
2015-01-31 22:32:23 -05:00
|
|
|
mouseWheelPixels: 40,
|
|
|
|
|
contentTouchScroll: 30
|
2015-01-18 18:57:17 -05:00
|
|
|
});
|
|
|
|
|
}
|