-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathindex.html
135 lines (109 loc) · 3.81 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Ember CRUD Demo</title>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/bootstrap.min.css" media="screen">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<script type="text/x-handlebars" data-template-name="application">
<div class="container">
<h1>Ember.js - Express REST API combo</h1>
<div class="navbar">
<div class="navbar-inner">
<ul class="nav">
{{#view App.NavView}}
{{#linkTo "index"}}Home{{/linkTo}}
{{/view}}
{{#view App.NavView}}
{{#linkTo "locations"}}Locations{{/linkTo}}
{{/view}}
{{#view App.NavView}}
{{#linkTo "about"}}About{{/linkTo}}
{{/view}}
</ul>
</div>
</div>
{{outlet}}
</div>
</script>
<script type="text/x-handlebars" data-template-name="index" >
<p>This is the homepage....</p>
</script>
<script type="text/x-handlebars" data-template-name="locations/index">
{{#if locationsPresent}}
<p>Nr of locations = {{content.length}}</p>
{{#if itemsSelected}}
<p><button {{action 'removeSelectedLocations'}}>Remove {{editCounter}} selected locations</button></p>
{{/if}}
<table class="table table-hover">
<tr>
<th>Selected</th>
<th>Latitude</th>
<th>Longitude</th>
<th>Accuracy</th>
<th></th>
<th></th>
</tr>
{{#each location in controller itemController="locationsEdit"}}
<tr {{bindAttr class="selected:warning"}}>
<td>{{view Ember.Checkbox checkedBinding="selected"}}</td>
<td>{{location.latitude}}</td>
<td>{{location.longitude}}</td>
<td>{{location.accuracy}}</td>
<td>{{#linkTo "locations.edit" location}}<img src="images/edit-icon.png"/>{{/linkTo}}</td>
<td><a href="#" {{action removeItem location}}><img src="images/delete-icon.png" border="0"/></a></td>
</tr>
{{/each}}
</table>
{{else}}
No locations present.
{{/if}}
<p>{{#linkTo "locations.new"}}<img src="images/add-icon.png"/> New location{{/linkTo}}</p>
</script>
<script type="text/x-handlebars" data-template-name="_locationForm" >
<form class="form-horizontal">
<div class="control-group">
<label class="control-label" for="latitude">Latitude</label>
<div class="controls">
{{view Ember.TextField valueBinding="latitude"}}
</div>
</div>
<div class="control-group">
<label class="control-label" for="longitude">Longitude</label>
<div class="controls">
{{view Ember.TextField valueBinding="longitude"}}
</div>
</div>
<div class="control-group">
<label class="control-label" for="accuracy">Accuracy</label>
<div class="controls">
{{view Ember.TextField valueBinding="accuracy"}}
</div>
</div>
</form>
</script>
<script type="text/x-handlebars" data-template-name="locations/edit" >
{{#if controller.isNew}}
<h1>New location</h1>
{{else}}
<h1>Edit location</h1>
{{/if}}
{{partial "locationForm"}}
<p>
<button {{action updateItem this}}>Update record</button>
</p>
</script>
<script type="text/x-handlebars" data-template-name="about" >
<p>This is the about page.</p>
</script>
<script src="js/jquery-1.9.1.js"></script>
<script src="js/handlebars-v1.3.0.js"></script>
<script src="js/ember-1.5.1.js"></script>
<script src="js/ember-data-1.0.0-beta.7.f87cba88.js"></script>
<script src="js/bootstrap.js"></script>
<script src="js/app.js"></script>
</body>
</html>