diff --git a/chromebook-checkout-meteor/client/admin.html b/chromebook-checkout-meteor/client/admin.html index 75a1197..1814b3a 100644 --- a/chromebook-checkout-meteor/client/admin.html +++ b/chromebook-checkout-meteor/client/admin.html @@ -3,48 +3,48 @@
Admin Panel
- {{#teacherTabs tabs=tabs}} + {{#teacherTabs tabs=tabs}} -
+
Edit Chromebooks
{{#momentum plugin='slide-fade'}} - {{#each chromebooks}} -
- {{> chromebook}} - - -
- {{/each}} - {{/momentum}} + {{#each chromebooks}} +
+ {{> chromebook}} + + +
+ {{/each}} + {{/momentum}}
Add a Chromebook
-
+
-
+
-
Edit Carts
+
Edit Carts
{{#momentum plugin='slide-fade'}} - {{#each carts}} -
- {{>cart}} - - -
- {{/each}} - {{/momentum}} -
Add a Cart
+ {{#each carts}} +
+ {{>cart}} + + +
+ {{/each}} + {{/momentum}} +
Add a Cart
+
-
- {{/teacherTabs}} + {{/teacherTabs}} \ No newline at end of file diff --git a/chromebook-checkout-meteor/client/admin.js b/chromebook-checkout-meteor/client/admin.js index eb1f901..77f1f6e 100644 --- a/chromebook-checkout-meteor/client/admin.js +++ b/chromebook-checkout-meteor/client/admin.js @@ -26,6 +26,21 @@ Template.admin.events({ var chromebook_number = $("input[name='anumber']")[0].value; var chromebook_serial = $("input[name='aserial']")[0].value; + var currNumbers = Chromebooks.find({ number: chromebook_number }).fetch(); + var currSerials = Chromebooks.find({ serial: chromebook_serial }).fetch(); + + if(currNumbers.length !== 0) { + alert("That Chromebook already exists!"); + $("input[name='anumber']")[0].value = ""; + $("input[name='anumber']")[0].focus(); + throw new Error("That Chromebook already exists!"); + } + if(currSerials.length !== 0) { + alert("That serial number already exists!"); + $("input[name='aserial']")[0].value = ""; + $("input[name='aserial']").focus(); + throw new Error("That serial number already exists!"); + } if (!((chromebook_number === "") || (chromebook_serial === ""))) diff --git a/chromebook-checkout-meteor/client/cart.html b/chromebook-checkout-meteor/client/cart.html index 1e69e7a..c7b1557 100644 --- a/chromebook-checkout-meteor/client/cart.html +++ b/chromebook-checkout-meteor/client/cart.html @@ -1,14 +1,11 @@ \ No newline at end of file diff --git a/chromebook-checkout-meteor/client/checkout.html b/chromebook-checkout-meteor/client/checkout.html index 71671da..8db2b17 100644 --- a/chromebook-checkout-meteor/client/checkout.html +++ b/chromebook-checkout-meteor/client/checkout.html @@ -1,18 +1,18 @@ \ No newline at end of file diff --git a/chromebook-checkout-meteor/client/chromebook.html b/chromebook-checkout-meteor/client/chromebook.html index a6ff9ce..e95f70b 100644 --- a/chromebook-checkout-meteor/client/chromebook.html +++ b/chromebook-checkout-meteor/client/chromebook.html @@ -1,14 +1,14 @@ diff --git a/chromebook-checkout-meteor/client/initial.html b/chromebook-checkout-meteor/client/initial.html index 3981bae..44beb28 100644 --- a/chromebook-checkout-meteor/client/initial.html +++ b/chromebook-checkout-meteor/client/initial.html @@ -1,10 +1,10 @@ diff --git a/chromebook-checkout-meteor/client/login.html b/chromebook-checkout-meteor/client/login.html index 7904ef1..ad4bb71 100644 --- a/chromebook-checkout-meteor/client/login.html +++ b/chromebook-checkout-meteor/client/login.html @@ -1,10 +1,10 @@ \ No newline at end of file diff --git a/chromebook-checkout-meteor/client/main.html b/chromebook-checkout-meteor/client/main.html index fb46411..d883f27 100644 --- a/chromebook-checkout-meteor/client/main.html +++ b/chromebook-checkout-meteor/client/main.html @@ -2,6 +2,5 @@ IA Chromebook Checkout - diff --git a/chromebook-checkout-meteor/client/slide-fade.js b/chromebook-checkout-meteor/client/slide-fade.js index 3f56736..ee290db 100644 --- a/chromebook-checkout-meteor/client/slide-fade.js +++ b/chromebook-checkout-meteor/client/slide-fade.js @@ -11,6 +11,7 @@ Momentum.registerPlugin('slide-fade', function(options) { $node .hide() .insertBefore(next) + .css('height', $node.height()) .velocity('fadeIn') .velocity('slideDown', { easing: options.easing, @@ -31,6 +32,7 @@ Momentum.registerPlugin('slide-fade', function(options) { easing: options.easing, duration: options.duration, complete: function() { + $node.velocity('fadeOut'); $node.remove(); done(); } diff --git a/chromebook-checkout-meteor/client/teacher.html b/chromebook-checkout-meteor/client/teacher.html index 06d44f9..af58777 100644 --- a/chromebook-checkout-meteor/client/teacher.html +++ b/chromebook-checkout-meteor/client/teacher.html @@ -1,35 +1,35 @@ \ No newline at end of file