-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.html
87 lines (73 loc) · 2.61 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Ember JS Blog</title>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/style.css">
<meta charset="utf-8">
<script src="js/libs/jquery.js"></script>
<script src="js/libs/handlebars.js"></script>
<script src="js/libs/ember.js"></script>
<script src="js/libs/ember-data.js"></script>
<script src="js/libs/ember-template-compiler.js"></script>
</head>
<body>
<script type="text/x-handlebars">
<body>
<header>
<h1>Blog</h1>
</header>
<div>
{{outlet}}
</div>
<footer>
©2013-2015 Ian Dunlop.
</footer>
</body>
</script>
<script type="text/x-handlebars" data-template-name="index">
<div>{{#link-to 'posts'}}Posts{{/link-to}}</div>
<div>{{#link-to 'posts.new'}}New Post{{/link-to}}</div>
</script>
<script type="text/x-handlebars" data-template-name="posts">
{{outlet}}
</script>
<script type="text/x-handlebars" data-template-name="posts/index">
<ul class="posts">
{{#each model key="@index" as |post|}}
<li>{{#link-to 'post' post}}{{post.title}}{{/link-to}}</li>
{{/each}}
</ul>
<div>{{#link-to 'posts.new'}}New Post{{/link-to}}</div>
</script>
<script type="text/x-handlebars" data-template-name="post">
{{outlet}}
</script>
<script type="text/x-handlebars" data-template-name="post/index">
{{model.title}}
<ul>
{{#each model.comments key="@index" as |comment|}}
<li>{{#link-to 'post.comment' comment}}{{comment.text}}{{/link-to}}</li>
{{/each}}
</ul>
{{#link-to 'post.comments.new'}}New Comment{{/link-to}}
</script>
<script type="text/x-handlebars" data-template-name="post/comment">
{{model.text}}
</script>
<script type="text/x-handlebars" data-template-name="post/comments/new">
<form {{action 'save' on='submit' }}>
{{textarea value=text placeholder="Enter comment here"}}
<button type="submit">Create Comment</button>
</form>
</script>
<script type="text/x-handlebars" data-template-name="posts/new">
<form {{action 'save' content on='submit' }}>
{{textarea value=title placeholder="Enter title here"}} {{textarea value=text placeholder="Enter content here"}}
<button type="submit">Create Post</button>
</form>
</script>
<script src="js/app.js"></script>
</body>
</html>