mirror of
https://github.com/Shopify/liquid.git
synced 2026-10-03 09:05:13 -07:00
Merge branch 'master' of [email protected]:tobi/liquid
Conflicts: lib/liquid.rb lib/liquid/context.rb lib/liquid/variable.rb test/standard_tag_test.rb
This commit is contained in:
@@ -1,3 +1,7 @@
|
|||||||
|
* Ruby 1.9.1 bugfixes
|
||||||
|
|
||||||
|
* Fix LiquidView for Rails 2.2. Fix local assigns for all versions of Rails
|
||||||
|
|
||||||
* Fixed gem install rake task
|
* Fixed gem install rake task
|
||||||
* Improve Error encapsulation in liquid by maintaining a own set of exceptions instead of relying on ruby build ins
|
* Improve Error encapsulation in liquid by maintaining a own set of exceptions instead of relying on ruby build ins
|
||||||
|
|
||||||
|
|||||||
@@ -22,3 +22,10 @@ Hoe.new(PKG_NAME, PKG_VERSION) do |p|
|
|||||||
p.email = "[email protected]"
|
p.email = "[email protected]"
|
||||||
p.url = "http://www.liquidmarkup.org"
|
p.url = "http://www.liquidmarkup.org"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
desc "Run the liquid profile/perforamce coverage"
|
||||||
|
task :profile do
|
||||||
|
|
||||||
|
ruby "performance/shopify.rb"
|
||||||
|
|
||||||
|
end
|
||||||
+25
-14
@@ -5,32 +5,43 @@
|
|||||||
#
|
#
|
||||||
# ActionView::Base::register_template_handler :liquid, LiquidView
|
# ActionView::Base::register_template_handler :liquid, LiquidView
|
||||||
class LiquidView
|
class LiquidView
|
||||||
|
PROTECTED_ASSIGNS = %w( template_root response _session template_class action_name request_origin session template
|
||||||
|
_response url _request _cookies variables_added _flash params _headers request cookies
|
||||||
|
ignore_missing_templates flash _params logger before_filter_chain_aborted headers )
|
||||||
|
PROTECTED_INSTANCE_VARIABLES = %w( @_request @controller @_first_render @_memoized__pick_template @view_paths
|
||||||
|
@helpers @assigns_added @template @_render_stack @template_format @assigns )
|
||||||
|
|
||||||
def initialize(action_view)
|
def self.call(template)
|
||||||
@action_view = action_view
|
"LiquidView.new(self).render(template, local_assigns)"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def initialize(view)
|
||||||
|
@view = view
|
||||||
|
end
|
||||||
|
|
||||||
def render(template, local_assigns_for_rails_less_than_2_1_0 = nil)
|
def render(template, local_assigns = nil)
|
||||||
@action_view.controller.headers["Content-Type"] ||= 'text/html; charset=utf-8'
|
@view.controller.headers["Content-Type"] ||= 'text/html; charset=utf-8'
|
||||||
assigns = @action_view.assigns.dup
|
|
||||||
|
|
||||||
# template is a Template object in Rails >=2.1.0, a source string previously.
|
# Rails 2.2 Template has source, but not locals
|
||||||
if template.respond_to? :source
|
if template.respond_to?(:source) && !template.respond_to?(:locals)
|
||||||
source = template.source
|
assigns = (@view.instance_variables - PROTECTED_INSTANCE_VARIABLES).inject({}) do |hash, ivar|
|
||||||
local_assigns = template.locals
|
hash[ivar[1..-1]] = @view.instance_variable_get(ivar)
|
||||||
|
hash
|
||||||
|
end
|
||||||
else
|
else
|
||||||
source = template
|
assigns = @view.assigns.reject{ |k,v| PROTECTED_ASSIGNS.include?(k) }
|
||||||
local_assigns = local_assigns_for_rails_less_than_2_1_0
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if content_for_layout = @action_view.instance_variable_get("@content_for_layout")
|
source = template.respond_to?(:source) ? template.source : template
|
||||||
|
local_assigns = (template.respond_to?(:locals) ? template.locals : local_assigns) || {}
|
||||||
|
|
||||||
|
if content_for_layout = @view.instance_variable_get("@content_for_layout")
|
||||||
assigns['content_for_layout'] = content_for_layout
|
assigns['content_for_layout'] = content_for_layout
|
||||||
end
|
end
|
||||||
assigns.merge!(local_assigns)
|
assigns.merge!(local_assigns.stringify_keys)
|
||||||
|
|
||||||
liquid = Liquid::Template.parse(source)
|
liquid = Liquid::Template.parse(source)
|
||||||
liquid.render(assigns, :filters => [@action_view.controller.master_helper_module], :registers => {:action_view => @action_view, :controller => @action_view.controller})
|
liquid.render(assigns, :filters => [@view.controller.master_helper_module], :registers => {:action_view => @view, :controller => @view.controller})
|
||||||
end
|
end
|
||||||
|
|
||||||
def compilable?
|
def compilable?
|
||||||
|
|||||||
+14
-26
@@ -22,41 +22,29 @@
|
|||||||
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
||||||
|
|
||||||
module Liquid
|
module Liquid
|
||||||
|
FilterSeparator = /\|/
|
||||||
# Basic apperence:
|
ArgumentSeparator = ','
|
||||||
|
FilterArgumentSeparator = ':'
|
||||||
# Tags {% look like this %}
|
VariableAttributeSeparator = '.'
|
||||||
TagStart = /\{%/
|
TagStart = /\{\%/
|
||||||
TagEnd = /%\}/
|
TagEnd = /\%\}/
|
||||||
|
VariableSignature = /\(?[\w\-\.\[\]]\)?/
|
||||||
# Variables {{look}} like {{this}}
|
VariableSegment = /[\w\-]/
|
||||||
VariableStart = /\{\{/
|
VariableStart = /\{\{/
|
||||||
VariableEnd = /\}\}/
|
VariableEnd = /\}\}/
|
||||||
|
|
||||||
# Arguments are passed {% like: this %}
|
|
||||||
FilterArgumentSeparator = ':'
|
|
||||||
|
|
||||||
# Hashes are separated {{ like.this }}
|
|
||||||
VariableAttributeSeparator = '.'
|
|
||||||
|
|
||||||
# Filters are piped in {{ like | this }}
|
|
||||||
FilterSeparator = /\|/
|
|
||||||
|
|
||||||
# Muliple arguments are {% separated: like, this %}
|
|
||||||
ArgumentSeparator = ','
|
|
||||||
|
|
||||||
|
|
||||||
# Lexical parsing regexped go below.
|
|
||||||
VariableSignature = /\(?[\w\-\.\[\]]\)?/
|
|
||||||
VariableSegment = /[\w\-]\??/
|
|
||||||
VariableIncompleteEnd = /\}\}?/
|
VariableIncompleteEnd = /\}\}?/
|
||||||
QuotedString = /"[^"]+"|'[^']+'/
|
QuotedString = /"[^"]+"|'[^']+'/
|
||||||
QuotedFragment = /#{QuotedString}|(?:[^\s,\|'"]|#{QuotedString})+/
|
QuotedFragment = /#{QuotedString}|(?:[^\s,\|'"]|#{QuotedString})+/
|
||||||
|
StrictQuotedFragment = /"[^"]+"|'[^']+'|[^\s,\|,\:,\,]+/
|
||||||
|
FirstFilterArgument = /#{FilterArgumentSeparator}(?:#{StrictQuotedFragment})/
|
||||||
|
OtherFilterArgument = /#{ArgumentSeparator}(?:#{StrictQuotedFragment})/
|
||||||
|
SpacelessFilter = /#{FilterSeparator}(?:#{StrictQuotedFragment})(?:#{FirstFilterArgument}(?:#{OtherFilterArgument})*)?/
|
||||||
|
Expression = /(?:#{QuotedFragment}(?:#{SpacelessFilter})*)/
|
||||||
TagAttributes = /(\w+)\s*\:\s*(#{QuotedFragment})/
|
TagAttributes = /(\w+)\s*\:\s*(#{QuotedFragment})/
|
||||||
AnyStartingTag = /\{\{|\{\%/
|
AnyStartingTag = /\{\{|\{\%/
|
||||||
PartialTemplateParser = /#{TagStart}.*?#{TagEnd}|#{VariableStart}.*?#{VariableIncompleteEnd}/
|
PartialTemplateParser = /#{TagStart}.*?#{TagEnd}|#{VariableStart}.*?#{VariableIncompleteEnd}/
|
||||||
TemplateParser = /(#{PartialTemplateParser}|#{AnyStartingTag})/
|
TemplateParser = /(#{PartialTemplateParser}|#{AnyStartingTag})/
|
||||||
VariableParser = /\[[^\]]+\]|#{VariableSegment}+/
|
VariableParser = /\[[^\]]+\]|#{VariableSegment}+\??/
|
||||||
end
|
end
|
||||||
|
|
||||||
require 'liquid/drop'
|
require 'liquid/drop'
|
||||||
|
|||||||
@@ -87,7 +87,6 @@ module Liquid
|
|||||||
end
|
end
|
||||||
|
|
||||||
def interpret_condition(left, right, op, context)
|
def interpret_condition(left, right, op, context)
|
||||||
|
|
||||||
# If the operator is empty this means that the decision statement is just
|
# If the operator is empty this means that the decision statement is just
|
||||||
# a single variable. We can just poll this variable from the context and
|
# a single variable. We can just poll this variable from the context and
|
||||||
# return this as the result.
|
# return this as the result.
|
||||||
@@ -95,7 +94,6 @@ module Liquid
|
|||||||
|
|
||||||
left, right = context[left], context[right]
|
left, right = context[left], context[right]
|
||||||
|
|
||||||
|
|
||||||
operation = self.class.operators[op] || raise(ArgumentError.new("Unknown operator #{op}"))
|
operation = self.class.operators[op] || raise(ArgumentError.new("Unknown operator #{op}"))
|
||||||
|
|
||||||
if operation.respond_to?(:call)
|
if operation.respond_to?(:call)
|
||||||
@@ -110,7 +108,6 @@ module Liquid
|
|||||||
|
|
||||||
|
|
||||||
class ElseCondition < Condition
|
class ElseCondition < Condition
|
||||||
|
|
||||||
def else?
|
def else?
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ module Liquid
|
|||||||
if strainer.respond_to?(method)
|
if strainer.respond_to?(method)
|
||||||
strainer.__send__(method, *args)
|
strainer.__send__(method, *args)
|
||||||
else
|
else
|
||||||
args.first
|
raise FilterNotFound, "Filter '#{method}' not found"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -156,17 +156,13 @@ module Liquid
|
|||||||
# fetches an object starting at the local scope and then moving up
|
# fetches an object starting at the local scope and then moving up
|
||||||
# the hierachy
|
# the hierachy
|
||||||
def find_variable(key)
|
def find_variable(key)
|
||||||
@scopes.each do |scope|
|
scope = @scopes[0..-2].find { |s| s.has_key?(key) } || @scopes.last
|
||||||
if scope.has_key?(key)
|
|
||||||
variable = scope[key]
|
variable = scope[key]
|
||||||
variable = scope[key] = variable.call(self) if variable.is_a?(Proc)
|
variable = scope[key] = variable.call(self) if variable.is_a?(Proc)
|
||||||
variable = variable.to_liquid
|
variable = variable.to_liquid
|
||||||
variable.context = self if variable.respond_to?(:context=)
|
variable.context = self if variable.respond_to?(:context=)
|
||||||
return variable
|
return variable
|
||||||
end
|
end
|
||||||
end
|
|
||||||
nil
|
|
||||||
end
|
|
||||||
|
|
||||||
# resolves namespaced queries gracefully.
|
# resolves namespaced queries gracefully.
|
||||||
#
|
#
|
||||||
|
|||||||
+3
-2
@@ -29,7 +29,9 @@ module Liquid
|
|||||||
|
|
||||||
# called by liquid to invoke a drop
|
# called by liquid to invoke a drop
|
||||||
def invoke_drop(method)
|
def invoke_drop(method)
|
||||||
if self.class.public_instance_methods.include?(method.to_s)
|
# for backward compatibility with Ruby 1.8
|
||||||
|
methods = self.class.public_instance_methods.map { |m| m.to_s }
|
||||||
|
if methods.include?(method.to_s)
|
||||||
send(method.to_sym)
|
send(method.to_sym)
|
||||||
else
|
else
|
||||||
before_method(method)
|
before_method(method)
|
||||||
@@ -46,5 +48,4 @@ module Liquid
|
|||||||
|
|
||||||
alias :[] :invoke_drop
|
alias :[] :invoke_drop
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ require 'set'
|
|||||||
|
|
||||||
module Liquid
|
module Liquid
|
||||||
|
|
||||||
|
|
||||||
parent_object = if defined? BlankObject
|
parent_object = if defined? BlankObject
|
||||||
BlankObject
|
BlankObject
|
||||||
else
|
else
|
||||||
@@ -15,7 +14,7 @@ module Liquid
|
|||||||
# One of the strainer's responsibilities is to keep malicious method calls out
|
# One of the strainer's responsibilities is to keep malicious method calls out
|
||||||
class Strainer < parent_object #:nodoc:
|
class Strainer < parent_object #:nodoc:
|
||||||
INTERNAL_METHOD = /^__/
|
INTERNAL_METHOD = /^__/
|
||||||
@@required_methods = Set.new([:__send__, :__id__, :respond_to?, :extend, :methods, :class])
|
@@required_methods = Set.new([:__id__, :__send__, :respond_to?, :extend, :methods, :class, :object_id])
|
||||||
|
|
||||||
@@filters = {}
|
@@filters = {}
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ module Liquid
|
|||||||
|
|
||||||
def render(context)
|
def render(context)
|
||||||
output = super
|
output = super
|
||||||
context[@to] = output.to_s
|
context[@to] = output.join
|
||||||
''
|
''
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -89,10 +89,11 @@ module Liquid
|
|||||||
when Liquid::Context
|
when Liquid::Context
|
||||||
args.shift
|
args.shift
|
||||||
when Hash
|
when Hash
|
||||||
self.assigns.merge!(args.shift)
|
a = args.shift
|
||||||
Context.new(assigns, registers, @rethrow_errors)
|
assigns.each { |k,v| a[k] = v unless a.has_key?(k) }
|
||||||
|
Context.new(a, registers, @rethrow_errors)
|
||||||
when nil
|
when nil
|
||||||
Context.new(assigns, registers, @rethrow_errors)
|
Context.new(assigns.dup, registers, @rethrow_errors)
|
||||||
else
|
else
|
||||||
raise ArgumentError, "Expect Hash or Liquid::Context as parameter"
|
raise ArgumentError, "Expect Hash or Liquid::Context as parameter"
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ module Liquid
|
|||||||
@name = match[1]
|
@name = match[1]
|
||||||
if markup.match(/#{FilterSeparator}\s*(.*)/)
|
if markup.match(/#{FilterSeparator}\s*(.*)/)
|
||||||
filters = Regexp.last_match(1).split(/#{FilterSeparator}/)
|
filters = Regexp.last_match(1).split(/#{FilterSeparator}/)
|
||||||
|
|
||||||
filters.each do |f|
|
filters.each do |f|
|
||||||
if matches = f.match(/\s*(\w+)/)
|
if matches = f.match(/\s*(\w+)/)
|
||||||
filtername = matches[1]
|
filtername = matches[1]
|
||||||
@@ -35,8 +34,7 @@ module Liquid
|
|||||||
|
|
||||||
def render(context)
|
def render(context)
|
||||||
return '' if @name.nil?
|
return '' if @name.nil?
|
||||||
output = context[@name]
|
@filters.inject(context[@name]) do |output, filter|
|
||||||
@filters.inject(output) do |output, filter|
|
|
||||||
filterargs = filter[1].to_a.collect do |a|
|
filterargs = filter[1].to_a.collect do |a|
|
||||||
context[a]
|
context[a]
|
||||||
end
|
end
|
||||||
@@ -46,7 +44,6 @@ module Liquid
|
|||||||
raise FilterNotFound, "Error - filter '#{filter[0]}' in '#{@markup.strip}' could not be found."
|
raise FilterNotFound, "Error - filter '#{filter[0]}' in '#{@markup.strip}' could not be found."
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
output
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
+14
-4
@@ -1,10 +1,10 @@
|
|||||||
Gem::Specification.new do |s|
|
Gem::Specification.new do |s|
|
||||||
s.name = %q{liquid}
|
s.name = %q{liquid}
|
||||||
s.version = "1.9.0"
|
s.version = "2.0.1"
|
||||||
s.specification_version = 2 if s.respond_to? :specification_version=
|
|
||||||
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
||||||
s.authors = ["Tobias Luetke"]
|
s.authors = ["Tobias Luetke"]
|
||||||
s.date = %q{2008-06-23}
|
s.date = %q{2009-04-13}
|
||||||
s.description = %q{A secure non evaling end user template engine with aesthetic markup.}
|
s.description = %q{A secure non evaling end user template engine with aesthetic markup.}
|
||||||
s.email = %q{[email protected]}
|
s.email = %q{[email protected]}
|
||||||
s.extra_rdoc_files = ["History.txt", "Manifest.txt", "README.txt"]
|
s.extra_rdoc_files = ["History.txt", "Manifest.txt", "README.txt"]
|
||||||
@@ -14,6 +14,16 @@ Gem::Specification.new do |s|
|
|||||||
s.rdoc_options = ["--main", "README.txt"]
|
s.rdoc_options = ["--main", "README.txt"]
|
||||||
s.require_paths = ["lib"]
|
s.require_paths = ["lib"]
|
||||||
s.rubyforge_project = %q{liquid}
|
s.rubyforge_project = %q{liquid}
|
||||||
s.rubygems_version = %q{1.2.0}
|
s.rubygems_version = %q{1.3.1}
|
||||||
s.summary = %q{A secure non evaling end user template engine with aesthetic markup.}
|
s.summary = %q{A secure non evaling end user template engine with aesthetic markup.}
|
||||||
|
|
||||||
|
if s.respond_to? :specification_version then
|
||||||
|
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
||||||
|
s.specification_version = 2
|
||||||
|
|
||||||
|
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
||||||
|
else
|
||||||
|
end
|
||||||
|
else
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -0,0 +1,92 @@
|
|||||||
|
# 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 File.dirname(__FILE__) + '/shopify/liquid'
|
||||||
|
require File.dirname(__FILE__) + '/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[File.dirname(__FILE__) + '/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
|
||||||
|
|
||||||
|
puts 'Running profiler...'
|
||||||
|
|
||||||
|
results = profiler.profile
|
||||||
|
|
||||||
|
puts 'Success'
|
||||||
|
puts
|
||||||
|
|
||||||
|
[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")
|
||||||
|
filename.gsub!(/:+/, '_')
|
||||||
|
File.open(filename, "w+") { |fp| klass.new(results).print(fp) }
|
||||||
|
$stderr.puts "wrote #{klass.name} output to #{filename}"
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
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
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
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
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
module JsonFilter
|
||||||
|
|
||||||
|
def json(object)
|
||||||
|
object.reject {|k,v| k == "collections" }.to_json
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
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
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
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
|
||||||
@@ -0,0 +1,93 @@
|
|||||||
|
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('« Previous', current_page-1 ) unless 1 >= current_page
|
||||||
|
pagination['next'] = link('Next »', 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_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
|
||||||
@@ -0,0 +1,98 @@
|
|||||||
|
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
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
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
|
||||||
@@ -0,0 +1,945 @@
|
|||||||
|
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
|
||||||
|
# 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 & 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:[email protected]">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: [email protected]
|
||||||
|
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: [email protected]
|
||||||
|
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
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
module WeightFilter
|
||||||
|
|
||||||
|
def weight(grams)
|
||||||
|
sprintf("%.2f", grams / 1000)
|
||||||
|
end
|
||||||
|
|
||||||
|
def weight_with_unit(grams)
|
||||||
|
"#{weight(grams)} kg"
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
<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 -->
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
<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>
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
<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>
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
{% 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 %}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
<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 > Blogs & 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>
|
||||||
|
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
<div id="page">
|
||||||
|
<h2>{{page.title}}</h2>
|
||||||
|
|
||||||
|
<div class="article textile">
|
||||||
|
{{page.content}}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
<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>
|
||||||
@@ -0,0 +1,105 @@
|
|||||||
|
<!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>
|
||||||
|
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
<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">
|
||||||
|
{{ comment.content }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="comment-details">
|
||||||
|
Posted by {{ comment.author }} on {{ comment.created_at | date: "%B %d, %Y" }}
|
||||||
|
</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 -->
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
<div id="blog-page">
|
||||||
|
<h2 class="heading-shaded">{{page.title}}</h2>
|
||||||
|
{% for article in blog.articles %}
|
||||||
|
<h4>
|
||||||
|
{{ article.created_at | date: '%d %b' }}
|
||||||
|
<a href="{{article.url}}">{{ article.title }}</a>
|
||||||
|
</h4>
|
||||||
|
{{ article.content }}
|
||||||
|
{% if blog.comments_enabled? %}
|
||||||
|
<p><a href="{{article.url}}#comments">{{ article.comments_count }} comments</a></p>
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
<script type="text/javascript">
|
||||||
|
function remove_item(id) {
|
||||||
|
document.getElementById('updates_'+id).value = 0;
|
||||||
|
document.getElementById('cart').submit();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div id="cart-page">
|
||||||
|
|
||||||
|
{% if cart.item_count == 0 %}
|
||||||
|
<p>Your shopping cart is empty...</p>
|
||||||
|
<p><a href="/"><img src="{{ 'continue_shopping_icon.gif' | asset_url }}" alt="Continue shopping"/></a><p>
|
||||||
|
{% else %}
|
||||||
|
|
||||||
|
<form action="/cart" method="post" id="cart">
|
||||||
|
|
||||||
|
<table class="cart">
|
||||||
|
<tr>
|
||||||
|
<th colspan="2">Product</th>
|
||||||
|
<th class="short">Qty</th>
|
||||||
|
<th>Price</th>
|
||||||
|
<th>Total</th>
|
||||||
|
<th class="short">Remove</th>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
{% for item in cart.items %}
|
||||||
|
<tr class="{% cycle 'odd', 'even' %}">
|
||||||
|
<td class="short">{{ item.product.featured_image | product_img_url: 'thumb' | img_tag }}</td>
|
||||||
|
<td><a href="{{item.product.url}}">{{ item.title }}</a></td>
|
||||||
|
<td class="short"><input type="text" class="quantity" name="updates[{{item.variant.id}}]" id="updates_{{item.variant.id}}" value="{{item.quantity}}" onfocus="this.select();"/></td>
|
||||||
|
<td class="cart-price">{{ item.price | money }}</td>
|
||||||
|
<td class="cart-price">{{item.line_price | money }}</td>
|
||||||
|
<td class="short"><a href="#" onclick="remove_item({{item.variant.id}}); return false;" class="remove"><img src="{{ 'cancel_icon.gif' | asset_url }}" alt="Remove" /></a></td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</table>
|
||||||
|
<p class="updatebtn"><input type="image" value="Update Cart" name="update" src="{{ 'update_icon.gif' | asset_url }}" alt="Update" /></p>
|
||||||
|
<p class="subtotal">
|
||||||
|
<strong>Subtotal:</strong> {{cart.total_price | money_with_currency }}
|
||||||
|
</p>
|
||||||
|
<p class="checkout"><input type="image" src="{{ 'checkout_icon.gif' | asset_url }}" alt="Proceed to Checkout" value="Proceed to Checkout" name="checkout" /></p>
|
||||||
|
|
||||||
|
{% if additional_checkout_buttons %}
|
||||||
|
<div class="additional-checkout-buttons">
|
||||||
|
<p>- or -</p>
|
||||||
|
{{ content_for_additional_checkout_buttons }}
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
</form>
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
<div id="collection-page">
|
||||||
|
|
||||||
|
{% if collection.description %}
|
||||||
|
<div id="collection-description" class="textile">{{ collection.description }}</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% paginate collection.products by 20 %}
|
||||||
|
|
||||||
|
<ul id="product-collection">
|
||||||
|
{% for product in collection.products %}
|
||||||
|
<li class="single-product clearfix">
|
||||||
|
<div class="small">
|
||||||
|
<div class="prod-image"><a href="{{product.url}}"><img src="{{ product.featured_image | product_img_url: 'small' }}" alt="{{ product.title | escape }}" /></a></div>
|
||||||
|
</div>
|
||||||
|
<div class="prod-list-description">
|
||||||
|
<h3><a href="{{product.url}}">{{product.title}}</a></h3>
|
||||||
|
<p>{{ product.description | strip_html | truncatewords: 35 }}</p>
|
||||||
|
<p class="prd-price">{{ 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 %}
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
<div id="home-page">
|
||||||
|
<h3 class="heading-shaded">Featured products...</h3>
|
||||||
|
<div class="featured-prod-row clearfix">
|
||||||
|
{% for product in collections.frontpage.products %}
|
||||||
|
<div class="featured-prod-item">
|
||||||
|
<p>
|
||||||
|
<a href="{{product.url}}"><img src="{{ product.featured_image | product_img_url: 'small' }}" alt="{{ product.title | escape }}"/></a>
|
||||||
|
</p>
|
||||||
|
<h4><a href="{{product.url}}">{{product.title}}</a></h4>
|
||||||
|
{% if product.compare_at_price %}
|
||||||
|
{% if product.price_min != product.compare_at_price %}
|
||||||
|
<p class="prd-price">Was:<del>{{product.compare_at_price | money}}</del></p>
|
||||||
|
<p class="prd-price"><ins>Now: {{product.price_min | money}}</ins></p>
|
||||||
|
{% endif %}
|
||||||
|
{% else %}
|
||||||
|
<p class="prd-price"><ins>{{product.price_min | money}}</ins></p>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="articles">
|
||||||
|
{% assign article = pages.frontpage %}
|
||||||
|
{% if article.content != "" %}
|
||||||
|
<h3>{{ article.title }}</h3>
|
||||||
|
{{ article.content }}
|
||||||
|
{% else %}
|
||||||
|
In <em>Admin > Blogs & 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" }}
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
<div id="single-page">
|
||||||
|
<h2 class="heading-shaded">{{page.title}}</h2>
|
||||||
|
{{ page.content }}
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,75 @@
|
|||||||
|
<div id="product-page">
|
||||||
|
<h2 class="heading-shaded">{{ product.title }}</h2>
|
||||||
|
<div id="product-details">
|
||||||
|
<div id="product-images">
|
||||||
|
{% for image in product.images %}
|
||||||
|
{% if forloop.first %}
|
||||||
|
<a href="{{ image | product_img_url: 'large' }}" class="product-image" rel="lightbox[ product]" title="">
|
||||||
|
<img src="{{ image | product_img_url: 'medium'}}" alt="{{product.title | escape }}" />
|
||||||
|
</a>
|
||||||
|
{% else %}
|
||||||
|
<a href="{{ image | product_img_url: 'large' }}" class="product-image-small" rel="lightbox[ product]" title="">
|
||||||
|
<img src="{{ image | product_img_url: 'small'}}" alt="{{product.title | escape }}" />
|
||||||
|
</a>
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<ul id="product-info">
|
||||||
|
<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="product-options">
|
||||||
|
{% if product.available %}
|
||||||
|
|
||||||
|
<form action="/cart/add" method="post">
|
||||||
|
|
||||||
|
<select id="product-select" name='id'>
|
||||||
|
{% for variant in product.variants %}
|
||||||
|
<option value="{{ variant.id }}">{{ variant.title }} - {{ variant.price | money }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<div id="price-field"></div>
|
||||||
|
|
||||||
|
<div class="add-to-cart"><input type="image" name="add" value="Add to Cart" id="add" src="{{ 'add-to-cart.gif' | asset_url }}" /></div>
|
||||||
|
</form>
|
||||||
|
{% else %}
|
||||||
|
<span>Sold Out!</span>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="product-description">
|
||||||
|
{{ product.description }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
<!--
|
||||||
|
// mootools callback for multi variants dropdown selector
|
||||||
|
var selectCallback = function(variant, selector) {
|
||||||
|
if (variant && variant.available == true) {
|
||||||
|
// selected a valid variant
|
||||||
|
$('add').removeClass('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').addClass('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
|
||||||
|
window.addEvent('domready', function() {
|
||||||
|
new Shopify.OptionSelectors("product-select", { product: {{ product | json }}, onVariantSelected: selectCallback });
|
||||||
|
});
|
||||||
|
-->
|
||||||
|
</script>
|
||||||
|
|
||||||
@@ -0,0 +1,85 @@
|
|||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
|
||||||
|
<head>
|
||||||
|
<title>{{shop.name}} - {{page_title}}</title>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
|
|
||||||
|
{{ 'main.css' | asset_url | stylesheet_tag }}
|
||||||
|
{{ 'shop.js' | asset_url | script_tag }}
|
||||||
|
|
||||||
|
{{ 'mootools.js' | asset_url | script_tag }}
|
||||||
|
{{ 'slimbox.js' | asset_url | script_tag }}
|
||||||
|
{{ 'option_selection.js' | shopify_asset_url | script_tag }}
|
||||||
|
{{ 'slimbox.css' | asset_url | stylesheet_tag }}
|
||||||
|
|
||||||
|
{{ content_for_header }}
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body id="page-{{template}}">
|
||||||
|
<p class="hide"><a href="#navigation">Skip to navigation.</a></p>
|
||||||
|
<div id="wrapper">
|
||||||
|
<div class="content clearfix">
|
||||||
|
<div id="header">
|
||||||
|
<h2><a href="/">{{shop.name}}</a></h2>
|
||||||
|
</div>
|
||||||
|
<div id="left-col">
|
||||||
|
{{ content_for_layout }}
|
||||||
|
</div>
|
||||||
|
<div id="right-col">
|
||||||
|
{% if template != 'cart' %}
|
||||||
|
<div id="cart-right-col">
|
||||||
|
<dl id="cart-right-col-info">
|
||||||
|
<dt>Shopping Cart</dt>
|
||||||
|
<dd>
|
||||||
|
{% if cart.item_count != 0 %}
|
||||||
|
<a href="/cart">{{ cart.item_count }} {{ cart.item_count | pluralize: 'item', 'items' }}</a> in your cart
|
||||||
|
{% else %}
|
||||||
|
Your cart is empty
|
||||||
|
{% endif %}
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
<div id="search">
|
||||||
|
<dl id="searchbox">
|
||||||
|
<dt>Search</dt>
|
||||||
|
<dd>
|
||||||
|
<form action="/search" method="get">
|
||||||
|
<fieldset>
|
||||||
|
<input class="search-input" type="text" onclick="this.select()" value="Search this shop..." name="q" />
|
||||||
|
</fieldset>
|
||||||
|
</form>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
|
<div id="navigation">
|
||||||
|
<dl class="navbar">
|
||||||
|
<dt>Navigation</dt>
|
||||||
|
{% for link in linklists.main-menu.links %}
|
||||||
|
<dd>{{ link.title | link_to: link.url }}</dd>
|
||||||
|
{% endfor %}
|
||||||
|
</dl>
|
||||||
|
|
||||||
|
{% if tags %}
|
||||||
|
<dl class="navbar">
|
||||||
|
<dt>Tags</dt>
|
||||||
|
{% for tag in collection.tags %}
|
||||||
|
<dd>{{ tag | highlight_active_tag | link_to_tag: tag }}</dd>
|
||||||
|
{% endfor %}
|
||||||
|
</dl>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div id="content-padding"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="footer">
|
||||||
|
{% for link in linklists.footer.links %}
|
||||||
|
{{ link.title | link_to: link.url }} {% if forloop.rindex != 1 %} | {% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
<div id="page" class="innerpage clearfix">
|
||||||
|
|
||||||
|
<div id="text-page">
|
||||||
|
<div class="entry">
|
||||||
|
<h1>Oh no!</h1>
|
||||||
|
<div class="entry-post">
|
||||||
|
Seems like you are looking for something that just isn't here. <a href="/">Try heading back to our main page</a>. Or you can checkout some of our featured products below.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<h1>Featured Products</h1>
|
||||||
|
<ul class="item-list clearfix">
|
||||||
|
|
||||||
|
{% for product in collections.frontpage.products %}
|
||||||
|
<li>
|
||||||
|
<form action="/cart/add" method="post">
|
||||||
|
<div class="item-list-item">
|
||||||
|
<div class="ili-top clearfix">
|
||||||
|
<div class="ili-top-content">
|
||||||
|
<h2><a href="{{product.url}}">{{product.title}}</a></h2>
|
||||||
|
<p>{{ product.description | truncatewords: 15 }}</p>
|
||||||
|
</div>
|
||||||
|
<a href="{{product.url}}" class="ili-top-image"><img src="{{ product.featured_image | product_img_url: 'small' }}" alt="{{ product.title | escape }}"/></a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="ili-bottom clearfix">
|
||||||
|
<p class="hiddenvariants" style="display: none">{% for variant in product.variants %}<span><input type="radio" name="id" value="{{variant.id}}" id="radio_{{variant.id}}" style="vertical-align: middle;" {%if forloop.first%} checked="checked" {%endif%} /><label for="radio_{{variant.id}}">{{ variant.price | money_with_currency }} - {{ variant.title }}</label></span>{% endfor %}</p>
|
||||||
|
<input type="submit" class="" value="Add to Basket" />
|
||||||
|
<p>
|
||||||
|
<a href="{{product.url}}">View Details</a>
|
||||||
|
|
||||||
|
<span>
|
||||||
|
{% if product.compare_at_price %}
|
||||||
|
{% if product.price_min != product.compare_at_price %}
|
||||||
|
{{product.compare_at_price | money}} -
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
<strong>
|
||||||
|
{{product.price_min | money}}
|
||||||
|
</strong>
|
||||||
|
</span>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</li>
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<!-- end page -->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,98 @@
|
|||||||
|
|
||||||
|
<div id="page" class="innerpage clearfix">
|
||||||
|
<div id="text-page">
|
||||||
|
|
||||||
|
<div class="entry">
|
||||||
|
<h1><span>{{article.title}}</span></h1>
|
||||||
|
<div class="entry-post">
|
||||||
|
<div class="meta">{{ article.created_at | date: "%b %d" }}</div>
|
||||||
|
{{ article.content }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Comments -->
|
||||||
|
{% if blog.comments_enabled? %}
|
||||||
|
<div id="comments">
|
||||||
|
<h2>Comments</h2>
|
||||||
|
|
||||||
|
<!-- List all comments -->
|
||||||
|
<ul id="comment-list">
|
||||||
|
{% for comment in article.comments %}
|
||||||
|
<li>
|
||||||
|
<div class="comment">
|
||||||
|
{{ comment.content }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="comment-details">
|
||||||
|
Posted by <span class="comment-author">{{ comment.author }}</span> on <span class="comment-date">{{ comment.created_at | date: "%B %d, %Y" }}</span>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<!-- Comment Form -->
|
||||||
|
<div id="comment-form">
|
||||||
|
{% form article %}
|
||||||
|
<h2>Leave a comment</h2>
|
||||||
|
|
||||||
|
<!-- 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 -->
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="three-reasons" class="clearfix">
|
||||||
|
<h3>Why Shop With Us?</h3>
|
||||||
|
<ul>
|
||||||
|
<li class="two-a">
|
||||||
|
<h4>24 Hours</h4>
|
||||||
|
<p>We're always here to help.</p>
|
||||||
|
</li>
|
||||||
|
<li class="two-c">
|
||||||
|
<h4>No Spam</h4>
|
||||||
|
<p>We'll never share your info.</p>
|
||||||
|
</li>
|
||||||
|
<li class="two-d">
|
||||||
|
<h4>Secure Servers</h4>
|
||||||
|
<p>Checkout is 256bit encrypted.</p>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
<div id="page" class="innerpage clearfix">
|
||||||
|
<div id="text-page">
|
||||||
|
<h1>Post from our blog...</h1>
|
||||||
|
{% paginate blog.articles by 20 %}
|
||||||
|
{% for article in blog.articles %}
|
||||||
|
|
||||||
|
<div class="entry">
|
||||||
|
<h1><span><a href="{{ article.url }}">{{ article.title }}</a></span></h1>
|
||||||
|
<div class="entry-post">
|
||||||
|
<div class="meta">{{ article.created_at | date: "%b %d" }}</div>
|
||||||
|
{{ article.content }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
<div class="paginate clearfix">
|
||||||
|
{{ paginate | default_pagination }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% endpaginate %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="three-reasons" class="clearfix">
|
||||||
|
<h3>Why Shop With Us?</h3>
|
||||||
|
<ul>
|
||||||
|
<li class="two-a">
|
||||||
|
<h4>24 Hours</h4>
|
||||||
|
<p>We're always here to help.</p>
|
||||||
|
</li>
|
||||||
|
<li class="two-c">
|
||||||
|
<h4>No Spam</h4>
|
||||||
|
<p>We'll never share your info.</p>
|
||||||
|
</li>
|
||||||
|
<li class="two-d">
|
||||||
|
<h4>Secure Servers</h4>
|
||||||
|
<p>Checkout is 256bit encrypted.</p>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,134 @@
|
|||||||
|
<script type="text/javascript">
|
||||||
|
function remove_item(id) {
|
||||||
|
document.getElementById('updates_'+id).value = 0;
|
||||||
|
document.getElementById('cart').submit();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div id="page" class="innerpage clearfix">.
|
||||||
|
{% if cart.item_count == 0 %}
|
||||||
|
<h1>Your cart is currently empty.</h1>
|
||||||
|
{% else %}
|
||||||
|
|
||||||
|
<h1>Your Cart <span>({{ cart.item_count }} {{ cart.item_count | pluralize: 'item', 'items' }}, {{cart.total_price | money_with_currency }} total)</span></h1>
|
||||||
|
|
||||||
|
<form action="/cart" method="post" id="cart-form">
|
||||||
|
|
||||||
|
<div id="cart-wrap">
|
||||||
|
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||||
|
<tr>
|
||||||
|
<th scope="col" class="td-image"><label>Image</label></th>
|
||||||
|
<th scope="col" class="td-title"><label>Product Title</label></th>
|
||||||
|
<th scope="col" class="td-count"><label>Count</label></th>
|
||||||
|
<th scope="col" class="td-price"><label>Cost</label></th>
|
||||||
|
<th scope="col" class="td-delete"><label>Remove</label></th>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
{% for item in cart.items %}
|
||||||
|
<tr class="{% cycle 'reg', 'alt' %}">
|
||||||
|
<td colspan="5">
|
||||||
|
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||||
|
<tr>
|
||||||
|
<td class="td-image"><a href="{{item.product.url}}">{{ item.product.featured_image | product_img_url: 'thumb' | img_tag }}</a></td>
|
||||||
|
<td class="td-title"><p>{{ item.title }}</p></td>
|
||||||
|
<td class="td-count"><label>Count:</label> <input type="text" class="quantity item-count" name="updates[{{item.variant.id}}]" id="updates_{{item.variant.id}}" value="{{item.quantity}}" onfocus="this.select();"/></td>
|
||||||
|
<td class="td-price">{{item.line_price | money }}</td>
|
||||||
|
<td class="td-delete"><a href="#" onclick="remove_item({{item.variant.id}}); return false;">Remove</a></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<div id="finish-up">
|
||||||
|
|
||||||
|
<div class="latest-news-box">
|
||||||
|
{{ pages.shopping-cart.content }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p class="order-total">
|
||||||
|
<span><strong>Order Total:</strong> {{cart.total_price | money_with_currency }}</span>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p class="update-cart"><input type="submit" value="Refresh Cart" name="update" /></p>
|
||||||
|
|
||||||
|
<p class="go-checkout"><input type="submit" value="Proceed to Checkout" name="checkout" /></p>
|
||||||
|
|
||||||
|
{% if additional_checkout_buttons %}
|
||||||
|
<div class="additional-checkout-buttons">
|
||||||
|
<p>- or -</p>
|
||||||
|
{{ content_for_additional_checkout_buttons }}
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<h1 class="other-products"><span>Other Products You Might Enjoy</span></h1>
|
||||||
|
<ul class="item-list clearfix">
|
||||||
|
|
||||||
|
{% for product in collections.frontpage.products limit:2 %}
|
||||||
|
<li>
|
||||||
|
<form action="/cart/add" method="post">
|
||||||
|
<div class="item-list-item">
|
||||||
|
<div class="ili-top clearfix">
|
||||||
|
<div class="ili-top-content">
|
||||||
|
<h2><a href="{{product.url}}">{{product.title}}</a></h2>
|
||||||
|
<p>{{ product.description | truncatewords: 15 }}</p>
|
||||||
|
</div>
|
||||||
|
<a href="{{product.url}}" class="ili-top-image"><img src="{{ product.featured_image | product_img_url: 'small' }}" alt="{{ product.title | escape }}"/></a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="ili-bottom clearfix">
|
||||||
|
<p class="hiddenvariants" style="display: none">{% for variant in product.variants %}<span><input type="radio" name="id" value="{{variant.id}}" id="radio_{{variant.id}}" style="vertical-align: middle;" {%if forloop.first%} checked="checked" {%endif%} /><label for="radio_{{variant.id}}">{{ variant.price | money_with_currency }} - {{ variant.title }}</label></span>{% endfor %}</p>
|
||||||
|
<input type="submit" class="" value="Add to Basket" />
|
||||||
|
<p>
|
||||||
|
<a href="{{product.url}}">View Details</a>
|
||||||
|
|
||||||
|
<span>
|
||||||
|
{% if product.compare_at_price %}
|
||||||
|
{% if product.price_min != product.compare_at_price %}
|
||||||
|
{{product.compare_at_price | money}} -
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
<strong>
|
||||||
|
{{product.price_min | money}}
|
||||||
|
</strong>
|
||||||
|
</span>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</li>
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<div id="three-reasons" class="clearfix">
|
||||||
|
<h3>Why Shop With Us?</h3>
|
||||||
|
<ul>
|
||||||
|
<li class="two-a">
|
||||||
|
<h4>24 Hours</h4>
|
||||||
|
<p>We're always here to help.</p>
|
||||||
|
</li>
|
||||||
|
<li class="two-c">
|
||||||
|
<h4>No Spam</h4>
|
||||||
|
<p>We'll never share your info.</p>
|
||||||
|
</li>
|
||||||
|
<li class="two-d">
|
||||||
|
<h4>Secure Servers</h4>
|
||||||
|
<p>Checkout is 256bit encrypted.</p>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<!-- end page -->
|
||||||
@@ -0,0 +1,70 @@
|
|||||||
|
<div id="page" class="innerpage clearfix">
|
||||||
|
<h1>{{ collection.title }}</h1>
|
||||||
|
{% if collection.description.size > 0 %}
|
||||||
|
<div class="latest-news">{{ collection.description }}</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% paginate collection.products by 8 %}
|
||||||
|
|
||||||
|
<ul class="item-list clearfix">
|
||||||
|
{% for product in collection.products %}
|
||||||
|
<li>
|
||||||
|
<form action="/cart/add" method="post">
|
||||||
|
<div class="item-list-item">
|
||||||
|
<div class="ili-top clearfix">
|
||||||
|
<div class="ili-top-content">
|
||||||
|
<h2><a href="{{product.url}}">{{product.title}}</a></h2>
|
||||||
|
<p>{{ product.description | truncatewords: 15 }}</p>
|
||||||
|
</div>
|
||||||
|
<a href="{{product.url}}" class="ili-top-image"><img src="{{ product.featured_image | product_img_url: 'small' }}" alt="{{ product.title | escape }}"/></a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="ili-bottom clearfix">
|
||||||
|
<p class="hiddenvariants" style="display: none">{% for variant in product.variants %}<span><input type="radio" name="id" value="{{variant.id}}" id="radio_{{variant.id}}" style="vertical-align: middle;" {%if forloop.first%} checked="checked" {%endif%} /><label for="radio_{{variant.id}}">{{ variant.price | money_with_currency }} - {{ variant.title }}</label></span>{% endfor %}</p>
|
||||||
|
<input type="submit" class="" value="Add to Basket" />
|
||||||
|
<p>
|
||||||
|
<a href="{{product.url}}">View Details</a>
|
||||||
|
|
||||||
|
<span>
|
||||||
|
{% if product.compare_at_price %}
|
||||||
|
{% if product.price_min != product.compare_at_price %}
|
||||||
|
{{product.compare_at_price | money}} -
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
<strong>
|
||||||
|
{{product.price_min | money}}
|
||||||
|
</strong>
|
||||||
|
</span>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<div class="paginate clearfix">
|
||||||
|
{{ paginate | default_pagination }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div id="three-reasons" class="clearfix">
|
||||||
|
<h3>Why Shop With Us?</h3>
|
||||||
|
<ul>
|
||||||
|
<li class="two-a">
|
||||||
|
<h4>24 Hours</h4>
|
||||||
|
<p>We're always here to help.</p>
|
||||||
|
</li>
|
||||||
|
<li class="two-c">
|
||||||
|
<h4>No Spam</h4>
|
||||||
|
<p>We'll never share your info.</p>
|
||||||
|
</li>
|
||||||
|
<li class="two-d">
|
||||||
|
<h4>Secure Servers</h4>
|
||||||
|
<p>Checkout is 256bit encrypted.</p>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% endpaginate %}
|
||||||
@@ -0,0 +1,94 @@
|
|||||||
|
<div id="gwrap">
|
||||||
|
<div id="gbox">
|
||||||
|
<h1>Three Great Reasons You Should Shop With Us...</h1>
|
||||||
|
<ul>
|
||||||
|
<li class="gbox1">
|
||||||
|
<h2>Free Shipping</h2>
|
||||||
|
<p>On all orders over $25</p>
|
||||||
|
</li>
|
||||||
|
<li class="gbox2">
|
||||||
|
<h2>Top Quality</h2>
|
||||||
|
<p>Hand made in our shop</p>
|
||||||
|
</li>
|
||||||
|
<li class="gbox3">
|
||||||
|
<h2>100% Guarantee</h2>
|
||||||
|
<p>Any time, any reason</p>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="page" class="clearfix">
|
||||||
|
|
||||||
|
<div class="latest-news">{{pages.alert.content}}</div>
|
||||||
|
|
||||||
|
<ul class="item-list clearfix">
|
||||||
|
|
||||||
|
{% for product in collections.frontpage.products %}
|
||||||
|
<li>
|
||||||
|
<form action="/cart/add" method="post">
|
||||||
|
<div class="item-list-item">
|
||||||
|
<div class="ili-top clearfix">
|
||||||
|
<div class="ili-top-content">
|
||||||
|
<h2><a href="{{product.url}}">{{product.title}}</a></h2>
|
||||||
|
{{ product.description | truncatewords: 15 }}</p> <!-- extra cloding <p> tag for truncation -->
|
||||||
|
</div>
|
||||||
|
<a href="{{product.url}}" class="ili-top-image"><img src="{{ product.featured_image | product_img_url: 'small' }}" alt="{{ product.title | escape }}"/></a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="ili-bottom clearfix">
|
||||||
|
<p class="hiddenvariants" style="display: none">{% for variant in product.variants %}<span><input type="radio" name="id" value="{{variant.id}}" id="radio_{{variant.id}}" style="vertical-align: middle;" {%if forloop.first%} checked="checked" {%endif%} /><label for="radio_{{variant.id}}">{{ variant.price | money_with_currency }} - {{ variant.title }}</label></span>{% endfor %}</p>
|
||||||
|
<input type="submit" class="" value="Add to Basket" />
|
||||||
|
<p>
|
||||||
|
<a href="{{product.url}}">View Details</a>
|
||||||
|
|
||||||
|
<span>
|
||||||
|
{% if product.compare_at_price %}
|
||||||
|
{% if product.price_min != product.compare_at_price %}
|
||||||
|
{{product.compare_at_price | money}} -
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
<strong>
|
||||||
|
{{product.price_min | money}}
|
||||||
|
</strong>
|
||||||
|
</span>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</li>
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<div id="one-two">
|
||||||
|
<div id="two">
|
||||||
|
<h3>Why Shop With Us?</h3>
|
||||||
|
<ul>
|
||||||
|
<li class="two-a">
|
||||||
|
<h4>24 Hours</h4>
|
||||||
|
<p>We're always here to help.</p>
|
||||||
|
</li>
|
||||||
|
<li class="two-c">
|
||||||
|
<h4>No Spam</h4>
|
||||||
|
<p>We'll never share your info.</p>
|
||||||
|
</li>
|
||||||
|
<li class="two-b">
|
||||||
|
<h4>Save Energy</h4>
|
||||||
|
<p>We're green, all the way.</p>
|
||||||
|
</li>
|
||||||
|
<li class="two-d">
|
||||||
|
<h4>Secure Servers</h4>
|
||||||
|
<p>Checkout is 256bits encrypted.</p>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="one">
|
||||||
|
<h3>Our Company</h3>
|
||||||
|
{{pages.about-us.content | truncatewords: 49}} <a href="/pages/about-us">read more</a></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<!-- end page -->
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
<div id="page" class="innerpage clearfix">
|
||||||
|
|
||||||
|
<div id="text-page">
|
||||||
|
<div class="entry">
|
||||||
|
<h1>{{page.title}}</h1>
|
||||||
|
<div class="entry-post">
|
||||||
|
{{page.content}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<h1>Featured Products</h1>
|
||||||
|
<ul class="item-list clearfix">
|
||||||
|
|
||||||
|
{% for product in collections.frontpage.products %}
|
||||||
|
<li>
|
||||||
|
<form action="/cart/add" method="post">
|
||||||
|
<div class="item-list-item">
|
||||||
|
<div class="ili-top clearfix">
|
||||||
|
<div class="ili-top-content">
|
||||||
|
<h2><a href="{{product.url}}">{{product.title}}</a></h2>
|
||||||
|
<p>{{ product.description | truncatewords: 15 }}</p>
|
||||||
|
</div>
|
||||||
|
<a href="{{product.url}}" class="ili-top-image"><img src="{{ product.featured_image | product_img_url: 'small' }}" alt="{{ product.title | escape }}"/></a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="ili-bottom clearfix">
|
||||||
|
<p class="hiddenvariants" style="display: none">{% for variant in product.variants %}<span><input type="radio" name="id" value="{{variant.id}}" id="radio_{{variant.id}}" style="vertical-align: middle;" {%if forloop.first%} checked="checked" {%endif%} /><label for="radio_{{variant.id}}">{{ variant.price | money_with_currency }} - {{ variant.title }}</label></span>{% endfor %}</p>
|
||||||
|
<input type="submit" class="" value="Add to Basket" />
|
||||||
|
<p>
|
||||||
|
<a href="{{product.url}}">View Details</a>
|
||||||
|
|
||||||
|
<span>
|
||||||
|
{% if product.compare_at_price %}
|
||||||
|
{% if product.price_min != product.compare_at_price %}
|
||||||
|
{{product.compare_at_price | money}} -
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
<strong>
|
||||||
|
{{product.price_min | money}}
|
||||||
|
</strong>
|
||||||
|
</span>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</li>
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<!-- end page -->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,116 @@
|
|||||||
|
<div id="page" class="innerpage clearfix">
|
||||||
|
<h1>{{ collection.title }} {{ product.title }}</h1>
|
||||||
|
|
||||||
|
|
||||||
|
<p class="latest-news"><strong>Product Tags: </strong>
|
||||||
|
{% for tag in product.tags %}
|
||||||
|
<a href="/collections/all/{{ tag }}">{{ tag }}</a> |
|
||||||
|
{% endfor %}
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<div class="product clearfix">
|
||||||
|
<div class="product-info">
|
||||||
|
<h1>{{ product.title }}</h1>
|
||||||
|
<div class="product-info-description">
|
||||||
|
<p>{{ product.description }} </p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% if product.available %}
|
||||||
|
<form action="/cart/add" method="post">
|
||||||
|
|
||||||
|
<h2>Product Options:</h2>
|
||||||
|
|
||||||
|
<select id="product-info-options" 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"></div>
|
||||||
|
|
||||||
|
<div class="product-purchase-btn">
|
||||||
|
<input type="submit" class="add-this-to-cart" id="add-this-to-cart" value="Add to Basket" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
{% else %}
|
||||||
|
<h2>Sold out!</h2>
|
||||||
|
<p>Sorry, we're all out of this product. Check back often and order when it returns</p>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="product-images clearfix">
|
||||||
|
{% for image in product.images %}
|
||||||
|
|
||||||
|
{% if forloop.first %}
|
||||||
|
<div class="product-image-large">
|
||||||
|
<img src="{{ image | product_img_url: 'medium'}}" alt="{{product.title | escape }}" />
|
||||||
|
</div>
|
||||||
|
{% else %}
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
<ul class="product-thumbs clearfix">
|
||||||
|
{% for image in product.images %}
|
||||||
|
{% if forloop.first %}
|
||||||
|
{% else %}
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="{{ image | product_img_url: 'large' }}" class="product-thumbs" rel="lightbox[product]" title="">
|
||||||
|
<img src="{{ image | product_img_url: 'small'}}" alt="{{product.title | escape }}" />
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div id="three-reasons" class="clearfix">
|
||||||
|
<h3>Why Shop With Us?</h3>
|
||||||
|
<ul>
|
||||||
|
<li class="two-a">
|
||||||
|
<h4>24 Hours</h4>
|
||||||
|
<p>We're always here to help.</p>
|
||||||
|
</li>
|
||||||
|
<li class="two-c">
|
||||||
|
<h4>No Spam</h4>
|
||||||
|
<p>We'll never share your info.</p>
|
||||||
|
</li>
|
||||||
|
<li class="two-d">
|
||||||
|
<h4>Secure Servers</h4>
|
||||||
|
<p>Checkout is 256bit encrypted.</p>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<!-- end page -->
|
||||||
|
|
||||||
|
<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-this-to-cart').removeClassName('disabled'); // remove unavailable class from add-to-cart button
|
||||||
|
$('add-this-to-cart').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-this-to-cart').addClassName('disabled'); // set add-to-cart button to unavailable class
|
||||||
|
$('add-this-to-cart').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("product-info-options", { product: {{ product | json }}, onVariantSelected: selectCallback });
|
||||||
|
});
|
||||||
|
-->
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div id="page" class="innerpage clearfix">
|
||||||
|
<h1>Search Results</h1>
|
||||||
|
{% if search.performed %}
|
||||||
|
|
||||||
|
{% paginate search.results by 10 %}
|
||||||
|
|
||||||
|
{% if search.results == empty %}
|
||||||
|
<div class="latest-news">Your search for "{{search.terms | escape}}" did not yield any results</div>
|
||||||
|
{% else %}
|
||||||
|
|
||||||
|
|
||||||
|
<ul class="search-list clearfix">
|
||||||
|
{% for item in search.results %}
|
||||||
|
<li>
|
||||||
|
<h3 class="stitle">{{ item.title | link_to: item.url }}</h3>
|
||||||
|
<p class="sinfo">{{ item.content | strip_html | truncatewords: 65 | highlight: search.terms }} ... <a href="{{item.url}}" title="">view this item</a></p>
|
||||||
|
</li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<div class="paginate clearfix">
|
||||||
|
{{ paginate | default_pagination }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div id="three-reasons" class="clearfix">
|
||||||
|
<h3>Why Shop With Us?</h3>
|
||||||
|
<ul>
|
||||||
|
<li class="two-a">
|
||||||
|
<h4>24 Hours</h4>
|
||||||
|
<p>We're always here to help.</p>
|
||||||
|
</li>
|
||||||
|
<li class="two-c">
|
||||||
|
<h4>No Spam</h4>
|
||||||
|
<p>We'll never share your info.</p>
|
||||||
|
</li>
|
||||||
|
<li class="two-d">
|
||||||
|
<h4>Secure Servers</h4>
|
||||||
|
<p>Checkout is 256bit encrypted.</p>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% endpaginate %}
|
||||||
|
{% endif %}
|
||||||
@@ -0,0 +1,90 @@
|
|||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<title>{{shop.name}} - {{page_title}}</title>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||||
|
|
||||||
|
{{ 'reset.css' | asset_url | stylesheet_tag }}
|
||||||
|
{{ 'style.css' | asset_url | stylesheet_tag }}
|
||||||
|
|
||||||
|
{{ 'lightbox.css' | 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.js' | asset_url | script_tag }}
|
||||||
|
{{ 'option_selection.js' | shopify_asset_url | script_tag }}
|
||||||
|
|
||||||
|
{{ content_for_header }}
|
||||||
|
</head>
|
||||||
|
<body id="page-{{template}}">
|
||||||
|
|
||||||
|
<div id="wrap">
|
||||||
|
|
||||||
|
<div id="top">
|
||||||
|
<div id="cart">
|
||||||
|
<h3>Shopping Cart</h3>
|
||||||
|
<p class="cart-count">
|
||||||
|
{% if cart.item_count == 0 %}
|
||||||
|
Your cart is currently empty
|
||||||
|
{% else %}
|
||||||
|
{{ cart.item_count }} {{ cart.item_count | pluralize: 'item', 'items' }} <span>-</span> Total: {{cart.total_price | money_with_currency }} <span>-</span> <a href="/cart">View Cart</a>
|
||||||
|
{% endif %}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="site-title">
|
||||||
|
<h3><a href="/">{{shop.name}}</a></h3>
|
||||||
|
<h4><span>Tribble: A Shopify Theme</span></h4>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<ul id="nav">
|
||||||
|
{% for link in linklists.main-menu.links %}
|
||||||
|
<li>{{ link.title | link_to: link.url }}</li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
{{ content_for_layout }}
|
||||||
|
|
||||||
|
<div id="foot" class="clearfix">
|
||||||
|
<div class="quick-links">
|
||||||
|
<h4>Quick Navigation</h4>
|
||||||
|
<ul class="clearfix">
|
||||||
|
<li><a href="/">Home</a></li>
|
||||||
|
<li><a href="#top">Back to top</a></li>
|
||||||
|
{% for link in linklists.main-menu.links %}
|
||||||
|
<li>{{ link.title | link_to: link.url }}</li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="quick-contact">
|
||||||
|
<h4>Quick Contact</h4>
|
||||||
|
<div class="vcard">
|
||||||
|
|
||||||
|
<div class="org fn">
|
||||||
|
<div class="organization-name">Really Great Widget Co.</div>
|
||||||
|
</div>
|
||||||
|
<div class="adr">
|
||||||
|
<span class="street-address">2531 Barrington Court</span>
|
||||||
|
<span class="locality">Hayward</span>,
|
||||||
|
<abbr title="California" class="region">CA</abbr>
|
||||||
|
<span class="postal-code">94545</span>
|
||||||
|
</div>
|
||||||
|
<a class="email" href="mailto:[email protected]">
|
||||||
|
[email protected]
|
||||||
|
</a>
|
||||||
|
<div class="tel">
|
||||||
|
<span class="type">Support:</span> <span class="value">800-555-9954</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p><a href="http://shopify.com" class="we-made">Powered by Shopify</a> © Copyright {{ "now" | date: "%Y" }} {{ shop.name }}, All Rights Reserved. <a href="/blogs/news.xml" id="foot-rss">RSS Feed</a></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
<div class="article">
|
||||||
|
<h3 class="article-head-title">{{ article.title }}</h3>
|
||||||
|
<p> posted {{ article.created_at | date: "%Y %h" }} by {{ article.author }}</p>
|
||||||
|
<div class="article-body textile">
|
||||||
|
{{ article.content }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% if blog.comments_enabled? %}
|
||||||
|
<div id="comments">
|
||||||
|
<h3>Comments</h3>
|
||||||
|
<!-- List all comments -->
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
{% for comment in article.comments %}
|
||||||
|
<li>
|
||||||
|
<div class="comment">
|
||||||
|
{{ comment.content }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="comment-details">
|
||||||
|
Posted by {{ comment.author }} on {{ comment.created_at | date: "%B %d, %Y" }}
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<!-- 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" />
|
||||||
|
{% endform %}
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
<div id="shop-id-label_about">
|
||||||
|
<h3 class="article-head-title">{{page.title}}</h3>
|
||||||
|
|
||||||
|
{% paginate blog.articles by 20 %}
|
||||||
|
|
||||||
|
{% for article in blog.articles %}
|
||||||
|
<div class="article">
|
||||||
|
<h3 class="article-head-title">
|
||||||
|
<a href="{{article.url}}">{{ article.title }}</a>
|
||||||
|
</h3>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
{% if blog.comments_enabled? %}
|
||||||
|
<a href="{{article.url}}#comments">{{ article.comments_count }} comments</a>
|
||||||
|
—
|
||||||
|
{% endif %}
|
||||||
|
posted {{ article.created_at | date: "%Y %h" }} by {{ article.author }}</p>
|
||||||
|
<div class="article-body textile">
|
||||||
|
{{ article.content }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
<div id="pagination">
|
||||||
|
{{ paginate | default_pagination }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% endpaginate %}
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="clear-me"></div>
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
<h1>Shopping Cart</h1>
|
||||||
|
{% if cart.item_count == 0 %}
|
||||||
|
<p><strong>Your shopping basket is empty.</strong> Perhaps a featured item below is of interest...</p>
|
||||||
|
<table id="gallery">
|
||||||
|
{% tablerow product in collections.frontpage.products cols: 3 limit: 12 %}
|
||||||
|
<div class="gallery-image">
|
||||||
|
<a href="{{ product.url | within: collections.frontpage }}" title="{{ product.title | escape }} — {{ product.description | strip_html | truncate: 50 | escape }}"><img src="{{ product.images.first | product_img_url: 'medium' }}" alt="{{ product.title | escape }}" /></a>
|
||||||
|
</div>
|
||||||
|
<div class="gallery-info">
|
||||||
|
<a href="{{ product.url | within: collections.frontpage }}">{{ product.title | truncate: 30 }}</a><br />
|
||||||
|
<small>{{ product.price | money }}{% if product.compare_at_price_max > product.price %} <del>{{ product.compare_at_price_max | money }}</del>{% endif %}</small>
|
||||||
|
</div>
|
||||||
|
{% endtablerow %}
|
||||||
|
</table>
|
||||||
|
{% else %}
|
||||||
|
<script type="text/javascript">
|
||||||
|
function remove_item(id) {
|
||||||
|
document.getElementById('updates_'+id).value = 0;
|
||||||
|
document.getElementById('cartform').submit();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<form action="/cart" method="post" id="cartform">
|
||||||
|
<table id="basket">
|
||||||
|
<tr>
|
||||||
|
<th>Item Description</th>
|
||||||
|
<th>Price</th>
|
||||||
|
<th>Qty</th>
|
||||||
|
<th>Delete</th>
|
||||||
|
<th>Total</th>
|
||||||
|
</tr>{% for item in cart.items %}
|
||||||
|
<tr class="basket-{% cycle 'odd', 'even' %}">
|
||||||
|
<td class="basket-column-one">
|
||||||
|
<div class="basket-images">
|
||||||
|
<a href="{{ item.product.url }}" title="{{ item.title | escape }} — {{ item.product.description | strip_html | truncate: 50 | escape }}"><img src="{{ item.product.images.first | product_img_url: 'thumb' }}" alt="{{ item.title | escape }}" /></a>
|
||||||
|
</div>
|
||||||
|
<div class="basket-desc">
|
||||||
|
<p><a href="{{ item.product.url }}">{{ item.title }}</a></p>
|
||||||
|
{{ item.product.description | strip_html | truncate: 120 }}
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td class="basket-column">{{ item.price | money }}{% if item.variant.compare_at_price > item.price %}<br /><del>{{ item.variant.compare_at_price | money }}</del>{% endif %}</td>
|
||||||
|
<td class="basket-column"><input type="text" size="4" name="updates[{{item.variant.id}}]" id="updates_{{ item.variant.id }}" value="{{ item.quantity }}" onfocus="this.select();"/></td>
|
||||||
|
<td class="basket-column"><a href="#" onclick="remove_item({{ item.variant.id }}); return false;">Remove</a></td>
|
||||||
|
<td class="basket-column">{{ item.line_price | money }}</td>
|
||||||
|
</tr>{% endfor %}
|
||||||
|
</table>
|
||||||
|
<div id="basket-right">
|
||||||
|
<h3>Subtotal {{ cart.total_price | money }}</h3>
|
||||||
|
<input type="image" src="{{ 'update.png' | asset_url }}" id="update-cart" name="update" value="Update" />
|
||||||
|
<input type="image" src="{{ 'checkout.png' | asset_url }}" name="checkout" value="Checkout" />
|
||||||
|
{% if additional_checkout_buttons %}
|
||||||
|
<div class="additional-checkout-buttons">
|
||||||
|
<p>- or -</p>
|
||||||
|
{{ content_for_additional_checkout_buttons }}
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
</form>{% endif %}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
{% paginate collection.products by 12 %}{% if collection.products.size == 0 %}
|
||||||
|
<strong>No products found in this collection.</strong>{% else %}
|
||||||
|
<h1>{{ collection.title }}</h1>
|
||||||
|
{{ collection.description }}
|
||||||
|
<table id="gallery">
|
||||||
|
{% tablerow product in collection.products cols: 3 %}
|
||||||
|
<div class="gallery-image">
|
||||||
|
<a href="{{ product.url | within: collection }}" title="{{ product.title | escape }} — {{ product.description | strip_html | truncate: 50 | escape }}"><img src="{{ product.images.first | product_img_url: 'small' }}" alt="{{ product.title | escape }}" /></a>
|
||||||
|
</div>
|
||||||
|
<div class="gallery-info">
|
||||||
|
<a href="{{ product.url | within: collection }}">{{ product.title | truncate: 30 }}</a><br />
|
||||||
|
<small>{{ product.price | money }}{% if product.compare_at_price_max > product.price %} <del>{{ product.compare_at_price_max | money }}</del>{% endif %}</small>
|
||||||
|
</div>
|
||||||
|
{% endtablerow %}
|
||||||
|
</table>{% if paginate.pages > 1 %}
|
||||||
|
<div id="paginate">
|
||||||
|
{{ paginate | default_pagination }}
|
||||||
|
</div>{% endif %}{% endif %}
|
||||||
|
{% endpaginate %}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
<div id="about-excerpt">
|
||||||
|
{% assign article = pages.frontpage %}
|
||||||
|
{% if article.content != "" %}
|
||||||
|
<h2>{{ article.title }}</h2>
|
||||||
|
{{ article.content }}
|
||||||
|
{% else %}
|
||||||
|
In <em>Admin > Blogs & 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" }}
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<table id="gallery">
|
||||||
|
{% tablerow product in collections.frontpage.products cols: 3 limit: 12 %}
|
||||||
|
<div class="gallery-image">
|
||||||
|
<a href="{{ product.url | within: collections.frontpage }}" title="{{ product.title | escape }} — {{ product.description | strip_html | truncate: 50 | escape }}"><img src="{{ product.images.first | product_img_url: 'small' }}" alt="{{ product.title | escape }}" /></a>
|
||||||
|
</div>
|
||||||
|
<div class="gallery-info">
|
||||||
|
<a href="{{ product.url | within: collections.frontpage }}">{{ product.title | truncate: 30 }}</a><br />
|
||||||
|
<small>{{ product.price | money }}{% if product.compare_at_price_max > product.price %} <del>{{ product.compare_at_price_max | money }}</del>{% endif %}</small>
|
||||||
|
</div>
|
||||||
|
{% endtablerow %}
|
||||||
|
</table>
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
<h1>{{ page.title }}</h1>
|
||||||
|
{{ page.content }}
|
||||||
|
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
<div id="product-left">
|
||||||
|
{% for image in product.images %}{% if forloop.first %}<div id="product-image">
|
||||||
|
<a href="{{ image | product_img_url: 'large' }}" rel="lightbox[images]" title="{{ product.title | escape }}"><img src="{{ image | product_img_url: 'medium' }}" alt="{{ product.title | escape }}" /></a>
|
||||||
|
</div>{% else %}
|
||||||
|
<div class="product-images">
|
||||||
|
<a href="{{ image | product_img_url: 'large' }}" rel="lightbox[images]" title="{{ product.title | escape }}"><img src="{{ image | product_img_url: 'small' }}" alt="{{ product.title | escape }}" /></a>
|
||||||
|
</div>{% endif %}{% endfor %}
|
||||||
|
</div>
|
||||||
|
<div id="product-right">
|
||||||
|
<h1>{{ product.title }}</h1>
|
||||||
|
{{ product.description }}
|
||||||
|
|
||||||
|
{% if product.available %}
|
||||||
|
<form action="/cart/add" method="post">
|
||||||
|
|
||||||
|
<div id="product-variants">
|
||||||
|
<div id="price-field"></div>
|
||||||
|
|
||||||
|
<select id="product-select" name='id'>
|
||||||
|
{% for variant in product.variants %}
|
||||||
|
<option value="{{ variant.id }}">{{ variant.title }} - {{ variant.price | money }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<input type="image" src="{{ 'purchase.png' | asset_url }}" name="add" value="Purchase" id="purchase" />
|
||||||
|
</form>
|
||||||
|
{% else %}
|
||||||
|
<p class="bold-red">This product is temporarily unavailable</p>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<div id="product-details">
|
||||||
|
<strong>Continue Shopping</strong><br />
|
||||||
|
Browse more {{ product.type | link_to_type }} or additional {{ product.vendor | link_to_vendor }} products.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
<!--
|
||||||
|
// mootools callback for multi variants dropdown selector
|
||||||
|
var selectCallback = function(variant, selector) {
|
||||||
|
if (variant && variant.available == true) {
|
||||||
|
// selected a valid variant
|
||||||
|
$('purchase').removeClass('disabled'); // remove unavailable class from add-to-cart button
|
||||||
|
$('purchase').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
|
||||||
|
$('purchase').addClass('disabled'); // set add-to-cart button to unavailable class
|
||||||
|
$('purchase').disabled = true; // disable add-to-cart button
|
||||||
|
$('price-field').innerHTML = (variant) ? "Sold Out" : "Unavailable"; // update price-field message
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// initialize multi selector for product
|
||||||
|
window.addEvent('domready', function() {
|
||||||
|
new Shopify.OptionSelectors("product-select", { product: {{ product | json }}, onVariantSelected: selectCallback });
|
||||||
|
});
|
||||||
|
-->
|
||||||
|
</script>
|
||||||
|
|
||||||
@@ -0,0 +1,122 @@
|
|||||||
|
<!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">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<title>{{ shop.name }} — {{ page_title }}</title>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
|
|
||||||
|
{{ 'stylesheet.css' | asset_url | stylesheet_tag }}
|
||||||
|
|
||||||
|
<!-- Additional colour schemes for this theme. If you want to use them, just replace the above line with one of these
|
||||||
|
{{ 'caramel.css' | asset_url | stylesheet_tag }}
|
||||||
|
{{ 'sea.css' | asset_url | stylesheet_tag }}
|
||||||
|
-->
|
||||||
|
|
||||||
|
{{ 'mootools.js' | global_asset_url | script_tag }}
|
||||||
|
{{ 'slimbox.js' | global_asset_url | script_tag }}
|
||||||
|
{{ 'option_selection.js' | shopify_asset_url | script_tag }}
|
||||||
|
|
||||||
|
{{ content_for_header }}
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body id="page-{{ template }}">
|
||||||
|
|
||||||
|
<div id="header">
|
||||||
|
<div class="container">
|
||||||
|
<div id="logo">
|
||||||
|
<h1><a href="/" title="{{ shop.name }}">{{ shop.name }}</a></h1>
|
||||||
|
</div>
|
||||||
|
<div id="navigation">
|
||||||
|
<ul id="navigate">
|
||||||
|
<li><a href="/cart">View Cart</a></li>
|
||||||
|
{% for link in linklists.main-menu.links reversed %}
|
||||||
|
<li><a href="{{ link.url }}">{{ link.title }}</a></li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="mini-header">
|
||||||
|
<div class="container">
|
||||||
|
<div id="shopping-cart">
|
||||||
|
<a href="/cart">Your shopping cart contains {{ cart.item_count }} {{ cart.item_count | pluralize: 'item', 'items' }}</a>
|
||||||
|
</div>
|
||||||
|
<div id="search-box">
|
||||||
|
<form action="/search" method="get">
|
||||||
|
<input type="text" name="q" id="q" />
|
||||||
|
<input type="image" src="{{ 'seek.png' | asset_url }}" value="Seek" onclick="this.parentNode.submit(); return false;" id="seek" />
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="layout">
|
||||||
|
<div class="container">
|
||||||
|
<div id="layout-left" {% if template != "cart" %}{% if template != "product" %}style="width:619px"{% endif %}{% endif %}>{% if template == "search" %}
|
||||||
|
<h1>Search Results</h1>{% endif %}
|
||||||
|
{{ content_for_layout }}
|
||||||
|
</div>{% if template != "cart" %}{% if template != "product" %}
|
||||||
|
|
||||||
|
<div id="layout-right">
|
||||||
|
{% if template == "index" %}
|
||||||
|
{% if blogs.news.articles.size > 1 %}
|
||||||
|
<a href="{{ shop.url }}/blogs/news.xml"><img src="{{ 'feed.png' | asset_url }}" alt="Subscribe" class="feed" /></a>
|
||||||
|
<h3><a href="/blogs/news">More news</a></h3>
|
||||||
|
<ul id="blogs">{% for article in blogs.news.articles limit: 6 offset: 1 %}
|
||||||
|
<li><a href="{{ article.url }}">{{ article.title | strip_html | truncate: 30 }}</a><br />
|
||||||
|
<small>{{ article.content | strip_html | truncatewords: 12 }}</small>
|
||||||
|
</li>{% endfor %}
|
||||||
|
</ul>
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if template == "collection" %}
|
||||||
|
<h3>Collection Tags</h3>
|
||||||
|
<div id="tags">{% if collection.tags.size == 0 %}
|
||||||
|
No tags found.{% else %}
|
||||||
|
<span class="tags">{% for tag in collection.tags %}{% if current_tags contains tag %} {{ tag | highlight_active_tag | link_to_remove_tag: tag }}{% else %} {{ tag | highlight_active_tag | link_to_add_tag: tag }}{% endif %}{% unless forloop.last %}, {% endunless %}{% endfor %}</span>{% endif %}
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<h3>Navigation</h3>
|
||||||
|
<ul id="links">
|
||||||
|
{% for link in linklists.main-menu.links %}
|
||||||
|
<li><a href="{{ link.url }}">{{ link.title }}</a></li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
{% if template != "page" %}
|
||||||
|
<h3>Featured Products</h3>
|
||||||
|
<ul id="featuring">{% for product in collections.frontpage.products limit: 6 %}
|
||||||
|
<li class="featuring-list">
|
||||||
|
<div class="featuring-image">
|
||||||
|
<a href="{{ product.url | within: collections.frontpage }}" title="{{ product.title | escape }} — {{ product.description | strip_html | truncate: 50 }}"><img src="{{ product.images.first | product_img_url: 'icon' }}" alt="{{ product.title | escape }}" /></a>
|
||||||
|
</div>
|
||||||
|
<div class="featuring-info">
|
||||||
|
<a href="{{ product.url | within: collections.frontpage }}">{{ product.title | strip_html | truncate: 28 }}</a><br />
|
||||||
|
<small><span class="light">from</span> {{ product.price | money }}</small>
|
||||||
|
</div>
|
||||||
|
</li>{% endfor %}
|
||||||
|
</ul>
|
||||||
|
{% endif %}
|
||||||
|
</div>{% endif %}{% endif %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="footer">
|
||||||
|
<div id="footer-fader">
|
||||||
|
<div class="container">
|
||||||
|
<div id="footer-right">{% for link in linklists.footer.links %}
|
||||||
|
{{ link.title | link_to: link.url }} {% unless forloop.last %}|{% endunless %}{% endfor %}
|
||||||
|
</div>
|
||||||
|
<span id="footer-left">
|
||||||
|
Copyright © {{ "now" | date: "%Y" }} <a href="/">{{ shop.name }}</a>. All Rights Reserved. All prices {{ shop.currency }}.<br />
|
||||||
|
This website is powered by <a href="http://www.shopify.com">Shopify</a>.
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
+13
-12
@@ -156,7 +156,9 @@ class ContextTest < Test::Unit::TestCase
|
|||||||
assert_equal 'hi? hi!', context.invoke(:hi, 'hi?')
|
assert_equal 'hi? hi!', context.invoke(:hi, 'hi?')
|
||||||
|
|
||||||
context = Context.new(@template)
|
context = Context.new(@template)
|
||||||
assert_equal 'hi?', context.invoke(:hi, 'hi?')
|
assert_raises(FilterNotFound) {
|
||||||
|
context.invoke(:hi, 'hi?')
|
||||||
|
}
|
||||||
|
|
||||||
context.add_filters(filter)
|
context.add_filters(filter)
|
||||||
assert_equal 'hi? hi!', context.invoke(:hi, 'hi?')
|
assert_equal 'hi? hi!', context.invoke(:hi, 'hi?')
|
||||||
@@ -190,9 +192,10 @@ class ContextTest < Test::Unit::TestCase
|
|||||||
end
|
end
|
||||||
|
|
||||||
context = Context.new(@template)
|
context = Context.new(@template)
|
||||||
methods = context.strainer.methods
|
methods_before = context.strainer.methods.map { |method| method.to_s }
|
||||||
context.add_filters(filter)
|
context.add_filters(filter)
|
||||||
assert_equal (methods + ['hi']).sort, context.strainer.methods.sort
|
methods_after = context.strainer.methods.map { |method| method.to_s }
|
||||||
|
assert_equal (methods_before + ["hi"]).sort, methods_after.sort
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_add_item_in_outer_scope
|
def test_add_item_in_outer_scope
|
||||||
@@ -289,11 +292,9 @@ class ContextTest < Test::Unit::TestCase
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_access_hashes_with_hash_notation
|
def test_access_hashes_with_hash_notation
|
||||||
|
|
||||||
@context['products'] = {'count' => 5, 'tags' => ['deepsnow', 'freestyle'] }
|
@context['products'] = {'count' => 5, 'tags' => ['deepsnow', 'freestyle'] }
|
||||||
@context['product'] = {'variants' => [ {'title' => 'draft151cm'}, {'title' => 'element151cm'} ]}
|
@context['product'] = {'variants' => [ {'title' => 'draft151cm'}, {'title' => 'element151cm'} ]}
|
||||||
|
|
||||||
|
|
||||||
assert_equal 5, @context['products["count"]']
|
assert_equal 5, @context['products["count"]']
|
||||||
assert_equal 'deepsnow', @context['products["tags"][0]']
|
assert_equal 'deepsnow', @context['products["tags"][0]']
|
||||||
assert_equal 'deepsnow', @context['products["tags"].first']
|
assert_equal 'deepsnow', @context['products["tags"].first']
|
||||||
@@ -417,25 +418,25 @@ class ContextTest < Test::Unit::TestCase
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_lambda_as_variable
|
def test_lambda_as_variable
|
||||||
@context['dynamic'] = lambda { 'Hello' }
|
@context['dynamic'] = proc { 'Hello' }
|
||||||
|
|
||||||
assert_equal 'Hello', @context['dynamic']
|
assert_equal 'Hello', @context['dynamic']
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_nested_lambda_as_variable
|
def test_nested_lambda_as_variable
|
||||||
@context['dynamic'] = { "lambda" => lambda { 'Hello' } }
|
@context['dynamic'] = { "lambda" => proc { 'Hello' } }
|
||||||
|
|
||||||
assert_equal 'Hello', @context['dynamic.lambda']
|
assert_equal 'Hello', @context['dynamic.lambda']
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_array_containing_lambda_as_variable
|
def test_array_containing_lambda_as_variable
|
||||||
@context['dynamic'] = [1,2, lambda { 'Hello' } ,4,5]
|
@context['dynamic'] = [1,2, proc { 'Hello' } ,4,5]
|
||||||
|
|
||||||
assert_equal 'Hello', @context['dynamic[2]']
|
assert_equal 'Hello', @context['dynamic[2]']
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_lambda_is_called_once
|
def test_lambda_is_called_once
|
||||||
@context['callcount'] = lambda { @global ||= 0; @global += 1; @global.to_s }
|
@context['callcount'] = proc { @global ||= 0; @global += 1; @global.to_s }
|
||||||
|
|
||||||
assert_equal '1', @context['callcount']
|
assert_equal '1', @context['callcount']
|
||||||
assert_equal '1', @context['callcount']
|
assert_equal '1', @context['callcount']
|
||||||
@@ -445,7 +446,7 @@ class ContextTest < Test::Unit::TestCase
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_nested_lambda_is_called_once
|
def test_nested_lambda_is_called_once
|
||||||
@context['callcount'] = { "lambda" => lambda { @global ||= 0; @global += 1; @global.to_s } }
|
@context['callcount'] = { "lambda" => proc { @global ||= 0; @global += 1; @global.to_s } }
|
||||||
|
|
||||||
assert_equal '1', @context['callcount.lambda']
|
assert_equal '1', @context['callcount.lambda']
|
||||||
assert_equal '1', @context['callcount.lambda']
|
assert_equal '1', @context['callcount.lambda']
|
||||||
@@ -455,7 +456,7 @@ class ContextTest < Test::Unit::TestCase
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_lambda_in_array_is_called_once
|
def test_lambda_in_array_is_called_once
|
||||||
@context['callcount'] = [1,2, lambda { @global ||= 0; @global += 1; @global.to_s } ,4,5]
|
@context['callcount'] = [1,2, proc { @global ||= 0; @global += 1; @global.to_s } ,4,5]
|
||||||
|
|
||||||
assert_equal '1', @context['callcount[2]']
|
assert_equal '1', @context['callcount[2]']
|
||||||
assert_equal '1', @context['callcount[2]']
|
assert_equal '1', @context['callcount[2]']
|
||||||
@@ -467,7 +468,7 @@ class ContextTest < Test::Unit::TestCase
|
|||||||
def test_access_to_context_from_proc
|
def test_access_to_context_from_proc
|
||||||
@context.registers[:magic] = 345392
|
@context.registers[:magic] = 345392
|
||||||
|
|
||||||
@context['magic'] = lambda { @context.registers[:magic] }
|
@context['magic'] = proc { @context.registers[:magic] }
|
||||||
|
|
||||||
assert_equal 345392, @context['magic']
|
assert_equal 345392, @context['magic']
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -11,14 +11,14 @@ class SecurityTest < Test::Unit::TestCase
|
|||||||
|
|
||||||
def test_no_instance_eval
|
def test_no_instance_eval
|
||||||
text = %( {{ '1+1' | instance_eval }} )
|
text = %( {{ '1+1' | instance_eval }} )
|
||||||
expected = %| 1+1 |
|
expected = %! Liquid error: Error - filter 'instance_eval' in ''1+1' | instance_eval' could not be found. !
|
||||||
|
|
||||||
assert_equal expected, Template.parse(text).render(@assigns)
|
assert_equal expected, Template.parse(text).render(@assigns)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_no_existing_instance_eval
|
def test_no_existing_instance_eval
|
||||||
text = %( {{ '1+1' | __instance_eval__ }} )
|
text = %( {{ '1+1' | __instance_eval__ }} )
|
||||||
expected = %| 1+1 |
|
expected = %! Liquid error: Error - filter '__instance_eval__' in ''1+1' | __instance_eval__' could not be found. !
|
||||||
|
|
||||||
assert_equal expected, Template.parse(text).render(@assigns)
|
assert_equal expected, Template.parse(text).render(@assigns)
|
||||||
end
|
end
|
||||||
@@ -26,7 +26,7 @@ class SecurityTest < Test::Unit::TestCase
|
|||||||
|
|
||||||
def test_no_instance_eval_after_mixing_in_new_filter
|
def test_no_instance_eval_after_mixing_in_new_filter
|
||||||
text = %( {{ '1+1' | instance_eval }} )
|
text = %( {{ '1+1' | instance_eval }} )
|
||||||
expected = %| 1+1 |
|
expected = %! Liquid error: Error - filter 'instance_eval' in ''1+1' | instance_eval' could not be found. !
|
||||||
|
|
||||||
assert_equal expected, Template.parse(text).render(@assigns)
|
assert_equal expected, Template.parse(text).render(@assigns)
|
||||||
end
|
end
|
||||||
@@ -34,7 +34,7 @@ class SecurityTest < Test::Unit::TestCase
|
|||||||
|
|
||||||
def test_no_instance_eval_later_in_chain
|
def test_no_instance_eval_later_in_chain
|
||||||
text = %( {{ '1+1' | add_one | instance_eval }} )
|
text = %( {{ '1+1' | add_one | instance_eval }} )
|
||||||
expected = %| 1+1 + 1 |
|
expected = %! Liquid error: Error - filter 'instance_eval' in ''1+1' | add_one | instance_eval' could not be found. !
|
||||||
|
|
||||||
assert_equal expected, Template.parse(text).render(@assigns, :filters => SecurityFilter)
|
assert_equal expected, Template.parse(text).render(@assigns, :filters => SecurityFilter)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -342,6 +342,7 @@ HERE
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def test_cycle
|
def test_cycle
|
||||||
|
|
||||||
assert_template_result('one','{%cycle "one", "two"%}')
|
assert_template_result('one','{%cycle "one", "two"%}')
|
||||||
@@ -349,13 +350,7 @@ HERE
|
|||||||
|
|
||||||
assert_template_result('one two one','{%cycle "one", "two"%} {%cycle "one", "two"%} {%cycle "one", "two"%}')
|
assert_template_result('one two one','{%cycle "one", "two"%} {%cycle "one", "two"%} {%cycle "one", "two"%}')
|
||||||
|
|
||||||
assert_template_result('text-align: left,text-align: right','{%cycle "text-align: left", "text-align: right" %},{%cycle "text-align: left", "text-align: right"%}')
|
assert_template_result('text-align: left text-align: right','{%cycle "text-align: left", "text-align: right" %} {%cycle "text-align: left", "text-align: right"%}')
|
||||||
|
|
||||||
assert_template_result('','.{% cycle '' %}')
|
|
||||||
assert_template_result('','.{% cycle "" %}')
|
|
||||||
assert_template_result('','.{% cycle "", "" %}')
|
|
||||||
assert_template_result('.','.{% cycle "", "", "</tr><tr>" %}')
|
|
||||||
assert_template_result('...</tr><tr> ','.{% cycle "", "", "</tr><tr>" %}.{% cycle "", "", "</tr><tr>" %}.{% cycle "", "", "</tr><tr>" %} {% cycle "", "", "</tr><tr>" %}')
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -132,4 +132,41 @@ class VariableResolutionTest < Test::Unit::TestCase
|
|||||||
assert_equal 'worked', template.render('test' => {'test' => 'worked'})
|
assert_equal 'worked', template.render('test' => {'test' => 'worked'})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_preset_assigns
|
||||||
|
template = Template.parse(%|{{ test }}|)
|
||||||
|
template.assigns['test'] = 'worked'
|
||||||
|
assert_equal 'worked', template.render
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_reuse_parsed_template
|
||||||
|
template = Template.parse(%|{{ greeting }} {{ name }}|)
|
||||||
|
template.assigns['greeting'] = 'Goodbye'
|
||||||
|
assert_equal 'Hello Tobi', template.render('greeting' => 'Hello', 'name' => 'Tobi')
|
||||||
|
assert_equal 'Hello ', template.render('greeting' => 'Hello', 'unknown' => 'Tobi')
|
||||||
|
assert_equal 'Hello Brian', template.render('greeting' => 'Hello', 'name' => 'Brian')
|
||||||
|
assert_equal 'Goodbye Brian', template.render('name' => 'Brian')
|
||||||
|
assert_equal({'greeting'=>'Goodbye'}, template.assigns)
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_assigns_not_polluted_from_template
|
||||||
|
template = Template.parse(%|{{ test }}{% assign test = 'bar' %}{{ test }}|)
|
||||||
|
template.assigns['test'] = 'baz'
|
||||||
|
assert_equal 'bazbar', template.render
|
||||||
|
assert_equal 'bazbar', template.render
|
||||||
|
assert_equal 'foobar', template.render('test' => 'foo')
|
||||||
|
assert_equal 'bazbar', template.render
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_hash_with_default_proc
|
||||||
|
template = Template.parse(%|Hello {{ test }}|)
|
||||||
|
assigns = Hash.new { |h,k| raise "Unknown variable '#{k}'" }
|
||||||
|
assigns['test'] = 'Tobi'
|
||||||
|
assert_equal 'Hello Tobi', template.render!(assigns)
|
||||||
|
assigns.delete('test')
|
||||||
|
e = assert_raises(RuntimeError) {
|
||||||
|
template.render!(assigns)
|
||||||
|
}
|
||||||
|
assert_equal "Unknown variable 'test'", e.message
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
Reference in New Issue
Block a user