radiant-shop-extension 0.92.10 → 0.92.11

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.92.10
1
+ 0.92.11
@@ -166,7 +166,7 @@ private
166
166
  @shop_category.page = Page.new(
167
167
  :layout_id => (Layout.find_by_name(Radiant::Config['shop.layout_category']).id rescue nil),
168
168
  :parent_id => (Radiant::Config['shop.root_page_id'] rescue 1),
169
- :parts => [PagePart.new]
169
+ :parts => [PagePart.new(:name => 'description')]
170
170
  )
171
171
  @shop_category.product_layout = (Layout.find_by_name(Radiant::Config['shop.layout_product']) rescue nil)
172
172
  end
@@ -223,7 +223,7 @@ private
223
223
  @shop_product.page = Page.new(
224
224
  :parent_id => @shop_category.page_id,
225
225
  :layout_id => @shop_category.product_layout_id,
226
- :parts => [PagePart.new]
226
+ :parts => [PagePart.new(:name => 'description')]
227
227
  )
228
228
  end
229
229
 
@@ -16,9 +16,12 @@ class ShopCategory < ActiveRecord::Base
16
16
 
17
17
  validates_presence_of :page
18
18
 
19
- # Returns the title of the product's page
19
+ # Returns the title of the categories' page
20
20
  def name; page.title; end
21
21
 
22
+ # Returns the url of the categories' page
23
+ def url; page.url; end
24
+
22
25
  # Returns the url of the page formatted as an sku
23
26
  def handle; ShopProduct.to_sku(page.url); end
24
27
 
@@ -24,6 +24,9 @@ class ShopProduct < ActiveRecord::Base
24
24
  # Returns the url of the page formatted as an sku
25
25
  def sku; self.class.to_sku(url) end
26
26
 
27
+ # Returns the url of the product's page
28
+ def url; page.url; end
29
+
27
30
  # Returns category through the pages parent
28
31
  def category; page.parent.shop_category; end
29
32
 
@@ -42,13 +42,13 @@ module Shop
42
42
 
43
43
  tag 'shop:category:if_current' do |tag|
44
44
 
45
- if tag.locals.page.shop_category == tag.locals.shop_category
45
+ if tag.globals.page.shop_category == tag.locals.shop_category
46
46
  # Looking at the shop_category generated page
47
47
  tag.expand
48
48
 
49
- elsif tag.locals.page.shop_product.present?
49
+ elsif tag.globals.page.shop_product.present?
50
50
  # A product page
51
- if tag.locals.page.shop_product.category == tag.locals.shop_category
51
+ if tag.globals.page.shop_product.category == tag.locals.shop_category
52
52
  # Where the products category is this category
53
53
  tag.expand
54
54
  end
@@ -58,14 +58,14 @@ module Shop
58
58
 
59
59
  tag 'shop:category:unless_current' do |tag|
60
60
 
61
- if tag.locals.page.shop_product.present?
61
+ if tag.globals.page.shop_product.present?
62
62
  # A product page
63
- if tag.locals.page.shop_product.category != tag.locals.shop_category
63
+ if tag.globals.page.shop_product.category != tag.locals.shop_category
64
64
  # Where the products category is this category
65
65
  tag.expand
66
66
  end
67
67
 
68
- elsif tag.locals.page.shop_category != tag.locals.shop_category
68
+ elsif tag.globals.page.shop_category != tag.locals.shop_category
69
69
  # Looking at the shop_category generated page
70
70
  tag.expand
71
71
 
@@ -44,13 +44,13 @@ module Shop
44
44
  end
45
45
 
46
46
  tag 'shop:product:if_current' do |tag|
47
- if tag.locals.page.shop_product == tag.locals.shop_product
47
+ if tag.globals.page.shop_product == tag.locals.shop_product
48
48
  tag.expand
49
49
  end
50
50
  end
51
51
 
52
52
  tag 'shop:product:unless_current' do |tag|
53
- if tag.locals.page.shop_product != tag.locals.shop_product
53
+ if tag.globals.page.shop_product != tag.locals.shop_product
54
54
  tag.expand
55
55
  end
56
56
  end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{radiant-shop-extension}
8
- s.version = "0.92.10"
8
+ s.version = "0.92.11"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Dirk Kelly", "John Barker", "Darcy Laycock"]
12
- s.date = %q{2010-12-23}
12
+ s.date = %q{2010-12-29}
13
13
  s.description = %q{Radiant Shop is an attempt at a simple but complete store. It includes Products, Categories, Orders and Credit Card Payments}
14
14
  s.email = %q{dk@dirkkelly.com}
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: radiant-shop-extension
3
3
  version: !ruby/object:Gem::Version
4
- hash: 379
4
+ hash: 377
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 92
9
- - 10
10
- version: 0.92.10
9
+ - 11
10
+ version: 0.92.11
11
11
  platform: ruby
12
12
  authors:
13
13
  - Dirk Kelly
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2010-12-23 00:00:00 +08:00
20
+ date: 2010-12-29 00:00:00 +08:00
21
21
  default_executable:
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency