caboose-store 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NTExZjkxMWRiMTRiZWQzYzBmYTJkZWFkOTNjNmQ2N2MxZjRmODgzMw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NjA2MTk2YTBiOWQ5NmY5MTAxNDg4ZGRjNjZhOGNlZDY5ZDhmZmVlZg==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
M2IyZTUxYjlkMWQ0MTBhY2MyYmMzOTU3ODc5ZGM2MTg3ZTAyYjQyNWFlZTRl
|
10
|
+
NTBhNjM5NGJhN2RmMjQ2MzYxYzU2Mjk0NDExNzVlNDA5MzI1NzRkOTUzMTJi
|
11
|
+
MjJmY2NhYmE5ZTY1Y2IwNmZjYjJmZGM4ODczYjdmMDkwNmRkY2E=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YmQ0MzAxYWE5NGNlYzhkYWZiZjZhM2Y4ODRiNDVlY2VhYTgxODZhNTVmYmE0
|
14
|
+
OWJlYTUyMTM2OGY0NmY3OTY0MThhYmNkNTVmMzU0ZTc0YjU1MWFmZTA0YmRh
|
15
|
+
M2NhMGRiMjc2NTMxY2YwOWIxZTRiZjRiYWNjYTZjMzYxOTZkYWI=
|
@@ -7,37 +7,54 @@ module CabooseStore
|
|
7
7
|
@review = Review.new
|
8
8
|
|
9
9
|
if @category.nil?
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
@
|
22
|
-
|
23
|
-
|
24
|
-
all_reviews = Review.where(:product_id => @product.id)
|
25
|
-
score = 0
|
26
|
-
count = 0
|
27
|
-
all_reviews.each do |r|
|
28
|
-
if r.rating && r.rating != 0
|
29
|
-
score += r.rating
|
30
|
-
count += 1
|
31
|
-
end
|
32
|
-
end
|
33
|
-
if count > 0
|
34
|
-
@average = score / count
|
10
|
+
if params[:id].nil? || !Product.exists?(params[:id])
|
11
|
+
|
12
|
+
@gen = Caboose::PageBarGenerator.new(params, {
|
13
|
+
'title_like' => '',
|
14
|
+
'id' => ''
|
15
|
+
},{
|
16
|
+
'model' => 'CabooseStore::Product',
|
17
|
+
'sort' => 'title',
|
18
|
+
'desc' => false,
|
19
|
+
'base_url' => '/admin/products'
|
20
|
+
})
|
21
|
+
@products = @gen.items
|
22
|
+
render 'caboose_store/products/search'
|
23
|
+
|
35
24
|
else
|
36
|
-
|
25
|
+
|
26
|
+
@product = Product.find(params[:id])
|
27
|
+
|
28
|
+
if @product.status == 'Inactive'
|
29
|
+
render 'products/not_available'
|
30
|
+
return
|
31
|
+
end
|
32
|
+
@reviews = Review.where(:product_id => @product.id).limit(10).order("id DESC") || nil
|
33
|
+
@is_logged_in = logged_in?
|
34
|
+
if @is_logged_in
|
35
|
+
#@order.customer_id = logged_in_user.id
|
36
|
+
#@order.save
|
37
|
+
@first_name = logged_in_user.first_name
|
38
|
+
@last_name = logged_in_user.last_name
|
39
|
+
end
|
40
|
+
|
41
|
+
all_reviews = Review.where(:product_id => @product.id)
|
42
|
+
score = 0
|
43
|
+
count = 0
|
44
|
+
all_reviews.each do |r|
|
45
|
+
if r.rating && r.rating != 0
|
46
|
+
score += r.rating
|
47
|
+
count += 1
|
48
|
+
end
|
49
|
+
end
|
50
|
+
if count > 0
|
51
|
+
@average = score / count
|
52
|
+
else
|
53
|
+
@average = 0
|
54
|
+
end
|
55
|
+
|
56
|
+
render 'caboose_store/products/details'
|
37
57
|
end
|
38
|
-
|
39
|
-
# @breadcrumb = p.category.ancestry.collect{|cat| "<li><a href='/products/#{cat.id}'>#{cat.name}</a></li>"}.join("<span class='divider'>/</span>")
|
40
|
-
render 'caboose_store/products/details'
|
41
58
|
end
|
42
59
|
end
|
43
60
|
|
@@ -383,5 +400,38 @@ module CabooseStore
|
|
383
400
|
end
|
384
401
|
render :json => options
|
385
402
|
end
|
403
|
+
|
404
|
+
# GET /admin/products/combine
|
405
|
+
def admin_combine_select_products
|
406
|
+
end
|
407
|
+
|
408
|
+
# GET /admin/products/combine-step2
|
409
|
+
def admin_combine_assign_title
|
410
|
+
|
411
|
+
# POST /admin/products/combine
|
412
|
+
def admin_combine
|
413
|
+
product_ids = params[:product_ids]
|
414
|
+
|
415
|
+
p = Product.new
|
416
|
+
p.title = params[:title]
|
417
|
+
p.description = params[:description]
|
418
|
+
p.option1 = params[:option1]
|
419
|
+
p.option2 = params[:option2]
|
420
|
+
p.option3 = params[:option3]
|
421
|
+
p.default1 = params[:default1]
|
422
|
+
p.default2 = params[:default2]
|
423
|
+
p.default3 = params[:default3]
|
424
|
+
p.status = 'Active'
|
425
|
+
p.save
|
426
|
+
|
427
|
+
|
428
|
+
|
429
|
+
product_ids.each do |pid|
|
430
|
+
p = Product.find(pid)
|
431
|
+
p.variants.each do |v|
|
432
|
+
|
433
|
+
|
434
|
+
end
|
435
|
+
|
386
436
|
end
|
387
437
|
end
|
@@ -3,7 +3,9 @@ module CabooseStore
|
|
3
3
|
self.table_name = "store_product_images"
|
4
4
|
|
5
5
|
belongs_to :product
|
6
|
-
|
6
|
+
has_many :product_image_variants
|
7
|
+
has_many :variants, :through => :product_image_variants
|
8
|
+
|
7
9
|
attr_accessible :id, :title
|
8
10
|
has_attached_file :image,
|
9
11
|
#:path => "#{Rails.root}/public/products/:product_id_:id_:style.:extension",
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: caboose-store
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- William Barry
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-12-
|
11
|
+
date: 2013-12-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: caboose-cms
|