-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
151 lines (137 loc) · 6.37 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
<!DOCTYPE html>
<html lang="en" ng-app='carMarketApp'>
<head>
<meta charset="UTF-8">
<title>Document</title>
<!-- Bootstrap -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.1.1.min.js" integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<style>
[name="orderForm"] .ng-invalid.ng-dirty{
border-color: #fa787e;
}
[name="orderForm"] .ng-valid.ng-dirty{
border-color: #78fa89;
}
.help-block{
color: red;
}
</style>
</head>
<body ng-controller="StoreController as store" class='modal-parent'>
<script type="text/ng-template" id="myModalContent.html">
<div class="modal-header"><h3 class="modal-title" id="modal-title">Order Form</h3></div>
<div class="modal-body" id="modal-body">
<form name="orderForm" ng-submit="modal.addReview(product)" novalidate>
<fieldset class="form-group">
<input type="text" ng-model="modal.user.name" name="name" placeholder="Name" class="form-control" required>
<p ng-show="!orderForm.name.$setValidity('text', modal.validateName(modal.name)) && orderForm.name.$invalid && !orderForm.name.$pristine" class="help-block">Please enter a minimum five characters length name. For security reasons, the neighbouring characters cannot be the same!</p>
</fieldset>
<fieldset class="form-group">
<input ng-model="modal.user.mail" type="email" name="email" class="form-control" placeholder="[email protected]" title="Email" required />
<p ng-show="orderForm.email.$invalid && !orderForm.email.$pristine" class="help-block">Enter a valid email.</p>
</fieldset>
<fieldset class="form-group">
<textarea ng-model="modal.user.review" name="message" class="form-control" placeholder="Write a short review of the product..." title="Review" required></textarea>
<p ng-show="orderForm.message.$invalid && !orderForm.message.$pristine" class="help-block">Enter a message.</p>
</fieldset>
<div class="modal-footer">
<button type="submit" class="btn btn-primary" type="button" ng-disabled="orderForm.$invalid" ng-click="modal.storeOrder()">Submit Order</button>
<button class="btn btn-warning" type="button" ng-click="modal.cancel()">Cancel</button>
</div>
review form is {{orderForm.$valid}}
</form>
</div>
</script>
<section class="container-fluid" >
<div class="col-xs-12 col-md-2">
<form name="filterForm">
<div>
<div class="input-group">
<input type="text" class="form-control" placeholder="Search ..." ng-model="filter.search"/>
<span class="input-group-addon " id="basic-addon1">
<span class="glyphicon glyphicon-search"></span>
</span>
</div><!-- /input-group -->
</div><!-- /.col-lg-6 -->
<br>
<div>
<label for="Brand" >Select Brand :</label>
<select class="form-control" id="Brand" ng-model="filter.make" ng-change="filter.model=''" ng-click="store.getmodels(filter.make)">
<option value="" selected="selected"> --- Select --- </option>
<option ng-repeat="brand in store.cars.name" ng-value="brand"> {{brand}} </option>
</select>
</div>
<br>
<div>
<label for="model">Select model :</label>
<select ng-disabled="!filter.make" ng-model="filter.model" class="form-control" id="model" >
<option value="" ng-selected="selected"> --- Select --- </option>
<option ng-if="filter.make" ng-repeat="model in store.cars.models| filter:filter.make" ng-value="model.name"> {{model.name}} </option>
</select>
</div>
</form>
<br><br>
<div class="text-center">
<div class="btn btn-lg btn-primary" ng-click="showCart = !showCart">
<span class="glyphicon glyphicon-shopping-cart"></span>
CART
<span class="badge" ng-if="store.cart.length"> {{store.cart.length}} </span>
</div>
<button class="btn btn-lg btn-success" ng-disabled="!store.cart" ng-click="store.openModal('lg')">Complete</button>
</div><br>
<div class="">
<ul class="list-group" ng-show="showCart">
<li class="list-group-item active" ng-if="store.cart.length" ng-repeat="item in store.cart" id="{{$index}}">
<div class="row">
<div class="col-xs-10" >
<span><b>Brand:</b> {{item.make}} </span><br>
<span><b>Model:</b> {{item.name}} </span>
</div>
<div class="col-xs-1">
<span aria-hidden="true" class="close" ng-click="store.removeCartItem(item); item.selected=false;" style="font-size:40px;">×</span>
</div>
</div>
</li>
</ul>
</div>
</div>
<div class="col-xs-12 col-md-10">
<div ng-repeat="car in store.cars.models |filter: filter.make |filter: filter.model |filter: filter.search">
<div class="panel panel-default col-xs-12 col-sm-3">
<div class="row panel-heading">
<h1>{{car.make}}
<span ng-click="store.addToCart(car); add=true" class="glyphicon pull-right"
ng-class="car.isSelected ? 'glyphicon-star':'glyphicon-star-empty'" aria-hidden="true">
</span>
</h1>
<h1>{{car.name}} </h1>
</div>
</div>
</div>
</div>
</section>
<script src="/static/bundle.js"></script>
</body>
</html>
<!-- <div class="panel-body" ng-controller="PanelController as panel">
<button ng-show="car.canPurchase">Add to Cart</button>
<ul class="nav row nav-pills">
<li ng-class="{active:panel.isSelected(1)}"><a href ng-click="panel.selectTab(1)">Description</a></li>
<li ng-class="{active:panel.isSelected(2)}"><a href ng-click="panel.selectTab(2)">Specification</a></li>
<li ng-class="{active:panel.isSelected(3)}"><a href ng-click="panel.selectTab(3)">Reviews</a></li>
</ul>
<div class="" ng-show="panel.isSelected(1)">
<h4>Description</h4>
<p>DESCRIPTIONS</p>
</div>
<div class="" ng-show="panel.isSelected(2)">
<h4>Specification</h4>
<blockquote>none yet</blockquote>
</div>
<div class="" ng-show="panel.isSelected(3)">
<h4>Reviews</h4>
<blockquote>none yet</blockquote>
</div>
</div> -->