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 +1 -1
- data/app/controllers/admin/shop/categories_controller.rb +1 -1
- data/app/controllers/admin/shop/products_controller.rb +1 -1
- data/app/models/shop_category.rb +4 -1
- data/app/models/shop_product.rb +3 -0
- data/lib/shop/tags/category.rb +6 -6
- data/lib/shop/tags/product.rb +2 -2
- data/radiant-shop-extension.gemspec +2 -2
- metadata +4 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.92.
|
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
|
data/app/models/shop_category.rb
CHANGED
@@ -16,9 +16,12 @@ class ShopCategory < ActiveRecord::Base
|
|
16
16
|
|
17
17
|
validates_presence_of :page
|
18
18
|
|
19
|
-
# Returns the title of the
|
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
|
|
data/app/models/shop_product.rb
CHANGED
@@ -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
|
|
data/lib/shop/tags/category.rb
CHANGED
@@ -42,13 +42,13 @@ module Shop
|
|
42
42
|
|
43
43
|
tag 'shop:category:if_current' do |tag|
|
44
44
|
|
45
|
-
if tag.
|
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.
|
49
|
+
elsif tag.globals.page.shop_product.present?
|
50
50
|
# A product page
|
51
|
-
if tag.
|
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.
|
61
|
+
if tag.globals.page.shop_product.present?
|
62
62
|
# A product page
|
63
|
-
if tag.
|
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.
|
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
|
|
data/lib/shop/tags/product.rb
CHANGED
@@ -44,13 +44,13 @@ module Shop
|
|
44
44
|
end
|
45
45
|
|
46
46
|
tag 'shop:product:if_current' do |tag|
|
47
|
-
if tag.
|
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.
|
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.
|
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-
|
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:
|
4
|
+
hash: 377
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 92
|
9
|
-
-
|
10
|
-
version: 0.92.
|
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-
|
20
|
+
date: 2010-12-29 00:00:00 +08:00
|
21
21
|
default_executable:
|
22
22
|
dependencies:
|
23
23
|
- !ruby/object:Gem::Dependency
|