2015-01-31 22:32:23 -05:00

33 lines
718 B
JavaScript

Template.checkout.helpers({
chromebooks: function() {
return Chromebooks.find({}, {sort: {number: 1}});
}
});
Template.checkout.events({
'click .edit': function() {
if (Roles.userIsInRole(Meteor.userId(), ['admin'])) {
Router.go('/admin');
}
else {
alert("Access Denied");
}
},
'click .teacher': function() {
if (Roles.userIsInRole(Meteor.userId(), ['admin', 'teacher'])) {
Router.go('/teacher');
}
else {
alert("Access Denied");
}
}
});
Template.checkout.rendered = function() {
$(".chckChromebooks").mCustomScrollbar({
theme: 'dark',
scrollInertia: 0,
mouseWheelPixels: 40,
contentTouchScroll: 30
});
}