Permalink
Browse files

Use the book data in the template

  • Loading branch information...
1 parent 02c9d3c commit 07260475cd7bff66fdba813e28e86abb3a911108 @evdb evdb committed Dec 24, 2012
Showing with 13 additions and 2 deletions.
  1. +8 −1 public/index.html
  2. +1 −1 public/js/app.js
  3. +4 −0 public/sass/screen.scss
View
9 public/index.html
@@ -50,5 +50,12 @@
</html>
<script id="book-view-template" type="text/template">
- <span>book view</span>
+ <h1><%- book.title || 'Fetching title...' %></h1>
+
+ <p>
+ <strong>author:</strong> <%- book.author || '???' %>
+ </p>
+ <p>
+ <strong>isbn:</strong> <%- book.isbn || '???' %>
+ </p>
</script>
View
2 public/js/app.js
@@ -23,7 +23,7 @@
var content = _.template(
$("#book-view-template").text(),
- data
+ { book: data }
);
this.$el.html(content);
View
4 public/sass/screen.scss
@@ -18,5 +18,9 @@ h2 { font-size: 1.5em; }
h3 { font-size: 1.25em; }
h4 { font-size: 1em; }
+strong {
+ font-weight: bold;
+}
+
header { border-bottom: 1px solid #888;}
footer { border-top: 1px solid #888;}

0 comments on commit 0726047

Please sign in to comment.