remove benchmark dir

This commit is contained in:
Tobias Lütke
2009-06-14 18:05:18 -04:00
parent 1b3b3e4958
commit 5e0ad75ff5
19 changed files with 0 additions and 1801 deletions

View File

@@ -1,85 +0,0 @@
# This profiler run simulates Shopify.
# We are looking in the tests directory for liquid files and render them within the designated layout file.
# We will also export a substantial database to liquid which the templates can render values of.
# All this is to make the benchmark as non syntetic as possible. All templates and tests are lifted from
# direct real-world usage and the profiler measures code that looks very similar to the way it looks in
# Shopify which is likely the biggest user of liquid in the world which something to the tune of several
# million Template#render calls a day.
require 'rubygems'
require 'active_support'
require 'yaml'
require 'digest/md5'
require 'shopify/liquid'
require 'shopify/database.rb'
require "ruby-prof" rescue fail("install ruby-prof extension/gem")
class ThemeProfiler
# Load all templates into memory, do this now so that
# we don't profile IO.
def initialize
@tests = Dir['tests/**/*.liquid'].collect do |test|
next if File.basename(test) == 'theme.liquid'
theme_path = File.dirname(test) + '/theme.liquid'
[File.read(test), (File.file?(theme_path) ? File.read(theme_path) : nil), test]
end.compact
end
def profile
RubyProf.measure_mode = RubyProf::WALL_TIME
# Dup assigns because will make some changes to them
assigns = Database.tables.dup
@tests.each do |liquid, layout, template_name|
# Compute page_tempalte outside of profiler run, uninteresting to profiler
html = nil
page_template = File.basename(template_name, File.extname(template_name))
# Profile compiling and rendering both
RubyProf.resume { html = compile_and_render(liquid, layout, assigns, page_template) }
# return the result and the MD5 of the content, this can be used to detect regressions between liquid version
$stdout.puts "* rendered template %s, content: %s" % [template_name, Digest::MD5.hexdigest(html)]
# Uncomment to dump html files to /tmp so that you can inspect for errors
# File.open("/tmp/#{File.basename(template_name)}.html", "w+") { |fp| fp <<html}
end
RubyProf.stop
end
def compile_and_render(template, layout, assigns, page_template)
tmpl = Liquid::Template.new
tmpl.assigns['page_title'] = 'Page title'
tmpl.assigns['template'] = page_template
content_for_layout = tmpl.parse(template).render(assigns)
if layout
assigns['content_for_layout'] = content_for_layout
tmpl.parse(layout).render(assigns)
else
content_for_layout
end
end
end
profiler = ThemeProfiler.new
results = profiler.profile
[RubyProf::FlatPrinter, RubyProf::GraphPrinter, RubyProf::GraphHtmlPrinter].each do |klass|
filename = (ENV['TMP'] || '/tmp') + (klass.name.include?('Html') ? "/liquid.#{klass.name.downcase}.html" : "/liquid.#{klass.name.downcase}.txt")
File.open(filename, "w+") { |fp| klass.new(results).print(fp) }
$stderr.puts "wrote #{klass.name} output to #{filename}"
end

View File

