comable-frontend 0.7.0 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/views/comable/home/show.slim +2 -1
- data/app/views/comable/products/index.slim +2 -1
- data/app/views/comable/products/show.slim +90 -89
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8802cfbbb001caf6110e627f0bc04b141a9953c8
|
4
|
+
data.tar.gz: 30435b0231ab79d799b06e9d4c1bc2cf22cdc252
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b36800b97ab7861bbe77d275c9666e797a11d4c4045ee316c3436390538311bca3369472ba14d663eefe74ca934d36cd31f69c172eeda0f70378f8f2a2350a5e
|
7
|
+
data.tar.gz: b5b2224cfd778b9cca7c62de1901bb15d82097234d78d6b13963841be45f2b4b25722803c1cf97453977a2f9e0bed6b6ce1af7000fa69da83119a4294a0f0796
|
@@ -1,104 +1,105 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
- @product.categories.
|
6
|
-
|
7
|
-
|
8
|
-
|
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
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
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
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
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
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
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
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
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
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
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
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
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
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
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
|
-
|
79
|
+
event.preventDefault()
|
79
80
|
|
80
|
-
|
81
|
-
|
81
|
+
image = $(this).find('img')[0]
|
82
|
+
return if image.length == 0
|
82
83
|
|
83
|
-
|
84
|
+
$('body').addClass('stop-scrolling')
|
84
85
|
|
85
|
-
|
86
|
+
image_clone = $(image).clone().css(width: 'auto', height: 'auto')
|
86
87
|
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
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
|
-
|
98
|
-
|
99
|
-
|
98
|
+
$('#comable-image-dialog').click( ->
|
99
|
+
$(this).dialog('close')
|
100
|
+
);
|
100
101
|
|
101
|
-
|
102
|
-
|
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.
|
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-
|
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.
|
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.
|
26
|
+
version: 0.7.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rails
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|