-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
128 lines (115 loc) · 4.75 KB
/
index.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
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Bootstrap -->
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/bootstrap-theme.min.css">
</head>
<body ng-app="app">
<div class="container" ng-controller="FoodsController">
<h1>MealTrack</h1>
<div >
<div class="row">
<form ng-submit="addFoodToList()">
<div class="col-md-9">
<input type="search" ng-model="searchText" class="form-control"
ng-keydown="searchBarKeypress($event)" ng-change="changeFilter()"
mt-focus="giveSearchBarFocus"/>
</div>
<div class="col-md-2">
<input type="text" ng-model="weight" class="form-control"
mt-focus="giveWeightInputFocus"
placeholder="100"/>
</div>
<div class="col-md-1">
<input type="submit" class="btn btn-primary" value="Add to List"/>
</div>
</form>
</div>
<div class="row">
<div class="col-xs-6" style="overflow:auto;"><h2>Referenslista</h2>
<table class="table table-condensed">
<thead>
<tr>
<th>Namn</th>
<th>Vikt</th>
<th>Kcal</th>
<th>Protein</th>
<th>Fett</th>
<th>Kolhydrater</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="food in foodTableViewModel.tableModel.data"
ng-class="{'success':foodTableViewModel.isRowSelected($index)}">
<td class="">{{food.name}}</td>
<td>{{food.weight | number:1}}</td>
<td>{{food.kcal | number:1}}</td>
<td>{{food.protein | number:1}}</td>
<td>{{food.fat | number:1}}</td>
<td>{{food.carbs | number:1}}</td>
</tr>
</tbody>
</table>
</div>
<div class="col-xs-6">
<h2>Valda livsmedel</h2>
<table class="table table-condensed col-md-6">
<thead>
<tr>
<th>Namn</th>
<th>Vikt</th>
<th>Kcal</th>
<th>Protein</th>
<th>Fett</th>
<th>Kolhydrater</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="food in personalFoodTableViewModel.tableModel.data track by $index">
<td>{{food.name}}</td>
<td>{{food.weight | number:1}}</td>
<td>{{food.kcal | number:1}}</td>
<td>{{food.protein | number:1}}</td>
<td>{{food.fat | number:1}}</td>
<td>{{food.carbs | number:1}}</td>
<td>
<a href="#" ng-click="deleteFood(food)"><span class="glyphicon glyphicon-remove"/></a>
</td>
</tr>
</tbody>
<tfoot>
<tr>
<td>Summa</td>
<td>
{{personalFoodTableViewModel.tableModel.getColumnSum("weight") | number:1}}
</td>
<td>
{{personalFoodTableViewModel.tableModel.getColumnSum("kcal") | number:1}}
</td>
<td>
{{personalFoodTableViewModel.tableModel.getColumnSum("protein") | number:1}}
</td>
<td>
{{personalFoodTableViewModel.tableModel.getColumnSum("fat") | number:1}}
</td>
<td>
{{personalFoodTableViewModel.tableModel.getColumnSum("carbs") | number:1}}
</td>
<td></td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
<script src="js/jquery-2.0.2.min.js"></script>
<script src="js/bootstrap.js"></script>
<script src="js/jquery.csv-0.71.js"></script>
<script src="js/angular.js"></script>
<script src="js/angular-locale_sv-se.js"></script>
<script src="js/main.js"></script>
</body>
</html>