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 -->
<div class="border">
<div>
<h6> Edit Carts</h6> <!-- Editing Carts -->
<h6> Edit Carts</h6> <!-- Edit Carts -->
{{#momentum plugin='slide-fade'}}
{{#each carts}}
<div class="row-admin">

View File

@ -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 === "")))

View File

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

View File

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

View File

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

View File

@ -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();
}

View File

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