Skip to content

Commit

Permalink
Add the first route and template
Browse files Browse the repository at this point in the history
  • Loading branch information
chrislopresto committed Mar 12, 2015
1 parent a17bdec commit fb670bc
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 52 deletions.
3 changes: 3 additions & 0 deletions app/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ var Router = Ember.Router.extend({
});

Router.map(function() {
this.resource('todos', {
path: '/'
}, function() {});
});

export default Router;
4 changes: 4 additions & 0 deletions app/routes/todos.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import Ember from 'ember';

export default Ember.Route.extend({
});
52 changes: 0 additions & 52 deletions app/templates/application.hbs
Original file line number Diff line number Diff line change
@@ -1,53 +1 @@

<section id="todoapp">
<header id="header">
<h1>todos</h1>
<input type="text" id="new-todo" placeholder="What needs to be done?" />
</header>

<section id="main">
<ul id="todo-list">
<li class="completed">
<input type="checkbox" class="toggle">
<label>Learn Ember.js</label><button class="destroy"></button>
</li>
<li>
<input type="checkbox" class="toggle">
<label>...</label><button class="destroy"></button>
</li>
<li>
<input type="checkbox" class="toggle">
<label>Profit!</label><button class="destroy"></button>
</li>
</ul>

<input type="checkbox" id="toggle-all">
</section>

<footer id="footer">
<span id="todo-count">
<strong>2</strong> todos left
</span>
<ul id="filters">
<li>
<a href="all" class="selected">All</a>
</li>
<li>
<a href="active">Active</a>
</li>
<li>
<a href="completed">Completed</a>
</li>
</ul>

<button id="clear-completed">
Clear completed (1)
</button>
</footer>
</section>

<footer id="info">
<p>Double-click to edit a todo</p>
</footer>

{{outlet}}
50 changes: 50 additions & 0 deletions app/templates/todos.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<section id="todoapp">
<header id="header">
<h1>todos</h1>
<input type="text" id="new-todo" placeholder="What needs to be done?" />
</header>

<section id="main">
<ul id="todo-list">
<li class="completed">
<input type="checkbox" class="toggle">
<label>Learn Ember.js</label><button class="destroy"></button>
</li>
<li>
<input type="checkbox" class="toggle">
<label>...</label><button class="destroy"></button>
</li>
<li>
<input type="checkbox" class="toggle">
<label>Profit!</label><button class="destroy"></button>
</li>
</ul>

<input type="checkbox" id="toggle-all">
</section>

<footer id="footer">
<span id="todo-count">
<strong>2</strong> todos left
</span>
<ul id="filters">
<li>
<a href="all" class="selected">All</a>
</li>
<li>
<a href="active">Active</a>
</li>
<li>
<a href="completed">Completed</a>
</li>
</ul>

<button id="clear-completed">
Clear completed (1)
</button>
</footer>
</section>

<footer id="info">
<p>Double-click to edit a todo</p>
</footer>
14 changes: 14 additions & 0 deletions tests/unit/routes/todos-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import {
moduleFor,
test
} from 'ember-qunit';

moduleFor('route:todos', {
// Specify the other units that are required for this test.
// needs: ['controller:foo']
});

test('it exists', function(assert) {
var route = this.subject();
assert.ok(route);
});

0 comments on commit fb670bc

Please sign in to comment.