The-Backbone-Store/index.haml

54 lines
1.8 KiB
Plaintext
Raw Normal View History

2011-08-07 19:34:16 +00:00
!!! 5
%html{:xmlns => "http://www.w3.org/1999/xhtml"}
%head
%title The Backbone Store
%link{:charset => "utf-8", :href => "jsonstore.css", :rel => "stylesheet", :type => "text/css"}/
%script#store_index_template(type="text/x-underscore-tmplate")
%h1 Product Catalog
%ul
<% for(i=0,l=products.length;i<l;++i) { p = products[i]; %>
%li.item
.item-image
%a{:href => "#item/<%= p.id %>"}
%img{:src => "<%= p.image %>", :alt => "<%= p.title %>"}/
.item-artist <%= p.artist %>
.item-title <%= p.title %>
.item-price $<%= p.price %>
2011-08-07 19:34:16 +00:00
<% } %>
%script#store_item_template(type= "text/x-underscore-template")
.item-detail
.item-image
%img(src="<%= large_image %>" alt="<%= title %>")/
.item-info
.item-artist <%= artist %>
.item-title <%= title %>
.item-price $<%= price %>
.item-form
%form(action="#/cart" method="post")
%p
%label Quantity:
%input(type="text" size="2" name="quantity" value="1" class="uqf")/
%p
%input(type="submit" value="Add to Cart" class="uq")/
2011-08-07 19:34:16 +00:00
.item-link
%a(href="<%= url %>") Buy this item on Amazon
.back-link
%a(href="#") &laquo; Back to Items
2011-08-07 19:34:16 +00:00
%script#store_cart_template(type="text/x-underscore-template")
%p Items: <%= count %> ($<%= cost %>)
</head>
2011-08-07 19:34:16 +00:00
%body
#container
#header
%h1
The Backbone Store
.cart-info
#main
2011-08-07 19:34:16 +00:00
%script{:src => "jquery-1.6.2.min.js", :type => "text/javascript"}
%script{:src => "underscore.js", :type => "text/javascript"}
%script{:src => "backbone.js", :type => "text/javascript"}
%script{:src => "store.js", :type => "text/javascript"}