-
Notifications
You must be signed in to change notification settings - Fork 0
/
inventory.html
82 lines (78 loc) · 3.64 KB
/
inventory.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<template name="inventory">
<div id="container">
<h1>Inventory</h1>
{{>modal}}
{{>alert}}
<center>
Search: <input type="text" id="itemName"> <br><br>
<button type="button" class="btn btn-default toggleSort">Oldest First</button> <button type="button" class="btn btn-default toggleExpand">Collapse all</button></center>
{{#each itemNames}}
{{>itemHeader}}
<div class="item{{this}} toggable">
{{#each getItem this}}
{{>item}}
{{/each}}
</div>
{{/each}}
</div>
</template>
<template name = "itemHeader">
<div class="itemHeader {{worstQuality this}} panel panel-default">
<div class="panel-body">
<img src="{{getImgSrc this}}" class="icon" height="50" width="50"/>
<div class="info" style="float: left;">
<h4><span class="headerName" contenteditable="true"> {{this}} </span></h4> x<span class="quantity">{{totalQuantity this}}</span>
<br>
Soonest Expires: <input type="date" class="expDate" value="{{soonestExp this}}" readonly> <br>({{daysTilExp this}})
</div>
<span class="item_buttons">
</span>
<div class="clear"></div>
</div>
</div>
</template>
<template name="item">
<div class="item {{quality exp_date}} panel panel-default">
<div class="panel-body">
<img src="{{img_src}}" class="icon" height="50" width="50"/>
<div class="info" style="float: left;">
<h4><span class="item_name" contenteditable="true"> {{name}} </span></h4> x<span class="quantity"> {{quantity}} </span>
<button type="button" class="btn btn-default plus"><span class="glyphicon glyphicon-plus-sign"></span></button>
<button type="button" class="btn btn-default minus"><span class="glyphicon glyphicon-minus-sign"></span></button>
<br>
Expires: <input type="date" class="expDate {{_id}}" value="{{exp_date}}"> ({{daysTilExp exp_date}})
</div>
<span class="item_buttons">
<button type="button" class="btn btn-default trash" data-toggle="modal" data-target="#trashModal"><span class="glyphicon glyphicon-trash"></span></button>
</span>
<div class="clear"></div>
</div>
</div>
</template>
<template name="modal">
<div class="modal fade" id="trashModal" tabindex="-1" role="dialog" aria-labelledby="trashModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" id="trashModalLabel">Trashing <span id="trashItem"></span></h4>
</div>
<div class="modal-body">
<button type="button" class="btn btn-default" id="btnDecrement"><span class="glyphicon glyphicon-minus-sign"></span></button>
<input type="number" id="quantity" value="1">
<button type="button" class="btn btn-default" id="btnIncrement"><span class="glyphicon glyphicon-plus-sign"></span></button>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" data-dismiss="modal" id="trashSelected">Trash Selected</button>
<button type="button" class="btn btn-primary" data-dismiss="modal" id="trashAll">Trash All</button>
</div>
</div>
</div>
</div>
</template>
<template name="alert">
<div class="alert alert-warning fade in" style="display: none;">
<button type="button" class="close" aria-hidden="true">×</button>
<strong> {{getAlertItemName}} </strong> {{getAlertAction}}.
</div>
</template>