Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes template inheritance in option 2 #15

Merged
merged 1 commit into from
Nov 1, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions option2/views/layout.jade
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ body

#container
header
#main(role="main")!=body
#main(role="main")
block content
footer
//! end of #container

Expand All @@ -49,4 +50,4 @@ body
script(src="//ajax.googleapis.com/ajax/libs/chrome-frame/1.0.3/CFInstall.min.js")
script
window.attachEvent('onload',function(){CFInstall.check({mode:'overlay'})})
</html>
</html>
75 changes: 39 additions & 36 deletions option2/views/todo.jade
Original file line number Diff line number Diff line change
@@ -1,40 +1,43 @@
// Todo App Interface
extends layout

#todoapp
.title
h1 Todos
.content
#create-todo
input#new-todo(placeholder="What needs to be done?", type="text")
span.ui-tooltip-top(style="display:none;") Press Enter to save this task
#todos
ul#todo-list
#todo-stats
block content
// Todo App Interface

#todoapp
.title
h1 Todos
.content
#create-todo
input#new-todo(placeholder="What needs to be done?", type="text")
span.ui-tooltip-top(style="display:none;") Press Enter to save this task
#todos
ul#todo-list
#todo-stats

// Templates
script#item-template(type="text/template")
<div class="todo <%= done ? 'done' : '' %>">
.display
<input class="check" type="checkbox" <%= done ? 'checked="checked"' : '' %> />
.todo-text
span#todo-destroy
.edit
input.todo-input(type="text", "value"="")
</div>

script#stats-template(type="text/template")
<% if (total) { %>
span.todo-count
span.number <%= remaining %>
span.word <%= remaining == 1 ? 'item' : 'items' %>
| left.
<% } %>
<% if (done) { %>
span.todo-clear
a(href="#")
| Clear
span.number-done <%= done %>
| completed
span.word-done <%= done == 1 ? 'item' : 'items' %>
<% } %>
// Templates
script#item-template(type="text/template")
<div class="todo <%= done ? 'done' : '' %>">
.display
<input class="check" type="checkbox" <%= done ? 'checked="checked"' : '' %> />
.todo-text
span#todo-destroy
.edit
input.todo-input(type="text", "value"="")
</div>

script#stats-template(type="text/template")
<% if (total) { %>
span.todo-count
span.number <%= remaining %>
span.word <%= remaining == 1 ? 'item' : 'items' %>
| left.
<% } %>
<% if (done) { %>
span.todo-clear
a(href="#")
| Clear
span.number-done <%= done %>
| completed
span.word-done <%= done == 1 ? 'item' : 'items' %>
<% } %>