Added working chromebooks
This commit is contained in:
parent
88dbc7685d
commit
c252846509
@ -3,13 +3,18 @@
|
||||
<h5 class="titleword">Chromebook Checkout</h5>
|
||||
<div id="tabs">
|
||||
{{#teacherTabs tabs=tabs}}
|
||||
<!-- Single -->
|
||||
<div>
|
||||
{{> chromebook}}
|
||||
{{#each chromebooks}}
|
||||
<div class="row">
|
||||
{{> chromebook}}
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
<!-- Carts -->
|
||||
<div>
|
||||
<h5>Coming soon...</h5>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h2>Bye</h2>
|
||||
</div>
|
||||
|
||||
{{/teacherTabs}}
|
||||
</div>
|
||||
|
||||
@ -16,4 +16,33 @@ Template.teacher.helpers({
|
||||
{ name: 'Carts', slug: 'carts' }
|
||||
];
|
||||
}
|
||||
});
|
||||
|
||||
Template.teacher.helpers({
|
||||
chromebooks: function() {
|
||||
return Chromebooks.find();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Template.teacher.events({
|
||||
'click .cross' : function() {
|
||||
if (Roles.userIsInRole(Meteor.userId(), ['admin'])) {
|
||||
if (this.status === 0) {
|
||||
Chromebooks.update(this._id, {$set: {status: 2}});
|
||||
Chromebooks.update(this._id, {$set: {user: null}});
|
||||
}
|
||||
else if (this.status ===1) {
|
||||
Chromebooks.update(this._id, {$set: {status: 2}});
|
||||
}
|
||||
else {
|
||||
Chromebooks.update(this._id, {$set: {status: 0}});
|
||||
Chromebooks.update(this._id, {$set: {last_checkout: null}});
|
||||
Chromebooks.update(this._id, {$set: {userid: null}});
|
||||
}
|
||||
}
|
||||
else {
|
||||
alert("Access Denied");
|
||||
}
|
||||
}
|
||||
});
|
||||
Loading…
x
Reference in New Issue
Block a user