This repository has been archived by the owner on Apr 30, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsigns.html
421 lines (397 loc) · 16.2 KB
/
signs.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
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
<!doctype html>
<!--suppress HtmlUnknownAnchorTarget -->
<html lang="en" ng-app="Signs">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<title>Beställ skyltar online</title>
<!--<script src="bower_components/circular-json/build/circular-json.js"></script>-->
<script src="bower_components/sweetalert/lib/sweet-alert.min.js"></script>
<link rel="stylesheet" href="bower_components/sweetalert/lib/sweet-alert.css"/>
<script src="bower_components/konva/konva.min.js"></script>
<script src="bower_components/jquery/dist/jquery.min.js"></script>
<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.min.css"/>
<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap-theme.css"/>
<script src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<script src="bower_components/jszip/dist/jszip.min.js"></script>
<script src="bower_components/js-xls/dist/xls.min.js"></script>
<script src="bower_components/js-xlsx/dist/xlsx.min.js"></script>
<script src="bower_components/angular/angular.min.js"></script>
<script src="bower_components/ngModal/dist/ng-modal.min.js"></script>
<link rel="stylesheet" href="bower_components/ngModal/dist/ng-modal.css"/>
<script src='bower_components/angular-file-model/angular-file-model.js'></script>
<script src="signs.js"></script>
<link rel="stylesheet" href="style/signs.css"/>
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link rel="icon" href="favicon.ico" type="image/x-icon">
</head>
<body>
<div class="container" ng-controller="modelsController">
<div class="row">
<div class="col-md-2">
<!--<h3>Pris: <span class="label" ng-class="(calcPrice() == 0) ? 'label-danger' : 'label-success'">{{calcPrice()}} kr</span>
</h3>-->
</div>
<div class="col-md-6">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">Skyltnamn</span>
<input maxlength="22" ng-value="model.name" ng-model="model.name" type="text" class="form-control"
placeholder="Skyltnamn" aria-describedby="basic-addon1">
</div>
</div>
<div class="col-md-4">
<!--<ul class="nav nav-pills" ng-controller="materialsController">
<li class="disabled" role="presentation"><a href="#">Material:</a></li>
<li role="presentation" ng-class="{'active': model.material == material}"
ng-repeat="material in materials">
<a ng-click="changeMaterial(material)"
href="#/">{{material}}</a></li>
</ul>-->
</div>
</div>
<div class="row info-panel">
<div class="col-md-2">
</div>
<div class="col-md-6 error-block">
<div ng-show="sizeError != null" class="alert alert-danger error" role="alert">
<strong class="error-message">{{sizeError}}!</strong>
</div>
</div>
<div class="col-md-4">
</div>
</div>
<div class="row">
<div class="col-md-2 aside">
<h4>Skyltar:</h4>
<div ng-repeat="model in models track by $index" class="sign">
<div class="btn-group btn-group-justified input-group models" role="group">
<div class="btn-group model">
<button id="sign" ng-click="updateCurrentModel($index)"
ng-class="{'active': $index == current}" class="btn btn-block btn-default">
{{model.name | limitTo: 9}}{{model.name.length > 9 ? '...' : ''}}
</button>
</div>
<div class="input-group-btn number-addon">
<input min="0" class="number form-control" type="number" ng-model="model.order"
ng-value="model.order" onkeypress="return numbersOnly(event);"/>
</div>
<div class="input-group-btn">
<button id="remove-sign" ng-click="removeSign($index)" class="btn btn-danger" type="button">
-
</button>
</div>
</div>
</div>
<div class="new">
<button class="btn btn-block btn-primary" ng-click="newSign()"><span
class="glyphicon glyphicon-plus"></span> Ny skylt
</button>
</div>
<div class="import">
<button class="btn btn-block btn-success" ng-click="triggerImport()"><span
class="glyphicon glyphicon-upload"></span> Importera
</button>
</div>
<div class="copy">
<button class="btn btn-block btn-warning" ng-click="copySelected()"><span
class="glyphicon glyphicon-duplicate"></span> Copy selected
</button>
</div>
<input id="file" type="file" file-model='file' ng-hide="true"/>
</div>
<div class="col-md-6">
<div ng-init="init()" id="preview"></div>
</div>
<div class="col-md-4 selects">
<div ng-controller="textController">
<h4>Text:</h4>
<div class="text-form" ng-repeat="text in model.texts track by $index">
<div class="input-group">
<input class="text form-control" ng-value="model.texts[$index].text"
ng-model="model.texts[$index].text" name="text" type="text" />
<span class="input-group-btn">
<button ng-click="removeText($index)" class="btn btn-danger" type="button">-</button>
</span>
</div>
<div class="btn-group align" role="group">
<button ng-repeat="align in alignment" type="button"
ng-click="setAlign(align, $parent.$index)"
ng-class="{'active': model.texts[$parent.$index].align == align}"
class="btn btn-default btn-xs">{{align}}
</button>
</div>
<div class="size">
<button ng-click="decreaseSize($index)" class="btn btn-danger btn-xs">-</button>
<!--<span>{{model.texts[$index].size}}</span>-->
<input class="input-field form-control input-xs" ng-model="model.texts[$index].size"
type="text" onkeypress="return floatsOnly(this, event);"/>
<button ng-click="increaseSize($index)" class="btn btn-success btn-xs">+</button>
</div>
<div class="btn-group align" role="group">
<button ng-repeat="style in textStyles" type="button"
ng-click="setStyle(style, $parent.$index)"
ng-class="{'active': model.texts[$parent.$index].style == style}"
class="btn btn-default btn-xs">{{style}}
</button>
</div>
</div>
<button ng-click="addText()" ng-hide="isDisabled()" class="btn btn-success">Lägg till rad</button>
</div>
</div>
</div>
<div class="row">
<div class="col-md-3">
<div ng-controller="sizeController" ng-show="showSize(model.material)">
<h4>Storlek: {{sizeError}}</h4>
<div class="width" ng-show="showWidthHeight()">
<div class="input-group" ng-class="{'has-error': showWidthError()}">
<span class="input-group-addon">
<span>Bredd: </span>
</span>
<input min="{{minSize}}" max="{{maxWidth}}" ng-readonly="model.size.autoWidth"
ng-model="model.size.width"
ng-value="model.size.width" class="form-control" type="number" onkeypress="return numbersOnly(event);"/>
<span class="input-group-btn">
<button class="btn btn-default" ng-click="model.size.autoWidth = !model.size.autoWidth"
ng-class="{'btn-success': model.size.autoWidth, 'btn-warning': !model.size.autoWidth}"
type="button">{{(model.size.autoWidth) ? 'Automatiskt' : 'Manuellt'}}
</button>
</span>
</div>
</div>
<div class="height" ng-show="showWidthHeight()">
<div class="input-group" ng-class="{'has-error': showHeightError()}">
<span class="input-group-addon">
<span>Höjd: </span>
</span>
<input min="{{minSize}}" max="{{maxHeight}}" ng-readonly="model.size.autoHeight"
ng-model="model.size.height" ng-value="model.size.height" class="form-control"
type="number" onkeypress="return numbersOnly(event);"/>
<span class="input-group-btn">
<button class="btn btn-default"
ng-click="model.size.autoHeight = !model.size.autoHeight"
ng-class="{'btn-success': model.size.autoHeight, 'btn-warning': !model.size.autoHeight}"
type="button">{{(model.size.autoHeight) ? 'Automatiskt' : 'Manuellt'}}
</button>
</span>
</div>
</div>
<div class="radius" ng-show="showRadius()">
<div class="input-group" ng-class="{'has-error': showRadiusError()}">
<span class="input-group-addon">
<span>Diameter: </span>
</span>
<input min="{{minSize}}" max="{{maxRadius}}" ng-readonly="model.size.autoRadius"
ng-model="model.size.radius" ng-value="model.size.radius" class="form-control"
type="number" onkeypress="return numbersOnly(event);"/>
<span class="input-group-btn">
<button class="btn btn-default"
ng-click="model.size.autoRadius = !model.size.autoRadius"
ng-class="{'btn-success': model.size.autoRadius, 'btn-warning': !model.size.autoRadius}"
type="button">{{(model.size.autoRadius) ? 'Automatiskt' : 'Manuellt'}}
</button>
</span>
</div>
</div>
<label for="" class="comment">
<textarea class="form-control" rows="3" cols="45" placeholder="Kommentar"
ng-value="model.comment" ng-model="model.comment"></textarea>
</label>
</div>
</div>
<div class="col-md-5">
<div ng-hide="summary(models).price <= orderBasicPrice" class="order">
<h4>Din beställning:</h4>
<table class="table table-bordered table-hover table-condensed">
<thead>
<tr>
<th>Namn</th>
<th>Antal</th>
<th>Pris</th>
<th>Kostnad</th>
</tr>
</thead>
<tbody>
<tr class="warning" ng-hide="orderBasicPrice == 0">
<td>Expeditionsavgift</td>
<td>#</td>
<td>#</td>
<td><span class="label label-success">{{orderBasicPrice}} kr</span></td>
</tr>
<tr ng-class="{'success': current == $index}" ng-repeat="template in models track by $index"
ng-hide="calcPrice(template)*template.order == 0">
<td>{{template.name}}</td>
<td>{{template.order}}</td>
<td><span class="label label-success">{{calcPrice(template)}} kr</span></td>
<td><span class="label label-success">{{calcPrice(template) * template.order}} kr</span>
</td>
</tr>
</tbody>
<tfoot>
<tr>
<td>#</td>
<td>{{summary(models).order}}</td>
<td>#</td>
<td><span class="label label-success">{{summary(models).price}} kr</span></td>
</tr>
</tfoot>
</table>
<button ng-click="order(models)" class="btn btn-success btn-lg">Beställ</button>
</div>
</div>
<div class="col-md-2">
<div ng-controller="shapesController" ng-show="showShapes(model.material)">
<h4>Skylttyp:</h4>
<div class="btn-group">
<button type="button" class="form-control btn btn-default dropdown-toggle"
data-toggle="dropdown">
{{model.shape}} <span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
<li ng-repeat="shape in shapes"><a href="#/" ng-click="setShape(shape)">{{shape}}</a>
</li>
</ul>
</div>
</div>
<div ng-controller="holesController" ng-show="showHoles(model.material)">
<h4>Hål:</h4>
<div class="btn-group">
<button type="button" class="form-control btn btn-default dropdown-toggle"
data-toggle="dropdown">
{{getHoleName()}} <span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
<li ng-show="showHole(hole)" ng-repeat="hole in holes"><a href="#/"
ng-click="setHole(hole)">{{hole}}</a>
</li>
</ul>
</div>
</div>
<div class="tape">
<label>
<input ng-model="model.tape" ng-value="model.tape" type="checkbox"/> Tejp
</label>
</div>
</div>
<div class="col-md-2">
<div ng-controller="themesController" ng-show="showThemes(model.material)">
<h4>Färg (skylt / text):</h4>
<div class="btn-group">
<button type="button" class="form-control btn btn-default dropdown-toggle"
data-toggle="dropdown">
{{model.theme.name}} <span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
<li ng-repeat="theme in themes"><a href="#/"
ng-click="model.theme = theme">{{theme.name}}</a></li>
</ul>
</div>
</div>
<div ng-controller="fontsController" ng-show="showFonts(model.material)">
<h4>Font:</h4>
<div class="btn-group">
<button type="button" class="form-control btn btn-default dropdown-toggle"
data-toggle="dropdown">
{{model.font}} <span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
<li ng-repeat="font in fonts"><a href="#/"
ng-click="model.font = font">{{font}}</a></li>
</ul>
</div>
</div>
</div>
</div>
<div class="order" ng-controller="orderController" class="model-order">
<modal-dialog show='show' dialog-title='Order' height='600px' width='700px'>
<div class="row">
<div class="col-md-2"></div>
<div class="col-md-4">
<input type="text" class="form-control" required="true" placeholder="Förnamn"
ng-value="client.name.first" ng-model="client.name.first"/>
</div>
<div class="col-md-4">
<input type="text" class="form-control" required="true" placeholder="Efternamn"
ng-value="client.name.last" ng-model="client.name.last"/>
</div>
<div class="col-md-4"></div>
</div>
<div class="row">
<div class="col-md-2"></div>
<div class="col-md-8">
<input type="text" class="form-control" required="true" placeholder="Företag"
ng-value="client.company" ng-model="client.company"/>
</div>
<div class="col-md-2"></div>
</div>
<div class="row">
<div class="col-md-2"></div>
<div class="col-md-8">
<input type="text" class="form-control" required="true" placeholder="Orgnr/Personnr"
ng-value="client.number" ng-model="client.number"/>
</div>
<div class="col-md-2"></div>
</div>
<!--<div class="row">
<div class="col-md-2"></div>
<div class="col-md-8">
<input type="text" class="form-control" required="true" placeholder="c/o"/>
</div>
<div class="col-md-2"></div>
</div>-->
<div class="row">
<div class="col-md-2"></div>
<div class="col-md-8">
<input type="text" class="form-control" required="true" placeholder="Adress"
ng-value="client.address" ng-model="client.address"/>
</div>
<div class="col-md-2"></div>
</div>
<div class="row">
<div class="col-md-2"></div>
<div class="col-md-4">
<input type="text" class="form-control" required="true" placeholder="Postnummer"
ng-value="client.postCode" ng-model="client.postCode"/>
</div>
<div class="col-md-4">
<input type="text" class="form-control" required="true" placeholder="Postort"
ng-model="client.postTown" ng-value="client.postTown"/>
</div>
<div class="col-md-4"></div>
</div>
<div class="row">
<div class="col-md-2"></div>
<div class="col-md-8">
<input type="tel" class="form-control" required="true" placeholder="Telefon"
ng-value="client.phone" ng-model="client.phone"/>
</div>
<div class="col-md-2"></div>
</div>
<div class="row">
<div class="col-md-2"></div>
<div class="col-md-8">
<input type="email" class="form-control" required="true" placeholder="E-post"
ng-value="client.email" ng-model="client.email"/>
</div>
<div class="col-md-2"></div>
</div>
<div class="row">
<div class="col-md-2"></div>
<div class="col-md-8">
<textarea class="form-control" name="" id="" cols="30" rows="4" placeholder="Meddelande"
ng-value="client.comment" ng-model="client.comment"></textarea>
</div>
<div class="col-md-2"></div>
</div>
<div class="row">
<div class="col-md-8"></div>
<div class="col-md-2">
<button ng-click="finishOrder()" class="btn btn-success btn-lg">Beställ</button>
</div>
<div class="col-md-2"></div>
</div>
</modal-dialog>
</div>
</div>
</body>
</html>