neater html, no overlapping chromebooks/serials
This commit is contained in:
parent
e096b7eb7c
commit
4b924fc30e
@ -3,48 +3,48 @@
|
||||
<div>
|
||||
<h5>Admin Panel</h5>
|
||||
</div>
|
||||
{{#teacherTabs tabs=tabs}}
|
||||
{{#teacherTabs tabs=tabs}}
|
||||
<!-- Single -->
|
||||
<div class="border">
|
||||
<div class="border">
|
||||
<div>
|
||||
<h6>Edit Chromebooks</h6> <!-- Edit Chromebooks -->
|
||||
{{#momentum plugin='slide-fade'}}
|
||||
{{#each chromebooks}}
|
||||
<div class="row-admin">
|
||||
{{> chromebook}}
|
||||
<i class="icons yield fa fa-exclamation-triangle fa-lg"></i>
|
||||
<i class="icons cross fa fa-times fa-lg"></i>
|
||||
</div>
|
||||
{{/each}}
|
||||
{{/momentum}}
|
||||
{{#each chromebooks}}
|
||||
<div class="row-admin">
|
||||
{{> chromebook}}
|
||||
<i class="icons yield fa fa-exclamation-triangle fa-lg"></i>
|
||||
<i class="icons cross fa fa-times fa-lg"></i>
|
||||
</div>
|
||||
{{/each}}
|
||||
{{/momentum}}
|
||||
<h6>Add a Chromebook</h6> <!-- Add Chromebooks -->
|
||||
<form class="new-task">
|
||||
<input type="text" name="anumber" placeholder="Chromebook Number (eg. B1)" class="submission" />
|
||||
<input type="text" name="aserial" placeholder="Serial Number (eg. ABCD1234)" class="submission"/>
|
||||
<input type="submit" value="Submit" class="add" />
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Carts -->
|
||||
<div class="border">
|
||||
<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">
|
||||
{{>cart}}
|
||||
<i class="icons yieldc fa fa-exclamation-triangle fa-lg"></i>
|
||||
<i class="icons crossc fa fa-times fa-lg"></i>
|
||||
</div>
|
||||
{{/each}}
|
||||
{{/momentum}}
|
||||
<h6>Add a Cart</h6> <!-- Adding Carts -->
|
||||
{{#each carts}}
|
||||
<div class="row-admin">
|
||||
{{>cart}}
|
||||
<i class="icons yieldc fa fa-exclamation-triangle fa-lg"></i>
|
||||
<i class="icons crossc fa fa-times fa-lg"></i>
|
||||
</div>
|
||||
{{/each}}
|
||||
{{/momentum}}
|
||||
<h6>Add a Cart</h6> <!-- Adding Carts -->
|
||||
<form class="new-task">
|
||||
<input type="text" name="acnumber" placeholder="Cart Number (ex. A)" class="submission"/>
|
||||
<input type="submit" value="Submit" class="add, addc" />
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{/teacherTabs}}
|
||||
{{/teacherTabs}}
|
||||
</div>
|
||||
</template>
|
||||
@ -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 === "")))
|
||||
|
||||
|
||||
@ -1,14 +1,11 @@
|
||||
<template name="cart">
|
||||
<div class="cart chromebook {{status_class}} {{url}}">
|
||||
<p class="pure-u-3-5">Cart {{number}}</p>
|
||||
{{#if status }}
|
||||
<div class="timestamp pure-u-2-5">
|
||||
<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>
|
||||
<div class="cart chromebook {{status_class}} {{url}}">
|
||||
<p class="pure-u-3-5">Cart {{number}}</p>
|
||||
{{#if status }}
|
||||
<div class="timestamp pure-u-2-5">
|
||||
<p class="user"> <b>{{user}}</b></p>
|
||||
<p class="time">{{time_ago}}</p>
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
</template>
|
||||
@ -1,18 +1,18 @@
|
||||
<template name="checkout">
|
||||
<div class="main-center">
|
||||
<div>
|
||||
<h5>Chromebook Checkout</h5>
|
||||
</div>
|
||||
<div class="chckBorder">
|
||||
<div class="chckChromebooks">
|
||||
{{#momentum plugin='slide-fade'}}
|
||||
{{#each chromebooks}}
|
||||
<div class="row">
|
||||
{{> chromebook}}
|
||||
</div>
|
||||
{{/each}}
|
||||
{{/momentum}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="main-center">
|
||||
<div>
|
||||
<h5>Chromebook Checkout</h5>
|
||||
</div>
|
||||
<div class="chckBorder">
|
||||
<div class="chckChromebooks">
|
||||
{{#momentum plugin='slide-fade'}}
|
||||
{{#each chromebooks}}
|
||||
<div class="row">
|
||||
{{> chromebook}}
|
||||
</div>
|
||||
{{/each}}
|
||||
{{/momentum}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@ -1,14 +1,14 @@
|
||||
<template name="chromebook">
|
||||
<div class="chromebook {{status_class}} {{url}}">
|
||||
<p class="pure-u-3-5">Chromebook #{{number}}</p>
|
||||
{{#if status}}
|
||||
<div class="timestamp pure-u-2-5">
|
||||
<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>
|
||||
<div class="chromebook {{status_class}} {{url}}">
|
||||
<p class="pure-u-3-5">Chromebook #{{number}}</p>
|
||||
{{#if status}}
|
||||
<div class="timestamp pure-u-2-5">
|
||||
<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>
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
<template name="initial">
|
||||
<div class="initial">
|
||||
<h5>Chromebook Checkout</h5>
|
||||
<button class="submit">Checkout!</button>
|
||||
<h5>Chromebook Checkout</h5>
|
||||
<button class="submit">Checkout!</button>
|
||||
</div>
|
||||
<div class="bottom">
|
||||
<p class="bottom">Checkout a chromebook.</p>
|
||||
<img class="chromeicon" src="ico/chrico.png">
|
||||
<p class="bottom">Checkout a chromebook.</p>
|
||||
<img class="chromeicon" src="ico/chrico.png">
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
<template name="login">
|
||||
<div class="initial">
|
||||
<h5>Chromebook Checkout</h5>
|
||||
{{> loginButtons}}
|
||||
</div>
|
||||
<div class="bottom">
|
||||
<p class="bottom">Checkout a chromebook.</p>
|
||||
<img class="chromeicon" src="ico/chrico.png">
|
||||
</div>
|
||||
<div class="initial">
|
||||
<h5>Chromebook Checkout</h5>
|
||||
{{> loginButtons}}
|
||||
</div>
|
||||
<div class="bottom">
|
||||
<p class="bottom">Checkout a chromebook.</p>
|
||||
<img class="chromeicon" src="ico/chrico.png">
|
||||
</div>
|
||||
</template>
|
||||
@ -2,6 +2,5 @@
|
||||
<title>IA Chromebook Checkout</title>
|
||||
<link rel="icon" href="ico/favicon.png">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
</body>
|
||||
|
||||
@ -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();
|
||||
}
|
||||
|
||||
@ -1,35 +1,35 @@
|
||||
<template name="teacher">
|
||||
<div class="main-center-admin">
|
||||
<div class="main-center-admin">
|
||||
<div>
|
||||
<h5>Chromebook Checkout</h5>
|
||||
</div>
|
||||
{{#teacherTabs tabs=tabs}}
|
||||
<!-- Single -->
|
||||
<div class="tchChromebooks">
|
||||
<div>
|
||||
<h5>Chromebook Checkout</h5>
|
||||
</div>
|
||||
{{#teacherTabs tabs=tabs}}
|
||||
<!-- Single -->
|
||||
<div class="tchChromebooks">
|
||||
<div>
|
||||
<div>
|
||||
{{#momentum plugin='slide-fade'}}
|
||||
{{#each chromebooks}}
|
||||
<div class="row">
|
||||
{{> chromebook}}
|
||||
</div>
|
||||
{{/each}}
|
||||
{{/momentum}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Carts -->
|
||||
<div class="tchChromebooks">
|
||||
<div>
|
||||
{{#momentum plugin='slide-fade'}}
|
||||
{{#each carts}}
|
||||
<div>
|
||||
{{#momentum plugin='slide-fade'}}
|
||||
{{#each chromebooks}}
|
||||
<div class="row">
|
||||
{{>cart}}
|
||||
{{> chromebook}}
|
||||
</div>
|
||||
{{/each}}
|
||||
{{/momentum}}
|
||||
</div>
|
||||
</div>
|
||||
{{/teacherTabs}}
|
||||
{{/momentum}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Carts -->
|
||||
<div class="tchChromebooks">
|
||||
<div>
|
||||
{{#momentum plugin='slide-fade'}}
|
||||
{{#each carts}}
|
||||
<div class="row">
|
||||
{{> cart}}
|
||||
</div>
|
||||
{{/each}}
|
||||
{{/momentum}}
|
||||
</div>
|
||||
</div>
|
||||
{{/teacherTabs}}
|
||||
</div>
|
||||
</template>
|
||||
Loading…
x
Reference in New Issue
Block a user