-
Notifications
You must be signed in to change notification settings - Fork 0
/
tabs.html
315 lines (275 loc) · 8.3 KB
/
tabs.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
<head>
<title>New Page</title>
<meta name="viewport" content="width=device-width">
<!-- <link rel="stylesheet" href="https://netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css"> -->
<!-- <script type="text/javascript" src="https://netdna.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.min.js"></script> -->
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<!-- <script type="text/javascript" src="http://cdn.jquerytools.org/1.2.5/full/jquery.tools.min.js"></script> -->
<script type="text/javascript" src="http://blattchat.com/demos/typeahead/js/bootstrap-typeahead.js"></script>
<link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
<!-- <script type="text/javascript" src="typeahead.js/typeahead.min.js"></script> -->
<!-- <script src="http://cdn.jquerytools.org/1.2.6/jquery.tools.min.js" type="text/javascript"></script> -->
<!-- <script type="text/javascript" "src=http://view.jqueryui.com/master/ui/jquery.ui.tooltip.js" ></script> -->
<link rel="stylesheet" href="tabs.css">
<meta name="viewport" content="width=device-width,initial-scale=1">
</head>
<body>
<script type="text/javascript" src="client/FileSaver1.js"></script>
<div class="navbar navbar-static-top navbar-inverse">
<div class="navbar-inner">
<div class="container">
<a class="brand">Tabber</a>
<ul class="nav pull-right">
<li>
{{> loginButtons}}
</li>
</ul>
</div>
</div>
</div>
<button class="pull-right" id="hide_button"> Hide </button>
{{>delete_stuff}}
{{>main}}
</body>
<template name="main" >
{{>add_cash}}
{{>inc_price}}
{{#if is_mobile}}
{{#unless is_user}}
{{>banner}}
{{else}}
{{#unless has_funds}}
{{>need_credit}}
{{else}}
{{>main_ui}}
{{/unless}}
{{/unless}}
{{else}}
{{>main_ui}}
{{/if}}
</template>
<template name="dates_selector" >
<select class="form-control">
{{#each dates}}
<option value="{{ this.[0] }}">{{this.[1]}}</option>
{{/each}}
</select>
</template>
<template name="banner">
<div class="container">
<div class="row">
<div class="span6">
<div class="well">
<h4 class="banner_signin">Sign in using Twitter or Facebook to start tracking your drinks</h4>
{{> loginButtons}}
</div>
</div>
</div>
</div>
</template>
<template name="need_credit">
<div class="container">
<div class="row">
<div class="span6">
<div class="well">
<h4 class="banner_signin">It looks like you're out of credit. Prepay your tab by giving money to the host of the pregame. Any money left at the end of the night can be refunded to you, or stored for the next pregame.</h4>
</div>
</div>
</div>
</div>
</template>
<template name="main_ui">
<div class="container" id="slide_div">
<div class="container" id="main_container" >
<h1 ><center href="#">Tabs</center></h1>
<div class="row">
<div id="clients" class="col-md-4">
<label class="control-label">Name</label>
{{>client}}
{{>client_form}}
</div>
<div class="col-md-7">
<div class="list-group">
<label class="control-label">Drinks</label>
{{>drink}}
{{>drink_form}}
</div>
<button class="select-all" id="select_all">Select All</button>
<button class="" title="Select this button and select one or more people to split the price of the next selected drink" id="split_tab"> Split Tab</button>
</div>
</div>
</div>
<div class="container douche-container">
<table class="table smaller ui-responsive table-stroke" border="1" cellpadding="1" data-role="table" data-mode="reflow">
<tr>
<td>
<label>Name</label>
</td>
<td>
<label>Credits</label>
</td>
<td>
<div class="pull-left">
<label>Drinks</label>
</div>
<div class="pull-right">
{{>dates_selector}}
</div>
</td>
</tr>
<tbody>
{{>drink_table}}
</tbody>
</table>
<a href="#" id="csv_clients"> Download Client CSV</a>
<a href="#" id="csv_drinks"> Download Drinks CSV</a>
</div>
</div>
<div class="" id="hidden_container" >
{{>confirmation}}
</div>
</template>
<template name="confirmation">
<div class="container" id="confirm_container">
<h1 ><center id="confirm" href="#">Confirmation</center></h1>
<div class="row">
<div class="col-md-4">
<center>
<label class="control-label">Name</label>
</center>
{{#each clients}}
<center>
<label class="label"> {{name}} </label>
</center>
{{/each}}
</div>
<div class="col-md-4">
<center>
<label class="control-label">Remaining Balance</label>
</center>
{{#each clients}}
<center>
<label class="label"> {{credit}} </label>
</center>
{{/each}}
</div>
<div class="col-md-4">
<div class="list-group">
<center>
<thead>
<label class="control-label">Drink</label>
</thead>
</center>
{{#each clients}}
<center>
<label class="label"> {{drink_name}} </label>
</center>
{{/each}}
</div>
</div>
</div>
<center>
<button class="btn cancel">Cancel</button>
<button class="btn confirm">Confirm</button>
</center>
</div>
</template>
<template name="drink_table" >
{{#each clients}}
<tr>
<td>
{{client_name}}
</td>
<td>
{{ credit }}
</td>
<td>
<table class="table drink-table smaller ui-responsive table-stroke" border="1" cellpadding="1" data-role="table" data-mode="reflow">
{{#if drinks}}
<tr>
<td>
<label> Drink Name</label>
</td>
<td>
<label>Number</label>
</td>
<td>
<label>Price</label>
</td>
<td>
<label>Date</label>
</td>
</tr>
<tbody>
{{#each drinks}}
<tr>
<td>
{{name}}
</td>
<td>
{{number}}
</td>
<td>
{{price}}
</td>
<td>
{{day}}
</td>
</tr>
{{/each}}
</tbody>
{{/if}}
{{#unless drinks}}
No drinks logged today, wuss
{{/unless}}
</table>
</td>
</tr>
{{/each}}
</template>
<template name="drink_form">
<form id="drink_form">
<div>
<input type="text" name="drink_name" class="typeahead form-control" placeholder="Drink Name" autocomplete="off">
</div>
<div style="float:right;width:30%;">
<input type="text" name="price" class="form-control" placeholder="Price">
</div>
</form>
</template>
<template name="drink">
{{#each drinks}}
<button name="drink" drink_id={{_id}}>
<div class="pull-left">
({{available}}) {{drink_name}}
</div>
<div class="pull-right">${{price}}
</div>
</button>
{{/each}}
</template>
<template name="client_form">
<form id="client_form">
<input autocomplete="off" class="typeahead form-control" name="client-name" type="text" placeholder="Type a name here">
</form>
</template>
<template name="client">
{{#each clients}}
<button name="client" client_id="{{_id}}">
<div >{{client_name}}
</div>
</button>
{{/each}}
</template>
<template name="add_cash">
<input type="text" class="{{hidden}}" placeholder="Number to add" id="add_cash">
</template>
<template name="inc_price">
<input type="text" class="{{hidden}}" placeholder="Increment Price By" id="inc_price">
</template>
<template name="delete_stuff">
<button class="pull-right {{hidden}}" id="delete_button"> Delete </button>
</template>
<!-- <div> -->
<!-- </div> -->