-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
172 lines (138 loc) · 5.33 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
<html>
<head>
<title></title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap-theme.min.css">
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div class="container">
<h1>The Ultimate Wine app</h1>
<!-- <a data-toggle="modal" data-target="#add-wine" class="btn btn-success">Add new wine</a> -->
<a href="#index" id="addwinebn" class="btn btn-success">Add new wine</a>
<div class="row" id="newwine">
<div class="col-md-12">
<div class="thumbnail col-md-12">
<div class="col-md-4">
<img src="https://s3-us-west-2.amazonaws.com/sandboxapi/placeholder.jpg" >
<div class="form-group">
<label for="picture">Picture:</label>
<input type="text" class="form-control" name="newpicture" placeholder="Add a picture url"></input>
</div>
</div>
<div class="caption col-md-4">
<div class="form-group">
<label for="wine">Name:</label>
<input type="text" class="form-control" name="newname" placeholder="Wine Name"></input>
</div>
<div class="form-group">
<label for="grapes">Grapes:</label>
<input type="text" class="form-control" name="newgrapes" placeholder="Type of grapes"></input>
</div>
<div class="form-group">
<label for="grapes">Year:</label>
<input type="text" class="form-control" name="newyear" placeholder="Year"></input>
</div>
<div class="form-group">
<label for="country">Country:</label>
<input type="text" class="form-control" name="newcountry" placeholder="Country"></input>
</div>
<div class="form-group">
<label for="description">Description:</label>
<input type="text" class="form-control description" name="newdescription" placeholder="Description"></input>
</div>
</div>
<div class="col-md-4">
<div class="col-md-12">
<div class="form-group">
<label for="price">Price:</label>
<input type="text" class="form-control pricebox" name="newprice" placeholder="0"></input>
</div>
</div>
</div>
<div class="col-md-4 col-md-offset-4">
<button type="button" id="add-wine" class="btn btn-primary">Add Wine</button>
<a href="#index" type="button" id="cancel" class="btn btn-danger">Cancel</a>
</div>
</div>
</div>
</div>
<div id="content" class="row">
</div>
</div>
<script id="get-wine" type="x-handlebars-template">
{{#each Wine}}
<div class="col-sm-6 col-md-12">
<div id="name{{id}}" class="thumbnail col-md-12">
<div class="col-md-4">
<img src="{{picture}}" >
</div>
<div class="caption col-md-4">
<h2>{{name}}</h2>
<p>{{grapes}}</p>
<p>{{country}} - {{year}}</p>
<p>{{description}}</p>
</div>
<div class="col-md-4">
<div class="col-md-12">
<h1 class="price text-center">{{price}}</h1>
</div>
<div class="col-md-12">
<p class="text-center"><a href="#edit/{{id}}" class="btn btn-success" role="button">Edit Wine</a> <a href="#" class="btn btn-danger delete-button" id="{{id}}" role="button">Delete Wine</a></p>
</div>
</div>
</div>
</div>
{{/each}}
</script>
<script id="edit-wine" type="x-handlebars-template">
<div class="col-md-4">
<img src="{{picture}}" >
<div class="form-group">
<label for="picture">Picture:</label>
<input type="text" class="form-control" name="picture" value="{{picture}}"></input>
</div>
</div>
<div class="caption col-md-4">
<div class="form-group">
<label for="wine">Name:</label>
<input type="text" class="form-control" name="name" value="{{name}}"></input>
</div>
<div class="form-group">
<label for="grapes">Grapes:</label>
<input type="text" class="form-control" name="grapes" value="{{grapes}}"></input>
</div>
<div class="form-group">
<label for="grapes">Year:</label>
<input type="text" class="form-control" name="year" value="{{year}}"></input>
</div>
<div class="form-group">
<label for="country">Country:</label>
<input type="text" class="form-control" name="country" value="{{country}}"></input>
</div>
<div class="form-group">
<label for="description">Description:</label>
<input type="text" class="form-control description" name="description" value="{{description}}"></input>
</div>
</div>
<div class="col-md-4">
<div class="col-md-12">
<div class="form-group">
<label for="price">Price:</label>
<input type="text" class="form-control description pricebox" name="price" value="{{price}}"></input>
</div>
<button type="button" class="btn btn-success submit-edits" edit_id="{{id}}">Edit Wine</button>
<a href="#" type="button" class="btn btn-danger">Cancel</a>
</div>
</div>
</script>
<script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
<script src="http://underscorejs.org/underscore-min.js"></script>
<script src="http://backbonejs.org/backbone-min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/handlebars.js/2.0.0/handlebars.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>
<script type="text/javascript" src="app.js"></script>
</body>
</html>