comable-frontend 0.7.0 → 0.7.1

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,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1cbde96aeb5090f711718cc78566a91285c98dfc
4
- data.tar.gz: 78131ce10fd5ad25827102f9b72bee44ddd3cf79
3
+ metadata.gz: 8802cfbbb001caf6110e627f0bc04b141a9953c8
4
+ data.tar.gz: 30435b0231ab79d799b06e9d4c1bc2cf22cdc252
5
5
  SHA512:
6
- metadata.gz: 02e29e1a3fa27c717fe6e87bf5ff7494d2229b252a44453a2c76eee3cdc6593116607bf63871ebf2ac1287203234a867e39acb8553cd5ec276fb480a423b0073
7
- data.tar.gz: 50c4d965d6309a81e7f520b867877c5641c3fd1050ea0b23c685f30fcc426b47efd087271c61381d8d804ec9d83d4dc3ec35d1ed240b2f3e9790004b295d552c
6
+ metadata.gz: b36800b97ab7861bbe77d275c9666e797a11d4c4045ee316c3436390538311bca3369472ba14d663eefe74ca934d36cd31f69c172eeda0f70378f8f2a2350a5e
7
+ data.tar.gz: b5b2224cfd778b9cca7c62de1901bb15d82097234d78d6b13963841be45f2b4b25722803c1cf97453977a2f9e0bed6b6ce1af7000fa69da83119a4294a0f0796
@@ -5,7 +5,8 @@
5
5
  section#comable-product
6
6
  .container
7
7
  .products
8
- = render 'comable/shared/products'
8
+ - cache @products.cache_key do
9
+ = render 'comable/shared/products'
9
10
 
10
11
  section.comable-home-one
11
12
  h2
@@ -14,7 +14,8 @@
14
14
  = listed_categories Comable::Category.roots
15
15
 
16
16
  .products.col-sm-10
17
- = render 'comable/shared/products'
17
+ - cache @products.cache_key do
18
+ = render 'comable/shared/products'
18
19
 
19
20
  .text-center
20
21
  = paginate @products, theme: :comable_frontend
@@ -1,104 +1,105 @@
1
- #comable-product
2
- .row
3
- ol.breadcrumb
4
- - if @product.categories.any?
5
- - @product.categories.first.path.each do |category|
6
- li = link_to category.name, comable.products_path(category_id: category.id)
7
- li.active
8
- = @product.name
1
+ - cache @product.cache_key do
2
+ #comable-product
3
+ .row
4
+ ol.breadcrumb
5
+ - if @product.categories.any?
6
+ - @product.categories.first.path.each do |category|
7
+ li = link_to category.name, comable.products_path(category_id: category.id)
8
+ li.active
9
+ = @product.name
9
10
 
10
- .row
11
- .images.col-sm-6
12
- - if @product.images.any?
13
- .image
14
- = link_to @product.image_url, class: 'thumbnail' do
15
- = image_tag @product.image_url, width: '100%'
16
- .row
17
- - (@product.images - [@product.images.first]).each do |image|
18
- .image.col-sm-4
19
- = link_to image.url, class: 'thumbnail' do
20
- = image_tag image.url, width: '100%'
21
- - else
22
- .thumbnail
23
- .image = image_tag @product.image_url, width: '100%'
11
+ .row
12
+ .images.col-sm-6
13
+ - if @product.images.any?
14
+ .image
15
+ = link_to @product.image_url, class: 'thumbnail' do
16
+ = image_tag @product.image_url, width: '100%'
17
+ .row
18
+ - (@product.images - [@product.images.first]).each do |image|
19
+ .image.col-sm-4
20
+ = link_to image.url, class: 'thumbnail' do
21
+ = image_tag image.url, width: '100%'
22
+ - else
23
+ .thumbnail
24
+ .image = image_tag @product.image_url, width: '100%'
24
25
 
25
- .text.col-sm-6
26
- h1.name
27
- = @product.name
28
- small< = @product.code
29
- .caption
30
- = @product.caption
31
- .price
32
- = number_to_currency @product.price
33
- - if @product.properties.any?(&:present?)
34
- .property
35
- table.table.table-bordered
36
- - @product.properties.each do |property|
37
- tr
38
- td= property['property_key']
39
- td= property['property_value']
26
+ .text.col-sm-6
27
+ h1.name
28
+ = @product.name
29
+ small< = @product.code
30
+ .caption
31
+ = @product.caption
32
+ .price
33
+ = number_to_currency @product.price
34
+ - if @product.properties.any?(&:present?)
35
+ .property
36
+ table.table.table-bordered
37
+ - @product.properties.each do |property|
38
+ tr
39
+ td= property['property_key']
40
+ td= property['property_value']
40
41
 
