Skip to content

Commit 9ceb5f8

Browse files
committedOct 19, 2015
Added basic posts list template and static data.
chapter3-1
1 parent ba7d4cd commit 9ceb5f8

File tree

4 files changed

+46
-0
lines changed

4 files changed

+46
-0
lines changed
 

‎client/main.html

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<head>
2+
<title>Microscope</title>
3+
</head>
4+
<body>
5+
<div class="container">
6+
<header class="navbar navbar-default" role="navigation">
7+
<div class="navbar-header">
8+
<a class="navbar-brand" href="/">Microscope</a>
9+
</div>
10+
</header>
11+
<div id="main">
12+
{{> postsList}}
13+
</div>
14+
</div>
15+
</body>

‎client/templates/posts/post_item.html

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<template name="postItem">
2+
<div class="post">
3+
<div class="post-content">
4+
<h3><a href="{{url}}">{{title}}</a><span>{{domain}}</span></h3>
5+
</div>
6+
</div>
7+
</template>
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<template name="postsList">
2+
<div class="posts page">
3+
{{#each posts}}
4+
{{> postItem}}
5+
{{/each}}
6+
</div>
7+
</template>

‎client/templates/posts/posts_list.js

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
var postsData = [
2+
{
3+
title: 'Introducing Telescope',
4+
url: 'http://sachagreif.com/introducing-telescope/'
5+
},
6+
{
7+
title: 'Meteor',
8+
url: 'http://meteor.com'
9+
},
10+
{
11+
title: 'The Meteor Book',
12+
url: 'http://themeteorbook.com'
13+
}
14+
];
15+
Template.postsList.helpers({
16+
posts: postsData
17+
});

0 commit comments

Comments
 (0)