forked from ianwdunlop/ember-js-mvc-blog-tutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
87 lines (75 loc) · 2.35 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">
</head>
<body>
<script type="text/x-handlebars">
<body>
<header>
<h1>Blog</h1>
</header>
<div>
{{outlet}}
</div>
<footer>
©2013 Ian Dunlop.
</footer>
</body>
</script>
<script type="text/x-handlebars" data-template-name="index">
<div>{{#linkTo 'posts'}}Posts{{/linkTo}}</div>
<div>{{#linkTo 'posts.new'}}New Post{{/linkTo}}</div>
</script>
<script type="text/x-handlebars" data-template-name="posts">
{{outlet}}
</script>
<script type="text/x-handlebars" data-template-name="posts/index">
<ul>
{{#each model}}
<li>{{#linkTo 'post' this}}{{title}}{{/linkTo}}</li>
{{/each}}
</ul>
<div>{{#linkTo 'posts.new'}}New Post{{/linkTo}}</div>
</script>
<script type="text/x-handlebars" data-template-name="post">
{{outlet}}
</script>
<script type="text/x-handlebars" data-template-name="post/index">
{{title}}
<ul>
{{#each comment in comments}}
<li>{{#linkTo 'post.comment' comment}}{{comment.text}}{{/linkTo}}</li>
{{/each}}
</ul>
{{#linkTo 'comments.new'}}New Comment{{/linkTo}}
</script>
<script type="text/x-handlebars" data-template-name="post/comment">
{{text}}
</script>
<script type="text/x-handlebars" data-template-name="comments">
{{outlet}}
</script>
<script type="text/x-handlebars" data-template-name="comments/new">
<form {{action save on='submit'}}>
{{view Ember.TextArea valueBinding="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'}}>
{{view Ember.TextArea valueBinding="title" placeholder="Enter title here"}}
{{view Ember.TextArea valueBinding="text" placeholder="Enter content here"}}
<button type="submit">Create Post</button>
</form>
</script>
<script src="js/libs/jquery-1.9.1.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/app.js"></script>
</body>
</html>