Added working chromebooks
This commit is contained in:
parent
88dbc7685d
commit
c252846509
@ -3,12 +3,17 @@
|
|||||||
<h5 class="titleword">Chromebook Checkout</h5>
|
<h5 class="titleword">Chromebook Checkout</h5>
|
||||||
<div id="tabs">
|
<div id="tabs">
|
||||||
{{#teacherTabs tabs=tabs}}
|
{{#teacherTabs tabs=tabs}}
|
||||||
|
<!-- Single -->
|
||||||
<div>
|
<div>
|
||||||
|
{{#each chromebooks}}
|
||||||
|
<div class="row">
|
||||||
{{> chromebook}}
|
{{> chromebook}}
|
||||||
</div>
|
</div>
|
||||||
|
{{/each}}
|
||||||
|
</div>
|
||||||
|
<!-- Carts -->
|
||||||
<div>
|
<div>
|
||||||
<h2>Bye</h2>
|
<h5>Coming soon...</h5>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{/teacherTabs}}
|
{{/teacherTabs}}
|
||||||
|
|||||||
@ -17,3 +17,32 @@ Template.teacher.helpers({
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
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