diff --git a/chromebook-checkout-meteor/client/teacher.html b/chromebook-checkout-meteor/client/teacher.html
index 0542b09..46c1f32 100644
--- a/chromebook-checkout-meteor/client/teacher.html
+++ b/chromebook-checkout-meteor/client/teacher.html
@@ -3,13 +3,18 @@
Chromebook Checkout
{{#teacherTabs tabs=tabs}}
+
- {{> chromebook}}
+ {{#each chromebooks}}
+
+ {{> chromebook}}
+
+ {{/each}}
+
+
+
+
Coming soon...
-
-
-
Bye
-
{{/teacherTabs}}
diff --git a/chromebook-checkout-meteor/client/teacher.js b/chromebook-checkout-meteor/client/teacher.js
index fe859e6..144264e 100644
--- a/chromebook-checkout-meteor/client/teacher.js
+++ b/chromebook-checkout-meteor/client/teacher.js
@@ -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");
+ }
+ }
});
\ No newline at end of file