neater html, no overlapping chromebooks/serials

This commit is contained in:
ksjdragon 2015-02-01 18:03:33 -05:00
parent e096b7eb7c
commit 4b924fc30e
10 changed files with 118 additions and 105 deletions

View File

@ -28,7 +28,7 @@
<!-- Carts --> <!-- Carts -->
<div class="border"> <div class="border">
<div> <div>
<h6> Edit Carts</h6> <!-- Editing Carts --> <h6> Edit Carts</h6> <!-- Edit Carts -->
{{#momentum plugin='slide-fade'}} {{#momentum plugin='slide-fade'}}
{{#each carts}} {{#each carts}}
<div class="row-admin"> <div class="row-admin">

View File

@ -26,6 +26,21 @@ Template.admin.events({
var chromebook_number = $("input[name='anumber']")[0].value; var chromebook_number = $("input[name='anumber']")[0].value;
var chromebook_serial = $("input[name='aserial']")[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 === ""))) if (!((chromebook_number === "") || (chromebook_serial === "")))

View File

@ -6,9 +6,6 @@
<p class="user"> <b>{{user}}</b></p> <p class="user"> <b>{{user}}</b></p>
<p class="time">{{time_ago}}</p> <p class="time">{{time_ago}}</p>
</div> </div>
<!-- <div class="cross pure-u-2-5">
<i class="fa fa-times"></i>
</div> -->
{{/if}} {{/if}}
</div> </div>
</template> </template>

View File

@ -1,5 +1,5 @@
<template name="login"> <template name="login">
<div class="initial"> <div class="initial">
<h5>Chromebook Checkout</h5> <h5>Chromebook Checkout</h5>
{{> loginButtons}} {{> loginButtons}}
</div> </div>

View File

@ -2,6 +2,5 @@
<title>IA Chromebook Checkout</title> <title>IA Chromebook Checkout</title>
<link rel="icon" href="ico/favicon.png"> <link rel="icon" href="ico/favicon.png">
</head> </head>
<body> <body>
</body> </body>

View File

@ -11,6 +11,7 @@ Momentum.registerPlugin('slide-fade', function(options) {
$node $node
.hide() .hide()
.insertBefore(next) .insertBefore(next)
.css('height', $node.height())
.velocity('fadeIn') .velocity('fadeIn')
.velocity('slideDown', { .velocity('slideDown', {
easing: options.easing, easing: options.easing,
@ -31,6 +32,7 @@ Momentum.registerPlugin('slide-fade', function(options) {
easing: options.easing, easing: options.easing,
duration: options.duration, duration: options.duration,
complete: function() { complete: function() {
$node.velocity('fadeOut');
$node.remove(); $node.remove();
done(); done();
} }

View File

@ -24,7 +24,7 @@
{{#momentum plugin='slide-fade'}} {{#momentum plugin='slide-fade'}}
{{#each carts}} {{#each carts}}
<div class="row"> <div class="row">
{{>cart}} {{> cart}}
</div> </div>
{{/each}} {{/each}}
{{/momentum}} {{/momentum}}