-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
186 lines (176 loc) · 9.28 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>ShopIt</title>
<link rel="stylesheet" type="text/css" href="css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="css/font-awesome.css">
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="css/app.css">
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<script src="lib/angular.min.js" type="text/javascript"></script>
<script src="lib/angular-route.js" type="text/javascript"></script>
<script src="lib/jquery-1.11.1.min.js" type="text/javascript"></script>
<!--<script src="lib/bootstrap.js" type="text/javascript"></script>-->
<script src="lib/bootstrap.min.js" type="text/javascript"></script>
<script src="js/app.js" type="text/javascript"></script>
<script src="js/controllers/mainController.js" type="text/javascript"></script>
<script src="js/controllers/loginController.js" type="text/javascript"></script>
</head>
<body ng-app="shopApp" ng-controller="mainController">
<!--<button type="button" class="btn btn-default">Show me</button>-->
<!--<div ng-app="shopApp" ng-controller="mainController">-->
<!--<div id="content">-->
<!--<div ng-repeat="content in contents">-->
<!--<p>{{content.name}}</p>-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<nav class="navbar navbar-default">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Brand</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li class="active"><a href="#">Link <span class="sr-only">(current)</span></a></li>
<li><a href="#">Link</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Dropdown <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="#">Action</a></li>
<li><a href="#">Another action</a></li>
<li><a href="#">Something else here</a></li>
<li role="separator" class="divider"></li>
<li><a href="#">Separated link</a></li>
<li role="separator" class="divider"></li>
<li><a href="#">One more separated link</a></li>
</ul>
</li>
</ul>
<form class="navbar-form navbar-left" role="search">
<div class="form-group">
<input type="text" class="form-control" placeholder="Search">
</div>
<button type="submit" class="btn btn-default">Submit</button>
</form>
<ul class="nav navbar-nav navbar-right">
<li><a href="#">Link</a></li>
<li>
<a href="#" role="button" aria-haspopup="true" aria-expanded="false" data-toggle="modal" class=".btn" data-target="#checkoutModal"><span class="label label-danger">Checkout <i class="fa fa-cart-plus"></i></span></a>
</li>
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>
<!--<nav class="navbar navbar-default" role="navigation"></nav>-->
<!--tile view-->
<div class="container">
<div class="dropdown" ng-model="query">
<button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
Sort by price
<span class="caret"></span>
</button>
<ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
<li><a href="#" ng-click="order('price')">Lowest to Highest</a></li>
<li><a href="#" ng-click="order('age')">Highest to Lowest</a></li>
</ul>
</div>
<div class="row" ng-repeat="content in contents">
<h3 id="item-header">{{content.name}}</h3>
<div class="col-xs-18 cl-sm-6 col-md-3" ng-repeat="item in content.items | orderBy:'price':reverse">
<div class="thumbnail">
<img class="card-img-top" src="http://placehold.it/500x250/EEE" alt="Card image cap">
<div class="card-block">
<h4 class="card-title">{{item.name}}</h4>
<br class="card-text">
{{item.name}}</br>{{item.price}}</br>{{item.brand}}
</p>
<a href="" class="btn btn-primary" ng-click="addToCart(item.name, item.price)">Add to cart</a>
</div>
</div>
</div>
</div>
</div>
<div class="modal fade" id="checkoutModal" tabindex="-1" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title">Shopping Cart</h4>
</div>
<!--<div class="container">-->
<div class="well">
<div>
<table class="table">
<tr ng-repeat="item in added">
<td>{{item.name}}</td>
<td>{{item.price}}</td>
</tr>
</table>
</div>
<div class="rows"></div>
<p> Tax(10%): {{tax}}</p>
<p>Shipping: 300</p>
<p>Total:  {{total}}</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary" data-target="#loginModal" data-toggle="modal" class="close" data-dismiss="modal">Proceed to Checkout</button>
</div>
</div>
</div>
</div><!-- /.modal-dialog -->
</div>
<div class="modal fade" id="loginModal" tabindex="-1" role="dialog" ng-controller="loginController">
<div class="modal-dialog">
<div class="loginmodal-container">
<h1>Login to Your Account</h1><br>
<form>
<input type="text" name="user" placeholder="Username" ng-model="user.name">
<input type="password" name="passwd" placeholder="Password" ng-model="user.passwd">
<input type="submit" name="login" class="login loginmodal-submit" value="Login" ng-click="login(user)">
</form>
</div>
</div>
</div>
<div ng-view></div>
<div class="modal fade" id="purchaseModal" tabindex="-1" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title">Your purchase</h4>
</div>
<!--<div class="container">-->
<div class="well">
<div>
<table class="table">
<tr ng-repeat="item in added">
<td>{{item.name}}</td>
<td>{{item.price}}</td>
</tr>
</table>
</div>
<div class="rows"></div>
<p> Tax(10%): {{tax}}</p>
<p>Shipping: 300</p>
<p>Total:  {{total}}</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div><!-- /.modal-dialog -->
</div>
</body>
</html>