@@ -1,33 +0,0 @@
class CommentForm < Liquid::Block
Syntax = /(#{Liquid::VariableSignature}+)/
def initialize(tag_name, markup, tokens)
if markup =~ Syntax
@variable_name = $1
@attributes = {}
else
raise SyntaxError.new("Syntax Error in 'comment_form' - Valid syntax: comment_form [article]")
end
super
end
def render(context)
article = context[@variable_name]
context.stack do
context['form'] = {
'posted_successfully?' => context.registers[:posted_successfully],
'errors' => context['comment.errors'],
'author' => context['comment.author'],
'email' => context['comment.email'],
'body' => context['comment.body']
}
wrap_in_form(article, render_all(@nodelist, context))
end
end
def wrap_in_form(article, input)
%Q{<form id="article-#{article.id}-comment-form" class="comment-form" method="post" action="">\n#{input}\n</form>}
end
end

View File

@@ -1,45 +0,0 @@
require 'yaml'
module Database
# Load the standard vision toolkit database and re-arrage it to be simply exportable
# to liquid as assigns. All this is based on Shopify
def self.tables
@tables ||= begin
db = YAML.load_file(File.dirname(__FILE__) + '/vision.database.yml')
# From vision source
db['products'].each do |product|
collections = db['collections'].find_all do |collection|
collection['products'].any? { |p| p['id'].to_i == product['id'].to_i }
end
product['collections'] = collections
end
# key the tables by handles, as this is how liquid expects it.
db = db.inject({}) do |assigns, (key, values)|
assigns[key] = values.inject({}) { |h, v| h[v['handle']] = v; h; }
assigns
end
# Some standard direct accessors so that the specialized templates
# render correctly
db['collection'] = db['collections'].values.first
db['product'] = db['products'].values.first
db['blog'] = db['blogs'].values.first
db['article'] = db['blog']['articles'].first
db['cart'] = {
'total_price' => db['line_items'].values.inject(0) { |sum, item| sum += item['line_price'] * item['quantity'] },
'item_count' => db['line_items'].values.inject(0) { |sum, item| sum += item['quantity'] },
'items' => db['line_items'].values
}
db
end
end
end
if __FILE__ == $0
p Database.tables['collections']['frontpage'].keys
#p Database.tables['blog']['articles']
end

View File

@@ -1,7 +0,0 @@
module JsonFilter
def json(object)
object.reject {|k,v| k == "collections" }.to_json
end
end

View File

@@ -1,18 +0,0 @@
require File.dirname(__FILE__) + '/../../lib/liquid'
require File.dirname(__FILE__) + '/comment_form'
require File.dirname(__FILE__) + '/paginate'
require File.dirname(__FILE__) + '/json_filter'
require File.dirname(__FILE__) + '/money_filter'
require File.dirname(__FILE__) + '/shop_filter'
require File.dirname(__FILE__) + '/tag_filter'
require File.dirname(__FILE__) + '/weight_filter'
Liquid::Template.register_tag 'paginate', Paginate
Liquid::Template.register_tag 'form', CommentForm
Liquid::Template.register_filter JsonFilter
Liquid::Template.register_filter MoneyFilter
Liquid::Template.register_filter WeightFilter
Liquid::Template.register_filter ShopFilter
Liquid::Template.register_filter TagFilter

View File

@@ -1,18 +0,0 @@
module MoneyFilter
def money_with_currency(money)
return '' if money.nil?
sprintf("$ %.2f USD", money/100.0)
end
def money(money)
return '' if money.nil?
sprintf("$ %.2f", money/100.0)
end
private
def currency
ShopDrop.new.currency
end
end

View File

@@ -1,93 +0,0 @@
class Paginate < Liquid::Block
Syntax = /(#{Liquid::QuotedFragment})\s*(by\s*(\d+))?/
def initialize(tag_name, markup, tokens)
@nodelist = []
if markup =~ Syntax
@collection_name = $1
@page_size = if $2
$3.to_i
else
20
end
@attributes = { 'window_size' => 3 }
markup.scan(Liquid::TagAttributes) do |key, value|
@attributes[key] = value
end
else
raise SyntaxError.new("Syntax Error in tag 'paginate' - Valid syntax: paginate [collection] by number")
end
super
end
def render(context)
@context = context
context.stack do
current_page = context['current_page'].to_i
pagination = {
'page_size' => @page_size,
'current_page' => 5,
'current_offset' => @page_size * 5
}
context['paginate'] = pagination
collection_size = context[@collection_name].size
raise ArgumentError.new("Cannot paginate array '#{@collection_name}'. Not found.") if collection_size.nil?
page_count = (collection_size.to_f / @page_size.to_f).to_f.ceil + 1
pagination['items'] = collection_size
pagination['pages'] = page_count -1
pagination['previous'] = link('&laquo; Previous', current_page-1 ) unless 1 >= current_page
pagination['next'] = link('Next &raquo;', current_page+1 ) unless page_count <= current_page+1
pagination['parts'] = []
hellip_break = false
if page_count > 2
1.upto(page_count-1) do |page|
if current_page == page
pagination['parts'] << no_link(page)
elsif page == 1
pagination['parts'] << link(page, page)
elsif page == page_count -1
pagination['parts'] << link(page, page)
elsif page <= current_page - @attributes['window_size'] or page >= current_page + @attributes['window_size']
next if hellip_break
pagination['parts'] << no_link('&hellip;')
hellip_break = true
next
else
pagination['parts'] << link(page, page)
end
hellip_break = false
end
end
render_all(@nodelist, context)
end
end
private
def no_link(title)
{ 'title' => title, 'is_link' => false}
end
def link(title, page)
{ 'title' => title, 'url' => current_url + "?page=#{page}", 'is_link' => true}
end
def current_url
"/collections/frontpage"
end
end

View File

@@ -1,98 +0,0 @@
module ShopFilter
def asset_url(input)
"/files/1/[shop_id]/[shop_id]/assets/#{input}"
end
def global_asset_url(input)
"/global/#{input}"
end
def shopify_asset_url(input)
"/shopify/#{input}"
end
def script_tag(url)
%(<script src="#{url}" type="text/javascript"></script>)
end
def stylesheet_tag(url, media="all")
%(<link href="#{url}" rel="stylesheet" type="text/css" media="#{media}" />)
end
def link_to(link, url, title="")
%|<a href="#{url}" title="#{title}">#{link}</a>|
end
def img_tag(url, alt="")
%|<img src="#{url}" alt="#{alt}" />|
end
def link_to_vendor(vendor)
if vendor
link_to vendor, url_for_vendor(vendor), vendor
else
'Unknown Vendor'
end
end
def link_to_type(type)
if type
link_to type, url_for_type(type), type
else
'Unknown Vendor'
end
end
def url_for_vendor(vendor_title)
"/collections/#{vendor_title.to_handle}"
end
def url_for_type(type_title)
"/collections/#{type_title.to_handle}"
end
def product_img_url(url, style = 'small')
unless url =~ /^products\/([\w\-\_]+)\.(\w{2,4})/
raise ArgumentError, 'filter "size" can only be called on product images'
end
case style
when 'original'
return '/files/shops/random_number/' + url
when 'grande', 'large', 'medium', 'small', 'thumb', 'icon'
"/files/shops/random_number/products/#{$1}_#{style}.#{$2}"
else
raise ArgumentError, 'valid parameters for filter "size" are: original, grande, large, medium, small, thumb and icon '
end
end
def default_pagination(paginate)
html = []
html << %(<span class="prev">#{link_to(paginate['previous']['title'], paginate['previous']['url'])}</span>) if paginate['previous']
for part in paginate['parts']
if part['is_link']
html << %(<span class="page">#{link_to(part['title'], part['url'])}</span>)
elsif part['title'].to_i == paginate['current_page'].to_i
html << %(<span class="page current">#{part['title']}</span>)
else
html << %(<span class="deco">#{part['title']}</span>)
end
end
html << %(<span class="next">#{link_to(paginate['next']['title'], paginate['next']['url'])}</span>) if paginate['next']
html.join(' ')
end
# Accepts a number, and two words - one for singular, one for plural
# Returns the singular word if input equals 1, otherwise plural
def pluralize(input, singular, plural)
input == 1 ? singular : plural
end
end

View File

@@ -1,25 +0,0 @@
module TagFilter
def link_to_tag(label, tag)
"<a title=\"Show tag #{tag}\" href=\"/collections/#{@context['handle']}/#{tag}\">#{label}</a>"
end
def highlight_active_tag(tag, css_class='active')
if @context['current_tags'].include?(tag)
"<span class=\"#{css_class}\">#{tag}</span>"
else
tag
end
end
def link_to_add_tag(label, tag)
tags = (@context['current_tags'] + [tag]).uniq
"<a title=\"Show tag #{tag}\" href=\"/collections/#{@context['handle']}/#{tags.join("+")}\">#{label}</a>"
end
def link_to_remove_tag(label, tag)
tags = (@context['current_tags'] - [tag]).uniq
"<a title=\"Show tag #{tag}\" href=\"/collections/#{@context['handle']}/#{tags.join("+")}\">#{label}</a>"
end
end

View File

@@ -1,945 +0,0 @@
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# Variants
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
product_variants:
- &product-1-var-1
id: 1
title: 151cm / Normal
price: 19900
weight: 1000
compare_at_price: 49900
available: true
inventory_quantity: 5
option1: 151cm
option2: Normal
option3:
- &product-1-var-2
id: 2
title: 155cm / Normal
price: 31900
weight: 1000
compare_at_price: 50900
available: true
inventory_quantity: 2
option1: 155cm
option2: Normal
option3:
- &product-2-var-1
id: 3
title: 162cm
price: 29900
weight: 1000
compare_at_price: 52900
available: true
inventory_quantity: 3
option1: 162cm
option2:
option3:
- &product-3-var-1
id: 4
title: 159cm
price: 19900
weight: 1000
compare_at_price:
available: true
inventory_quantity: 4
option1: 159cm
option2:
option3:
- &product-4-var-1
id: 5
title: 159cm
price: 19900
weight: 1000
compare_at_price: 32900
available: true
inventory_quantity: 6
option1: 159cm
option2:
option3:
- &product-1-var-3
id: 6
title: 158cm / Wide
price: 23900
weight: 1000
compare_at_price: 99900
available: false
inventory_quantity: 0
option1: 158cm
option2: Wide
option3:
- &product-3-var-2
id: 7
title: 162cm
price: 19900
weight: 1000
compare_at_price:
available: false
inventory_quantity: 0
option1: 162cm
option2:
option3:
- &product-3-var-3
id: 8
title: 165cm
price: 22900
weight: 1000
compare_at_price:
available: true
inventory_quantity: 4
option1: 165cm
option2:
option3:
- &product-5-var-1
id: 9
title: black / 42
price: 11900
weight: 500
compare_at_price: 22900
available: true
inventory_quantity: 1
option1: black
option2: 42
option3:
- &product-5-var-2
id: 10
title: beige / 42
price: 11900
weight: 500
compare_at_price: 22900
available: true
inventory_quantity: 3
option1: beige
option2: 42
option3:
- &product-5-var-3
id: 11
title: white / 42
price: 13900
weight: 500
compare_at_price: 24900
available: true
inventory_quantity: 1
option1: white
option2: 42
option3:
- &product-5-var-4
id: 12
title: black / 44
price: 11900
weight: 500
compare_at_price: 22900
available: true
inventory_quantity: 2
option1: black
option2: 44
option3:
- &product-5-var-5
id: 13
title: beige / 44
price: 11900
weight: 500
compare_at_price: 22900
available: false
inventory_quantity: 0
option1: beige
option2: 44
option3:
- &product-5-var-6
id: 14
title: white / 44
price: 13900
weight: 500
compare_at_price: 24900
available: false
inventory_quantity: 0
option1: white
option2: 44
option3:
- &product-6-var-1
id: 15
title: red
price: 2179500
weight: 200000
compare_at_price:
available: true
inventory_quantity: 0
option1: red
option2:
option3:
- &product-7-var-1
id: 16
title: black / small
price: 1900
weight: 200
compare_at_price:
available: true
inventory_quantity: 20
option1: black
option2: small
option3:
- &product-7-var-2
id: 17
title: black / medium
price: 1900
weight: 200
compare_at_price:
available: false
inventory_quantity: 0
option1: black
option2: medium
option3:
- &product-7-var-3
id: 18
title: black / large
price: 1900
weight: 200
compare_at_price:
available: true
inventory_quantity: 10
option1: black
option2: large
option3:
- &product-7-var-4
id: 19
title: black / extra large
price: 1900
weight: 200
compare_at_price:
available: false
inventory_quantity: 0
option1: black
option2: extra large
option3:
- &product-8-var-1
id: 20
title: brown / small
price: 5900
weight: 400
compare_at_price: 6900
available: true
inventory_quantity: 5
option1: brown
option2: small
option3:
- &product-8-var-2
id: 21
title: brown / medium
price: 5900
weight: 400
compare_at_price: 6900
available: false
inventory_quantity: 0
option1: brown
option2: medium
option3:
- &product-8-var-3
id: 22
title: brown / large
price: 5900
weight: 400
compare_at_price: 6900
available: true
inventory_quantity: 10
option1: brown
option2: large
option3:
- &product-8-var-4
id: 23
title: black / small
price: 5900
weight: 400
compare_at_price: 6900
available: true
inventory_quantity: 10
option1: black
option2: small
option3:
- &product-8-var-5
id: 24
title: black / medium
price: 5900
weight: 400
compare_at_price: 6900
available: true
inventory_quantity: 10
option1: black
option2: medium
option3:
- &product-8-var-6
id: 25
title: black / large
price: 5900
weight: 400
compare_at_price: 6900
available: false
inventory_quantity: 0
option1: black
option2: large
option3:
- &product-9-var-1
id: 26
title: Body Only
price: 499995
weight: 2000
compare_at_price:
available: true
inventory_quantity: 3
option1: Body Only
option2:
option3:
- &product-9-var-2
id: 27
title: Kit with 18-55mm VR lens
price: 523995
weight: 2000
compare_at_price:
available: true
inventory_quantity: 2
option1: Kit with 18-55mm VR lens
option2:
option3:
- &product-9-var-3
id: 28
title: Kit with 18-200 VR lens
price: 552500
weight: 2000
compare_at_price:
available: true
inventory_quantity: 3
option1: Kit with 18-200 VR lens
option2:
option3:
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# Products
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
products:
- &product-1
id: 1
title: Arbor Draft
handle: arbor-draft
type: Snowboards
vendor: Arbor
price: 23900
price_max: 31900
price_min: 23900
price_varies: true
available: true
tags:
- season2005
- pro
- intermediate
- wooden
- freestyle
options:
- Length
- Style
compare_at_price: 49900
compare_at_price_max: 50900
compare_at_price_min: 49900
compare_at_price_varies: true
url: /products/arbor-draft
featured_image: products/arbor_draft.jpg
images:
- products/arbor_draft.jpg
description:
The Arbor Draft snowboard wouldn't exist if Polynesians hadn't figured out how to surf hundreds of years ago. But the Draft does exist, and it's here to bring your urban and park riding to a new level. The board's freaky Tiki design pays homage to culture that inspired snowboarding. It's designed to spin with ease, land smoothly, lock hook-free onto rails, and take the abuse of a pavement pounding or twelve. The Draft will pop off kickers with authority and carve solidly across the pipe. The Draft features targeted Koa wood die cuts inlayed into the deck that enhance the flex pattern. Now bow down to riding's ancestors.
variants:
- *product-1-var-1
- *product-1-var-2
- *product-1-var-3
- &product-2
id: 2
title: Arbor Element
handle: arbor-element
type: Snowboards
vendor: Arbor
price: 29900
price_max: 29900
price_min: 29900
price_varies: false
available: true
tags:
- season2005
- pro
- wooden
- freestyle
options:
- Length
compare_at_price: 52900
compare_at_price_max: 52900
compare_at_price_min: 52900
compare_at_price_varies: false
url: /products/arbor-element
featured_image: products/element58.jpg
images:
- products/element58.jpg
description:
The Element is a technically advanced all-mountain board for riders who readily transition from one terrain, snow condition, or riding style to another. Its balanced design provides the versatility needed for the true ride-it-all experience. The Element is exceedingly lively, freely initiates, and holds a tight edge at speed. Its structural real-wood topsheet is made with book-matched Koa.
variants:
- *product-2-var-1
- &product-3
id: 3
title: Comic ~ Pastel
handle: comic-pastel
type: Snowboards
vendor: Technine
price: 19900
price_max: 22900
price_min: 19900
tags:
- season2006
- beginner
- intermediate
- freestyle
- purple
options:
- Length
price_varies: true
available: true
compare_at_price:
compare_at_price_max: 0
compare_at_price_min: 0
compare_at_price_varies: false
url: /products/comic-pastel
featured_image: products/technine1.jpg
images:
- products/technine1.jpg
- products/technine2.jpg
- products/technine_detail.jpg
description:
2005 Technine Comic Series Description The Comic series was developed to be the ultimate progressive freestyle board in the Technine line. Dependable edge control and a perfect flex pattern for jumping in the park or out of bounds. Landins and progression will come easy with this board and it will help your riding progress to the next level. Street rails, park jibs, backcountry booters and park jumps, this board will do it all.
variants:
- *product-3-var-1
- *product-3-var-2
- *product-3-var-3
- &product-4
id: 4
title: Comic ~ Orange
handle: comic-orange
type: Snowboards
vendor: Technine
price: 19900
price_max: 19900
price_min: 19900
price_varies: false
available: true
tags:
- season2006
- beginner
- intermediate
- freestyle
- orange
options:
- Length
compare_at_price: 32900
compare_at_price_max: 32900
compare_at_price_min: 32900
compare_at_price_varies: false
url: /products/comic-orange
featured_image: products/technine3.jpg
images:
- products/technine3.jpg
- products/technine4.jpg
description:
2005 Technine Comic Series Description The Comic series was developed to be the ultimate progressive freestyle board in the Technine line. Dependable edge control and a perfect flex pattern for jumping in the park or out of bounds. Landins and progression will come easy with this board and it will help your riding progress to the next level. Street rails, park jibs, backcountry booters and park jumps, this board will do it all.
variants:
- *product-4-var-1
- &product-5
id: 5
title: Burton Boots
handle: burton-boots
type: Boots
vendor: Burton
price: 11900
price_max: 11900
price_min: 11900
price_varies: false
available: true
tags:
- season2006
- beginner
- intermediate
- boots
options:
- Color
- Shoe Size
compare_at_price: 22900
compare_at_price_max: 22900
compare_at_price_min: 22900
compare_at_price_varies: false
url: /products/burton-boots
featured_image: products/burton.jpg
images:
- products/burton.jpg
description:
The Burton boots are particularly well on snowboards. The very best thing about them is that the according picture is cubic. This makes testing in a Vision testing environment very easy.
variants:
- *product-5-var-1
- *product-5-var-2
- *product-5-var-3
- *product-5-var-4
- *product-5-var-5
- *product-5-var-6
- &product-6
id: 6
title: Superbike 1198 S
handle: superbike
type: Superbike
vendor: Ducati
price: 2179500
price_max: 2179500
price_min: 2179500
price_varies: false
available: true
tags:
- ducati
- superbike
- bike
- street
- racing
- performance
options:
- Color
compare_at_price:
compare_at_price_max: 0
compare_at_price_min: 0
compare_at_price_varies: false
url: /products/superbike
featured_image: products/ducati.jpg
images:
- products/ducati.jpg
description:
<h3>S PERFORMANCE</h3>
<p>Producing 170hp (125kW) and with a dry weight of just 169kg (372.6lb), the new 1198 S now incorporates more World Superbike technology than ever before by taking the 1198 motor and adding top-of-the-range suspension, lightweight chassis components and a true racing-style traction control system designed for road use.</p>
<p>The high performance, fully adjustable 43mm Öhlins forks, which sport low friction titanium nitride-treated fork sliders, respond effortlessly to every imperfection in the tarmac. Beyond their advanced engineering solutions, one of the most important characteristics of Öhlins forks is their ability to communicate the condition and quality of the tyre-to-road contact patch, a feature that puts every rider in superior control. The suspension set-up at the rear is complemented with a fully adjustable Öhlins rear shock equipped with a ride enhancing top-out spring and mounted to a single-sided swingarm for outstanding drive and traction. The front-to-rear Öhlins package is completed with a control-enhancing adjustable steering damper.</p>
variants:
- *product-6-var-1
- &product-7
id: 7
title: Shopify Shirt
handle: shopify-shirt
type: Shirt
vendor: Shopify
price: 1900
price_max: 1900
price_min: 1900
price_varies: false
available: true
tags:
- shopify
- shirt
- apparel
- tshirt
- clothing
options:
- Color
- Size
compare_at_price:
compare_at_price_max: 0
compare_at_price_min: 0
compare_at_price_varies: false
url: /products/shopify-shirt
featured_image: products/shopify_shirt.png
images:
- products/shopify_shirt.png
description:
<p>High Quality Shopify Shirt. Wear your e-commerce solution with pride and attract attention anywhere you go.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
variants:
- *product-7-var-1
- *product-7-var-2
- *product-7-var-3
- *product-7-var-4
- &product-8
id: 8
title: Hooded Sweater
handle: hooded-sweater
type: Sweater
vendor: Stormtech
price: 5900
price_max: 5900
price_min: 5900
price_varies: false
available: true
tags:
- sweater
- hooded
- apparel
- clothing
options:
- Color
- Size
compare_at_price: 6900
compare_at_price_max: 6900
compare_at_price_min: 6900
compare_at_price_varies: false
url: /products/hooded-sweater
featured_image: products/hooded-sweater.jpg
images:
- products/hooded-sweater.jpg
- products/hooded-sweater-b.jpg
description:
<p>Extra comfortable zip up sweater. Durable quality, ideal for any outdoor activities.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
variants:
- *product-8-var-1
- *product-8-var-2
- *product-8-var-3
- *product-8-var-4
- *product-8-var-5
- *product-8-var-6
- &product-9
id: 9
title: D3 Digital SLR Camera
handle: d3
type: SLR
vendor: Nikon
price: 499995
price_max: 552500
price_min: 499995
price_varies: true
available: true
tags:
- camera
- slr
- nikon
- professional
options:
- Bundle
compare_at_price:
compare_at_price_max: 0
compare_at_price_min: 0
compare_at_price_varies: false
url: /products/d3
featured_image: products/d3.jpg
images:
- products/d3.jpg
- products/d3_2.jpg
- products/d3_3.jpg
description:
<p>Flagship pro D-SLR with a 12.1-MP FX-format CMOS sensor, blazing 9 fps shooting at full FX resolution and low-noise performance up to 6400 ISO.</p>
<p><strong>Nikon's original 12.1-megapixel FX-format (23.9 x 36mm) CMOS sensor:</strong> Couple Nikon's exclusive digital image processing system with the 12.1-megapixel FX-format and you'll get breathtakingly rich images while also reducing noise to unprecedented levels with even higher ISOs.</p>
<p><strong>Continuous shooting at up to 9 frames per second:</strong> At full FX resolution and up to 11fps in the DX crop mode, the D3 offers uncompromised shooting speeds for fast-action and sports photography.</p>
variants:
- *product-9-var-1
- *product-9-var-2
- *product-9-var-3
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# Line Items
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
line_items:
- &line_item-1
id: 1
title: 'Arbor Draft'
subtitle: '151cm'
price: 29900
line_price: 29900
quantity: 1
variant: *product-1-var-1
product: *product-1
- &line_item-2
id: 2
title: 'Comic ~ Orange'
subtitle: '159cm'
price: 19900
line_price: 39800
quantity: 2
variant: *product-4-var-1
product: *product-4
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# Link Lists
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
links:
- &link-1
id: 1
title: Our Sale
url: /collections/sale
- &link-2
id: 2
title: Arbor Stuff
url: /collections/arbor
- &link-3
id: 3
title: All our Snowboards
url: /collections/snowboards
- &link-4
id: 4
title: Powered by Shopify
url: 'http://shopify.com'
- &link-5
id: 5
title: About Us
url: /pages/about-us
- &link-6
id: 6
title: Policies
url: /pages/shipping
- &link-7
id: 7
title: Contact Us
url: /pages/contact
- &link-8
id: 8
title: Our blog
url: /blogs/bigcheese-blog
- &link-9
id: 9
title: New Boots
url: /products/burton-boots
- &link-10
id: 10
title: Paginated Sale
url: /collections/paginated-sale
- &link-11
id: 11
title: Our Paginated blog
url: /blogs/paginated-blog
- &link-12
id: 12
title: Catalog
url: /collections/all
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# Link Lists
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
link_lists:
- &link-list-1
id: 1
title: 'Main Menu'
handle: 'main-menu'
links:
- *link-12
- *link-5
- *link-7
- *link-8
- &link-list-2
id: 1
title: 'Footer Menu'
handle: 'footer'
links:
- *link-5
- *link-6
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# Collections
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
collections:
- &collection-1
id: 1
title: Frontpage
handle: frontpage
url: /collections/frontpage
products:
- *product-7
- *product-8
- *product-9
- &collection-2
id: 2
title: Arbor
handle: arbor
url: /collections/arbor
products:
- *product-1
- *product-2
- &collection-3
id: 3
title: Snowboards
handle: snowboards
url: /collections/snowboards
description:
<p>This is a description for my <strong>Snowboards</strong> collection.</p>
products:
- *product-1
- *product-2
- *product-3
- *product-4
- &collection-4
id: 4
title: Items On Sale
handle: sale
url: /collections/sale
products:
- *product-1
- &collection-5
id: 5
title: Paginated Sale
handle: 'paginated-sale'
url: '/collections/paginated-sale'
products:
- *product-1
- *product-2
- *product-3
- *product-4
products_count: 210
- &collection-6
id: 6
title: All products
handle: 'all'
url: '/collections/all'
products:
- *product-7
- *product-8
- *product-9
- *product-6
- *product-1
- *product-2
- *product-3
- *product-4
- *product-5
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# Pages and Blogs
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
pages:
- &page-2
id: 1
title: Contact Us
handle: contact
url: /pages/contact
author: Tobi
content:
"<p>You can contact us via phone under (555) 567-2222.</p>
<p>Our retail store is located at <em>Rue d'Avignon 32, Avignon (Provence)</em>.</p>
<p><strong>Opening Hours:</strong><br />Monday through Friday: 9am - 6pm<br />Saturday: 10am - 3pm<br />Sunday: closed</p>"
created_at: 2005-04-04 12:00
- &page-3
id: 2
title: About Us
handle: about-us
url: /pages/about-us
author: Tobi
content:
"<p>Our company was founded in 1894 and we are since operating out of Avignon from the beautiful Provence.</p>
<p>We offer the highest quality products and are proud to serve our customers to their heart's content.</p>"
created_at: 2005-04-04 12:00
- &page-4
id: 3
title: Shopping Cart
handle: shopping-cart
url: /pages/shopping-cart
author: Tobi
content: "<ul><li>Your order is safe with us. Our checkout uses industry standard security to protect your information.</li><li>Your order will be billed immediately upon checkout.</li><li><b>ALL SALES ARE FINAL:</b> Defective or damaged product will be exchanged</li><li>All orders are processed expediently: usually in under 24 hours.</li></ul>"
created_at: 2005-04-04 12:00
- &page-5
id: 4
title: Shipping and Handling
handle: shipping
url: /pages/shipping
author: Tobi
content: <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
created_at: 2005-04-04 12:00
- &page-6
id: 5
title: Frontpage
handle: frontpage
url: /pages/frontpage
author: Tobi
content: <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
created_at: 2005-04-04 12:00
blogs:
- id: 1
handle: news
title: News
url: /blogs/news
articles:
- id: 3
title: 'Welcome to the new Foo Shop'
author: Daniel
content: <p><strong>Welcome to your Shopify store! The jaded Pixel crew is really glad you decided to take Shopify for a spin.</strong></p><p>To help you get you started with Shopify, here are a couple of tips regarding what you see on this page.</p><p>The text you see here is an article. To edit this article, create new articles or create new pages you can go to the <a href="/admin/pages">Blogs &amp; Pages</a> tab of the administration menu.</p><p>The Shopify t-shirt above is a product and selling products is what Shopify is all about. To edit this product, or create new products you can go to the <a href="/admin/products">Products Tab</a> in of the administration menu.</p><p>While you're looking around be sure to check out the <a href="/admin/collections">Collections</a> and <a href="/admin/links">Navigations</a> tabs and soon you will be well on your way to populating your site.</p><p>And of course don't forget to browse the <a href="admin/design/appearance/themes">theme gallery</a> to pick a new look for your shop!</p><p><strong>Shopify is in beta</strong><br />If you would like to make comments or suggestions please visit us in the <a href="http://forums.shopify.com/community">Shopify Forums</a> or drop us an <a href="mailto:feedback@shopify.com">email</a>.</p>
created_at: 2005-04-04 16:00
- id: 4
title: 'Breaking News: Restock on all sales products'
author: Tobi
content: Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
created_at: 2005-04-04 12:00
articles_count: 2
- id: 2
handle: bigcheese-blog
title: Bigcheese blog
url: /blogs/bigcheese-blog
articles:
- id: 1
title: 'One thing you probably did not know yet...'
author: Justin
content: Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
created_at: 2005-04-04 16:00
comments:
-
id: 1
author: John Smith
email: john@smith.com
content: Wow...great article man.
status: published
created_at: 2009-01-01 12:00
updated_at: 2009-02-01 12:00
url: ""
-
id: 2
author: John Jones
email: john@jones.com
content: I really enjoyed this article. And I love your shop! It's awesome. Shopify rocks!
status: published
created_at: 2009-03-01 12:00
updated_at: 2009-02-01 12:00
url: "http://somesite.com/"
- id: 2
title: Fascinating
author: Tobi
content: Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
created_at: 2005-04-06 12:00
comments:
articles_count: 2
comments_enabled?: true
comment_post_url: ""
comments_count: 2
moderated?: true
- id: 3
handle: paginated-blog
title: Paginated blog
url: /blogs/paginated-blog
articles:
- id: 6
title: 'One thing you probably did not know yet...'
author: Justin
content: Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
created_at: 2005-04-04 16:00
- id: 7
title: Fascinating
author: Tobi
content: Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
created_at: 2005-04-06 12:00
articles_count: 200

View File

@@ -1,11 +0,0 @@
module WeightFilter
def weight(grams)
sprintf("%.2f", grams / 1000)
end
def weight_with_unit(grams)
"#{weight(grams)} kg"
end
end

View File

@@ -1,74 +0,0 @@
<div class="article">
<h2 class="article-title">{{ article.title }}</h2>
<p class="article-details">posted <span class="article-time">{{ article.created_at | date: "%Y %h" }}</span> by <span class="article-author">{{ article.author }}</span></p>
<div class="article-body textile">
{{ article.content }}
</div>
</div>
<!-- Comments -->
{% if blog.comments_enabled? %}
<div id="comments">
<h3>Comments</h3>
<!-- List all comments -->
<ul id="comment-list">
{% for comment in article.comments %}
<li>
<div class="comment-details">
<span class="comment-author">{{ comment.author }}</span> said on <span class="comment-date">{{ comment.created_at | date: "%B %d, %Y" }}</span>:
</div>
<div class="comment">
{{ comment.content }}
</div>
</li>
{% endfor %}
</ul>
<!-- Comment Form -->
<div id="comment-form">
{% form article %}
<h3>Leave a comment</h3>
<!-- Check if a comment has been submitted in the last request, and if yes display an appropriate message -->
{% if form.posted_successfully? %}
{% if blog.moderated? %}
<div class="notice">
Successfully posted your comment.<br />
It will have to be approved by the blog owner first before showing up.
</div>
{% else %}
<div class="notice">Successfully posted your comment.</div>
{% endif %}
{% endif %}
{% if form.errors %}
<div class="notice error">Not all the fields have been filled out correctly!</div>
{% endif %}
<dl>
<dt class="{% if form.errors contains 'author' %}error{% endif %}"><label for="comment_author">Your name</label></dt>
<dd><input type="text" id="comment_author" name="comment[author]" size="40" value="{{form.author}}" class="{% if form.errors contains 'author' %}input-error{% endif %}" /></dd>
<dt class="{% if form.errors contains 'email' %}error{% endif %}"><label for="comment_email">Your email</label></dt>
<dd><input type="text" id="comment_email" name="comment[email]" size="40" value="{{form.email}}" class="{% if form.errors contains 'email' %}input-error{% endif %}" /></dd>
<dt class="{% if form.errors contains 'body' %}error{% endif %}"><label for="comment_body">Your comment</label></dt>
<dd><textarea id="comment_body" name="comment[body]" cols="40" rows="5" class="{% if form.errors contains 'body' %}input-error{% endif %}">{{form.body}}</textarea></dd>
</dl>
{% if blog.moderated? %}
<p class="hint">comments have to be approved before showing up</p>
{% endif %}
<input type="submit" value="Post comment" id="comment-submit" />
{% endform %}
</div>
<!-- END Comment Form -->
</div>
{% endif %}
<!-- END Comments -->

View File

@@ -1,33 +0,0 @@
<div id="page">
<h2>{{page.title}}</h2>
{% paginate blog.articles by 20 %}
{% for article in blog.articles %}
<div class="article">
<div class="headline">
<h3 class="title">
<a href="{{article.url}}">{{ article.title }}</a>
</h3>
<h4 class="date">Posted on {{ article.created_at | date: "%B %d, '%y" }} by {{ article.author }}.</h4>
</div>
<div class="article-body textile">
{{ article.content | strip_html | truncate: 250 }}
</div>
{% if blog.comments_enabled? %}
<p style="text-align: right"><a href="{{article.url}}#comments">{{ article.comments_count }} comments</a></p>
{% endif %}
</div>
{% endfor %}
<div id="pagination">
{{ paginate | default_pagination }}
</div>
{% endpaginate %}
</div>

View File

@@ -1,66 +0,0 @@
<script type="text/javascript">
function remove_item(id) {
document.getElementById('updates_'+id).value = 0;
document.getElementById('cartform').submit();
}
</script>
<div>
{% if cart.item_count == 0 %}
<h4>Your shopping cart is looking rather empty...</h4>
{% else %}
<form action="/cart" method="post" id="cartform">
<div id="cart">
<h3>You have {{ cart.item_count }} {{ cart.item_count | pluralize: 'product', 'products' }} in here!</h3>
<ul id="line-items">
{% for item in cart.items %}
<li id="item-{{item.id}}" class="clearfix">
<div class="thumb">
<div class="prodimage">
<a href="{{item.product.url}}" title="View {{item.title}} Page"><img src="{{item.product.featured_image | product_img_url: 'thumb' }}" alt="{{item.title | escape }}" /></a>
</div></div>
<h3 style="padding-right: 150px">
<a href="{{item.product.url}}" title="View {{item.title | escape }} Page">
{{ item.title }}
{% if item.variant.available == true %}
({{item.variant.title}})
{% endif %}
</a>
</h3>
<small class="itemcost">Costs {{ item.price | money }} each, <span class="money">{{item.line_price | money }}</span> total.</small>
<p class="right">
<label for="updates">How many? </label>
<input type="text" size="4" name="updates[{{item.variant.id}}]" id="updates_{{item.variant.id}}" value="{{item.quantity}}" onfocus="this.select();"/><br />
<a href="#" onclick="remove_item({{item.variant.id}}); return false;" class="remove"><img style="padding:15px 0 0 0;margin:0;" src="{{ 'delete.gif' | asset_url }}" /></a>
</p>
</li>
{% endfor %}
<li id="total">
<input type="image" id="update-cart" name="update" value="Update My Cart" src="{{ 'update.gif' | asset_url }}" />
Subtotal:
<span class="money">{{ cart.total_price | money_with_currency }}</span>
</li>
</ul>
</div>
<div class="info">
<input type="image" value="Checkout!" name="checkout" src="{{ 'checkout.gif' | asset_url }}" />
</div>
{% if additional_checkout_buttons %}
<div class="additional-checkout-buttons">
<p>- or -</p>
{{ content_for_additional_checkout_buttons }}
</div>
{% endif %}
</form>
{% endif %}
</div>

View File

@@ -1,22 +0,0 @@
{% paginate collection.products by 20 %}
<ul id="product-collection">
{% for product in collection.products %}
<li class="singleproduct clearfix">
<div class="small">
<div class="prodimage"><a href="{{product.url}}"><img src="{{ product.featured_image | product_img_url: 'small' }}" /></a></div>
</div>
<div class="description">
<h3><a href="{{product.url}}">{{product.title}}</a></h3>
<p>{{ product.description | strip_html | truncatewords: 35 }}</p>
<p class="money">{{ product.price_min | money }}{% if product.price_varies %} - {{ product.price_max | money }}{% endif %}</p>
</div>
</li>
{% endfor %}
</ul>
<div id="pagination">
{{ paginate | default_pagination }}
</div>
{% endpaginate %}

View File

@@ -1,47 +0,0 @@
<div id="frontproducts"><div id="frontproducts-top"><div id="frontproducts-bottom">
<h2 style="display: none;">Featured Items</h2>
{% for product in collections.frontpage.products limit:1 offset:0 %}
<div class="productmain">
<a href="{{ product.url }}"><img src="{{ product.featured_image | product_img_url: 'small' }}" alt="{{ product.title | escape }}" /></a>
<h3><a href="{{ product.url }}">{{ product.title }}</a></h3>
<div class="description">{{ product.description | strip_html | truncatewords: 18 }}</div>
<p class="money">{{ product.price_min | money }}</p>
</div>
{% endfor %}
{% for product in collections.frontpage.products offset:1 %}
<div class="product">
<a href="{{ product.url }}"><img src="{{ product.featured_image | product_img_url: 'thumb' }}" alt="{{ product.title | escape }}" /></a>
<h3><a href="{{ product.url }}">{{ product.title }}</a></h3>
<p class="money">{{ product.price_min | money }}</p>
</div>
{% endfor %}
</div></div></div>
<div id="mainarticle">
{% assign article = pages.frontpage %}
{% if article.content != "" %}
<h2>{{ article.title }}</h2>
<div class="article-body textile">
{{ article.content }}
</div>
{% else %}
<div class="article-body textile">
In <em>Admin &gt; Blogs &amp; Pages</em>, create a page with the handle <strong><code>frontpage</code></strong> and it will show up here.<br />
{{ "Learn more about handles" | link_to "http://wiki.shopify.com/Handle" }}
</div>
{% endif %}
</div>
<br style="clear: both;" />
<div id="articles">
{% for article in blogs.news.articles offset:1 %}
<div class="article">
<h2>{{ article.title }}</h2>
<div class="article-body textile">
{{ article.content }}
</div>
</div>
{% endfor %}
</div>

View File

@@ -1,8 +0,0 @@
<div id="page">
<h2>{{page.title}}</h2>
<div class="article textile">
{{page.content}}
</div>
</div>

View File

@@ -1,68 +0,0 @@
<div id="productpage">
<div id="productimages"><div id="productimages-top"><div id="productimages-bottom">
{% for image in product.images %}
{% if forloop.first %}
<a href="{{ image | product_img_url: 'large' }}" class="productimage" rel="lightbox">
<img src="{{ image | product_img_url: 'medium'}}" alt="{{product.title | escape }}" />
</a>
{% else %}
<a href="{{ image | product_img_url: 'large' }}" class="productimage-small" rel="lightbox">
<img src="{{ image | product_img_url: 'small'}}" alt="{{product.title | escape }}" />
</a>
{% endif %}
{% endfor %}
</div></div></div>
<h2>{{ product.title }}</h2>
<ul id="details" class="hlist">
<li>Vendor: {{ product.vendor | link_to_vendor }}</li>
<li>Type: {{ product.type | link_to_type }}</li>
</ul>
<small>{{ product.price_min | money }}{% if product.price_varies %} - {{ product.price_max | money }}{% endif %}</small>
<div id="variant-add">
<form action="/cart/add" method="post">
<select id="variant-select" name="id" class="product-info-options">
{% for variant in product.variants %}
<option value="{{ variant.id }}">{{ variant.title }} - {{ variant.price | money }}</option>
{% endfor %}
</select>
<div id="price-field" class="price"></div>
<div style="text-align:center;"><input type="image" name="add" value="Add to Cart" id="add" src="{{ 'addtocart.gif' | asset_url }}" /></div>
</form>
</div>
<div class="description textile">
{{ product.description }}
</div>
</div>
<script type="text/javascript">
<!--
// prototype callback for multi variants dropdown selector
var selectCallback = function(variant, selector) {
if (variant && variant.available == true) {
// selected a valid variant
$('add').removeClassName('disabled'); // remove unavailable class from add-to-cart button
$('add').disabled = false; // reenable add-to-cart button
$('price-field').innerHTML = Shopify.formatMoney(variant.price, "{{shop.money_with_currency_format}}"); // update price field
} else {
// variant doesn't exist
$('add').addClassName('disabled'); // set add-to-cart button to unavailable class
$('add').disabled = true; // disable add-to-cart button
$('price-field').innerHTML = (variant) ? "Sold Out" : "Unavailable"; // update price-field message
}
};
// initialize multi selector for product
Event.observe(document, 'dom:loaded', function() {
new Shopify.OptionSelectors("variant-select", { product: {{ product | json }}, onVariantSelected: selectCallback });
});
-->
</script>

View File

@@ -1,105 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>{{shop.name}} - {{page_title}}</title>
{{ 'textile.css' | global_asset_url | stylesheet_tag }}
{{ 'lightbox/v204/lightbox.css' | global_asset_url | stylesheet_tag }}
{{ 'prototype/1.6/prototype.js' | global_asset_url | script_tag }}
{{ 'scriptaculous/1.8.2/scriptaculous.js' | global_asset_url | script_tag }}
{{ 'lightbox/v204/lightbox.js' | global_asset_url | script_tag }}
{{ 'option_selection.js' | shopify_asset_url | script_tag }}
{{ 'layout.css' | asset_url | stylesheet_tag }}
{{ 'shop.js' | asset_url | script_tag }}
{{ content_for_header }}
</head>
<body id="page-{{template}}">
<p class="hide"><a href="#rightsiders">Skip to navigation.</a></p>
<!-- mini cart -->
{% if cart.item_count > 0 %}
<div id="minicart" style="display:none;"><div id="minicart-inner">
<div id="minicart-items">
<h2>There {{ cart.item_count | pluralize: 'is', 'are' }} {{ cart.item_count }} {{ cart.item_count | pluralize: 'item', 'items' }} in <a href="/cart" title="View your cart">your cart</a>!</h2><h4 style="font-size: 16px; margin: 0 0 10px 0; padding: 0;">Your subtotal is {{ cart.total_price | money }}.</h4>
{% for item in cart.items %}
<div class="thumb">
<div class="prodimage"><a href="{{item.product.url}}" onMouseover="tooltip('{{ item.quantity }} x {{ item.title }} ({{ item.variant.title }})', 200)"; onMouseout="hidetooltip()"><img src="{{ item.product.featured_image | product_img_url: 'thumb' }}" /></a></div>
</div>
{% endfor %}
</div>
<br style="clear:both;" />
</div></div>
{% endif %}
<div id="container">
<div id="header">
<!-- Begin Header -->
<h1 id="logo"><a href="/" title="Go Home">{{shop.name}}</a></h1>
<div id="cartlinks">
{% if cart.item_count > 0 %}
<h2 id="cartcount"><a href="/cart" onMouseover="tooltip('There {{ cart.item_count | pluralize: 'is', 'are' }} {{ cart.item_count }} {{ cart.item_count | pluralize: 'item', 'items' }} in your cart!', 200)"; onMouseout="hidetooltip()">{{ cart.item_count }} {{ cart.item_count | pluralize: 'thing', 'things' }}!</a></h2>
<a href="/cart" id="minicartswitch" onclick="superSwitch(this, 'minicart', 'Close Mini Cart'); return false;" id="cartswitch">View Mini Cart ({{ cart.total_price | money }})</a>
{% endif %}
</div>
<!-- End Header -->
</div>
<hr />
<div id="main">
<div id="content">
<div id="innercontent">
{{ content_for_layout }}
</div>
</div>
<hr />
<div id="rightsiders">
<ul class="rightlinks">
{% for link in linklists.main-menu.links %}
<li>{{ link.title | link_to: link.url }}</li>
{% endfor %}
</ul>
{% if tags %}
<ul class="rightlinks">
{% for tag in collection.tags %}
<li><span class="add-link">{{ '+' | link_to_add_tag: tag }}</span>{{ tag | highlight_active_tag | link_to_tag: tag }}</li>
{% endfor %}
</ul>
{% endif %}
<ul class="rightlinks">
{% for link in linklists.footer.links %}
<li>{{ link.title | link_to: link.url }}</li>
{% endfor %}
</ul>
</div>
<hr /><br style="clear:both;" />
<div id="footer">
<div class="footerinner">
All prices are in {{ shop.currency }}.
Powered by <a href="http://www.shopify.com" title="Shopify, Hosted E-Commerce">Shopify</a>.
</div>
</div>
</div>
</div>
<div id="tooltip"></div>
<img id="pointer" src="{{ 'arrow2.gif' | asset_url }}" />
</body>
</html>