-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
290 lines (260 loc) · 9.29 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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
<!DOCTYPE html>
<html>
<head>
<title>Hello, Ember!</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Bootstrap -->
<link href="css/bootstrap.min.css" rel="stylesheet" media="screen">
<link href="css/bootstrap-responsive.min.css" rel="stylesheet" media="screen">
<link href="css/style.css" rel="stylesheet"
</head>
<body>
<script type="text/x-handlebars" id="application">
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a href="#" class="brand">Hello, Ember!</a>
<ul class="nav">
{{#linkTo servers tagName="li"}}
{{#linkTo servers}}Servers{{/linkTo}}
{{/linkTo}}
</ul>
</div>
</div>
</div>
<div class="container">
{{outlet}}
</div>
</script>
<script type="text/x-handlebars" id="index">
<div class="row">
<div class="span12">
Index
</div>
</div>
</script>
<!-- SERVERS -->
<script type="text/x-handlebars" id="servers">
<div class="row">
<div class="span3">
<div class="well well-sidebar">
<ul class="nav nav-list">
{{#linkTo "servers.index" tagName="li"}}
{{#linkTo servers.index}}Manage all <i class="icon-list pull-right"></i>{{/linkTo}}
{{/linkTo}}
{{#linkTo "servers.new" tagName="li"}}
{{#linkTo servers.new}}Create new <i class="icon-asterisk pull-right"></i>{{/linkTo}}
{{/linkTo}}
<li class="divider"></li>
{{#each model}}
{{#linkTo server this tagName="li"}}
{{#linkTo server this}}
{{name}}
{{#if isDirty}}
<i class="icon-edit pull-right"></i>
{{/if}}
{{/linkTo}}
{{/linkTo}}
{{else}}
<li><span class="muted">No servers</span></li>
{{/each}}
</ul>
</div>
</div>
<div class="span9">
{{outlet}}
</div>
</div>
</script>
<script type="text/x-handlebars" id="servers/index">
{{#if selectedCount}}
<div class="btn-group">
{{#linkTo "servers.edit" classNames="btn"}}<i class="icon-pencil"></i> Edit {{selectedCount}}{{/linkTo}}
{{#linkTo "servers.delete" classNames="btn"}}<i class="icon-trash"></i> Delete {{selectedCount}}{{/linkTo}}
</div>
{{else}}
<div class="btn-group btn-group-empty">
</div>
{{/if}}
<table class="table">
<thead>
<tr>
<th>{{view Ember.Checkbox checkedBinding="allSelected"}}</th>
<th>Name</th>
<th>IP</th>
<th>Hostname</th>
</tr>
</thead>
<tbody>
{{#each model}}
<tr>
<td>{{view Ember.Checkbox checkedBinding="isSelected"}}</td>
<td>{{name}}</td>
<td>{{ip}}</td>
<td>{{hostname}}</td>
</tr>
{{else}}
<tr><td colspan="4" style="text-align: center"><span class="muted">No servers</span></td></tr>
{{/each}}
</tbody>
</table>
</script>
<script type="text/x-handlebars" id="servers/new">
<form class="form-horizontal">
{{#view App.ControlGroupView label="Name"}}
{{view Em.TextField valueBinding="name"}}
{{/view}}
{{#view App.ControlGroupView label="IP"}}
{{view Em.TextField valueBinding="ip"}}
{{/view}}
{{#view App.ControlGroupView label="Hostname"}}
{{view Em.TextField valueBinding="hostname"}}
{{/view}}
<div class="form-actions">
<button class="btn btn-success" {{action "create"}}>Create</button>
<button class="btn" {{action "clear"}}>Clear</button>
</div>
</form>
</script>
<script type="text/x-handlebars" id="servers/edit">
<table class="table">
<thead>
<tr>
<th>Name</th>
<th>IP</th>
<th>Hostname</th>
</tr>
</thead>
<tbody>
{{#each selected}}
<tr>
<td>{{view Em.TextField valueBinding="name"}}</td>
<td>{{view Em.TextField valueBinding="ip"}}</td>
<td>{{view Em.TextField valueBinding="hostname"}}</td>
</tr>
{{else}}
<tr><td colspan="3" style="text-align: center"><span class="muted">No servers</span></td></tr>
{{/each}}
</tbody>
</table>
<div class="form-actions">
{{#linkTo "servers.index" classNames="btn"}}Cancel{{/linkTo}}
<button class="btn btn-success" {{action "save"}}>Save</button>
</div>
</script>
<script type="text/x-handlebars" id="servers/delete">
<div class="modal modal-inline">
<div class="modal-header">
<h3>Delete servers</h3>
</div>
<div class="modal-body">
<p>Are you sure you want to delete the following servers?</p>
<ul>
{{#each selected}}
<li>{{name}}</li>
{{/each}}
</ul>
</div>
<div class="modal-footer">
{{#linkTo "servers.index" classNames="btn"}}Cancel{{/linkTo}}
<button class="btn btn-danger" {{action delete}}>Delete</button>
</div>
</div>
</script>
<!-- SERVERS.SERVER -->
<script type="text/x-handlebars" id="server">
<ul class="nav nav-tabs">
{{#linkTo "server.index" this tagName="li"}}
{{#linkTo "server.index" this}}Info{{/linkTo}}
{{/linkTo}}
</ul>
{{outlet}}
{{partial "id"}}
</script>
<script type="text/x-handlebars" id="server/index">
{{#with controllers.server}}
<form class="form-horizontal">
{{#view App.ControlGroupView label="Name"}}
{{view Em.TextField valueBinding="name" disabled=true}}
{{/view}}
{{#view App.ControlGroupView label="IP"}}
{{view Em.TextField valueBinding="ip" disabled=true}}
{{/view}}
{{#view App.ControlGroupView label="Hostname"}}
{{view Em.TextField valueBinding="hostname" disabled=true}}
{{/view}}
<div class="form-actions">
{{#linkTo "server.edit" this classNames="btn"}}<i class="icon-pencil"></i> Edit{{/linkTo}}
{{#linkTo "server.delete" this classNames="btn"}}<i class="icon-trash"></i> Delete{{/linkTo}}
</div>
</form>
{{/with}}
</script>
<script type="text/x-handlebars" id="server/edit">
{{#with controllers.server}}
<form class="form-horizontal">
{{#view App.ControlGroupView label="Name"}}
{{view Em.TextField valueBinding="name"}}
{{/view}}
{{#view App.ControlGroupView label="IP"}}
{{view Em.TextField valueBinding="ip"}}
{{/view}}
{{#view App.ControlGroupView label="Hostname"}}
{{view Em.TextField valueBinding="hostname"}}
{{/view}}
<div class="form-actions">
{{#linkTo "server.index" this classNames="btn"}}Cancel{{/linkTo}}
<button class="btn btn-success" {{action "save"}}> Save</button>
</div>
</form>
{{/with}}
</script>
<script type="text/x-handlebars" id="server/delete">
{{#with controllers.server}}
<div class="modal modal-inline">
<div class="modal-header">
<h3>Delete server</h3>
</div>
<div class="modal-body">
<p>Are you sure you want to delete <b>{{name}}</b>? Its IP address is <b>{{ip}}</b>
and its hostname is <b>{{hostname}}</b>.</p>
</div>
<div class="modal-footer">
{{#linkTo server.index this classNames="btn"}}Cancel{{/linkTo}}
<button class="btn btn-danger" {{action delete}}>Delete</button>
</div>
</div>
{{/with}}
</script>
<!-- TEMPLATES -->
<!-- usage:
{{partial "id"}}
-->
<script type="text/x-handlebars" id="_id">
<code><small>ID: {{id}}</small></code>
</script>
<!-- usage:
{{#view App.ControlGroupView label="Name"}}
{{view Em.TextField valueBinding="name" disabled=true}}
{{/view}}
-->
<script type="text/x-handlebars" id="controlGroup">
<div class="control-group">
<label class="control-label">{{view.label}}</label>
<div class="controls">
{{yield}}
</div>
</div>
</script>
<script src="http://code.jquery.com/jquery.js"></script>
<script src="js/lib/bootstrap.min.js"></script>
<script src="js/lib/handlebars-1.0.0-rc.4.js"></script>
<script src="js/lib/ember-1.0.0-rc.6.1.js"></script>
<script src="js/lib/ember-data-latest.js"></script>
<script src="js/app.js"></script>
<script src="js/models.js"></script>
<script src="js/routes.js"></script>
<script src="js/controllers.js"></script>
<script src="js/views.js"></script>
</body>
</html>