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