-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
executable file
·110 lines (110 loc) · 3.96 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
<!doctype html>
<html lang="en" class="no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Awesome restaurants</title>
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" media="screen" href="/css/bootstrap.css" >
<script type="text/mustache" id="restaurant-template">
<tr>
<td>{{ name }}</td>
<td>{{ postcode }}</td>
<td>{{ rating }}</td>
<td>
<i class="icon-remove remove" id="{{ id }}"></i>
</td>
</tr>
</script>
<script type="text/javascript" src="/javascript/vendor/jquery.min.js"></script>
<script type="text/javascript" src="/javascript/vendor/underscore.min.js"></script>
<script type="text/javascript" src="/javascript/vendor/backbone.min.js"></script>
<script type="text/javascript" src="/javascript/vendor/backbone_rails_sync.js"></script>
<script type="text/javascript" src="/javascript/vendor/backbone-validations.js"></script>
<script type="text/javascript "src="/javascript/vendor/hogan.js"></script>
<script type="text/javascript "src="/javascript/app.js"></script>
<script type="text/javascript "src="/javascript/models/restaurant.js"></script>
<script type="text/javascript "src="/javascript/views/restaurants.js"></script>
<script type="text/javascript "src="/javascript/views/restaurant_form.js"></script>
</head>
<body>
<script type="text/javascript">
restaurantsData = [
{
id: 0,
name: 'Ritz',
postcode: 'N112TP',
rating: 5
},
{
id: 1,
name: 'Astoria',
postcode: 'EC1E4R',
rating: 3
},
{
id: 2,
name: 'Waldorf',
postcode: 'WE43F2',
rating: 4
}
];
$(document).ready(function() {
restaurants = new Gourmet.Collections.RestaurantsCollection(restaurantsData);
restaurantsView = new Gourmet.Views.RestaurantsView({
el: '#restaurants tbody',
collection: restaurants
});
restaurantsFormView = new Gourmet.Views.RestaurantForm({
el: '#restaurant-form',
collection: restaurants
});
});
</script>
<div class="container">
<div class="navbar">
<div class="navbar-inner">
<div class="container">
<a href="#" class="brand">Awesome restaurants</a>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="span4">
<form action="#" class="well form-horizontal" id="restaurant-form">
<div class="control-group">
<label for="restaurant_name">Name</label>
<input type="text" name="restaurant[name]" id="restaurant_name" />
<span class="help-block">Required</span>
</div>
<div class="control-group">
<label for="restaurant_rating">Rating</label>
<input type="text" name="restaurant[rating]" id="restaurant_rating" />
<span class="help-block">Required, only a number between 1 and 5</span>
</div>
<div class="control-group">
<label for="restaurant_postcode">Postcode</label>
<input type="text" name="restaurant[postcode]" id="restaurant_postcode" />
<span class="help-block">Required</span>
</div>
<input type="button" class="btn btn-primary" value="Save" id="save" />
</form>
</div>
<div class="span8">
<table class="table" id="restaurants">
<thead>
<tr>
<th>Name</th>
<th>Postcode</th>
<th>Rating</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
</div>
</div>
</div>
</body>
</html>