forked from ddewaele/emberjs-crud-rest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
129 lines (106 loc) · 3.39 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Ember Starter Kit</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">
<p>
Nr of locations = {{content.length}}
</p>
{{#if locationsPresent}}
<table class="table table-hover">
<tr>
<th>Latitude</th>
<th>Longitude</th>
<th>Accuracy</th>
<th></th>
<th></th>
</tr>
{{#each location in controller}}
<tr>
<td>{{location.latitude}}</td>
<td>{{location.longitude}}</td>
<td>{{location.accuracy}}</td>
<td>{{#linkTo locations.edit location}}Edit{{/linkTo}}</td>
<td><button {{action removeItem location}}>Delete</button></td>
</tr>
{{/each}}
</table>
{{else}}
No locations present.
{{/if}}
<p>{{#linkTo "locations.new"}}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="latitude">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-1.0.0-rc.3.js"></script>
<script src="js/ember-latest.js"></script>
<script src="js/ember-data-latest.js"></script>
<script src="js/bootstrap.js"></script>
<script src="js/app.js"></script>
</body>
</html>