-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
executable file
·120 lines (112 loc) · 5.01 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
<html ng-app="spinnyApp">
<head>
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/angular_material/0.11.2/angular-material.min.css">
<link href="material-design-responsive-table/css/normalize.css" rel="stylesheet" type="text/css" />
<link href="material-design-responsive-table/css/style.css" rel="stylesheet" type="text/css" />
</head>
<body ng-controller="RootController">
<md-toolbar md-medium-tall>
<div class="md-toolbar-tools" md-padding>
<img src="images/spinny-logo.png" />
<span flex></span>
<!-- <md-button class="md-raised" style="color: black;">
Logout
</md-button> -->
</div>
</md-toolbar>
<div id="demo">
<h1>Spinny Dashboard</h1>
<h2>v 1.0</h2>
<div class="table-responsive-vertical shadow-z-1">
<table id="table" class="table table-hover table-mc-light-blue">
<thead>
<tr>
<th colspan="4">
<md-input-container>
<label>Search</label>
<input ng-model="user.title">
</md-input-container>
</th>
<th colspan="1">
<md-select name="myModel" ng-model="myModel" ng-change="search(myModel)">
<md-option value="10000">10000</md-option>
<md-option value="20000">20000</md-option>
<md-option value="30000">30000</md-option>
<md-option value="40000">40000</md-option>
<md-option value="50000">50000</md-option>
<md-option value="800000">800000</md-option>
</md-select>
</th>
<th colspan="1" style="padding-bottom: 33px;">
<md-button ng-click="clearValue()" ng-disabled="!myModel">Clear</md-button>
</th>
</tr>
</thead>
<thead>
<tr>
<th></th>
<th>ID</th>
<th>Name</th>
<th>Price</th>
<th>Image</th>
<th>Inventory</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="item in items | filter: user.title">
<td>
<md-checkbox ng-checked="exists(item, selected)" ng-click="toggle(item, selected)">
</md-checkbox>
</td>
<td data-title="ID" id="padding">{{item.id}}</td>
<td data-title="Name" id="padding">{{item.name}}</td>
<td data-title="Price" id="padding">Rs. {{item.price}}</td>
<td data-title="Link" id="padding">
<a href="http://{{item.image_url}}" target="_blank">{{item.image_url}}</a>
</td>
<td data-title="Inventory" id="padding">{{item.inventory_count}}</td>
</tr>
</tbody>
</table>
<!-- {{selected}} -->
</div>
</div>
</div>
</body>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular-animate.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular-aria.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angular_material/0.11.2/angular-material.min.js"></script>
<script src="angular-route.js"></script>
<script src="app.js"></script>
<!-- <script type="app.route.js"></script> -->
<script src="config.js"></script>
<script src="SharedComponents/SharedDataService.js"></script>
<script type="text/javascript">
spinnyApp.controller('RootController', function($scope, $http, SharedDataService) {
SharedDataService.getCars().then(function(response) {
$scope.items = response;
});
$scope.selected = [];
$scope.toggle = function(item, list) {
var idx = list.indexOf(item);
if (idx > -1) list.splice(idx, 1);
else list.push(item);
};
$scope.exists = function(item, list) {
return list.indexOf(item) > -1;
};
$scope.clearValue = function() {
$scope.myModel = undefined;
$http.get("http://localhost:8000/polls/cars/").then(function(response) {
$scope.items = response.data.cars;
});
};
$scope.search = function(value) {
SharedDataService.searchCars(value).then(function(response) {
$scope.items = response;
});
}
});
</script>
</html>