41
- = form_tag comable.add_cart_path do
42
- - if @product.sku?
43
- - @product.variants.map(&:option_values).flatten.uniq.group_by(&:option_type).each_pair.with_index do |(option_type, option_values), index|
44
- .sku
45
- label for="option_values_#{index}"
46
- = option_type.name
47
- = select_tag "option_values[]", options_for_select(option_values.map { |o| [o.name, o.id] }), id: "option_values_#{index}"
42
+ = form_tag comable.add_cart_path do
43
+ - if @product.sku?
44
+ - @product.variants.map(&:option_values).flatten.uniq.group_by(&:option_type).each_pair.with_index do |(option_type, option_values), index|
45
+ .sku
46
+ label for="option_values_#{index}"
47
+ = option_type.name
48
+ = select_tag "option_values[]", options_for_select(option_values.map { |o| [o.name, o.id] }), id: "option_values_#{index}"
48
49
 
49
- #variant-selector.hidden
50
- = select_tag 'variant_id', options_for_select(@product.variants.map { |v| [v.name, v.id] }), include_blank: true
51
- javascript:
52
- VariantSelector.setProduct(#{@product.to_json.html_safe});
50
+ #variant-selector.hidden
51
+ = select_tag 'variant_id', options_for_select(@product.variants.map { |v| [v.name, v.id] }), include_blank: true
52
+ javascript:
53
+ VariantSelector.setProduct(#{@product.to_json.html_safe});
53
54
 
54
- - if @product.stocked?
55
- .add_cart.form-inline.form-group
56
- = hidden_field_tag :product_id, @product.id
57
- = select_tag :quantity, options_for_select(1.upto(10).to_a)
58
- = submit_tag Comable.t('add_to_cart')
59
- - else
60
- .soldout
61
- = Comable.t('soldout')
55
+ - if @product.stocked?
56
+ .add_cart.form-inline.form-group
57
+ = hidden_field_tag :product_id, @product.id
58
+ = select_tag :quantity, options_for_select(1.upto(10).to_a)
59
+ = submit_tag Comable.t('add_to_cart')
60
+ - else
61
+ .soldout
62
+ = Comable.t('soldout')
62
63
 
63
- - if @product.categories.any?
64
- .row
65
- h2
66
- = Comable.t('browse_related_products')
67
- ul
68
- - @product.categories.each do |category|
69
- li = listed_categories category.path, class: 'category-breadcrumb'
64
+ - if @product.categories.any?
65
+ .row
66
+ h2
67
+ = Comable.t('browse_related_products')
68
+ ul
69
+ - @product.categories.each do |category|
70
+ li = listed_categories category.path, class: 'category-breadcrumb'
70
71
 
71
- #comable-image-dialog
72
- coffee:
73
- jQuery( ->
74
- $('#comable-product .images .image a').click((event) ->
75
- # Disable this event on smartphone
76
- return if $(window).width() <= 768
72
+ #comable-image-dialog
73
+ coffee:
74
+ jQuery( ->
75
+ $('#comable-product .images .image a').click((event) ->
76
+ # Disable this event on smartphone
77
+ return if $(window).width() <= 768
77
78
 
78
- event.preventDefault()
79
+ event.preventDefault()
79
80
 
80
- image = $(this).find('img')[0]
81
- return if image.length == 0
81
+ image = $(this).find('img')[0]
82
+ return if image.length == 0
82
83
 
83
- $('body').addClass('stop-scrolling')
84
+ $('body').addClass('stop-scrolling')
84
85
 
85
- image_clone = $(image).clone().css(width: 'auto', height: 'auto')
86
+ image_clone = $(image).clone().css(width: 'auto', height: 'auto')
86
87
 
87
- $('#comable-image-dialog').html(image_clone).dialog(
88
- modal: true,
89
- resizable: false,
90
- width: $(window).width(),
91
- height: $(window).height(),
92
- dialogClass: 'without-titlebar',
93
- close: -> $('body').removeClass('stop-scrolling')
88
+ $('#comable-image-dialog').html(image_clone).dialog(
89
+ modal: true,
90
+ resizable: false,
91
+ width: $(window).width(),
92
+ height: $(window).height(),
93
+ dialogClass: 'without-titlebar',
94
+ close: -> $('body').removeClass('stop-scrolling')
95
+ )
94
96
  )
95
- )
96
97
 
97
- $('#comable-image-dialog').click( ->
98
- $(this).dialog('close')
99
- );
98
+ $('#comable-image-dialog').click( ->
99
+ $(this).dialog('close')
100
+ );
100
101
 
101
- $(document).on('click', '.ui-widget-overlay', ->
102
- $('#comable-image-dialog').dialog('close')
103
- );
104
- )
102
+ $(document).on('click', '.ui-widget-overlay', ->
103
+ $('#comable-image-dialog').dialog('close')
104
+ );
105
+ )
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: comable-frontend
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - YOSHIDA Hiroki
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-20 00:00:00.000000000 Z
11
+ date: 2015-11-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: comable-core
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.7.0
19
+ version: 0.7.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 0.7.0
26
+ version: 0.7.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rails
29
29
  requirement: !ruby/object:Gem::Requirement