dugway 0.11.3 → 0.12.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/dugway.gemspec +3 -3
- data/lib/dugway/liquid/drops/option_group_drop.rb +24 -0
- data/lib/dugway/liquid/drops/option_group_value_drop.rb +23 -0
- data/lib/dugway/liquid/drops/product_drop.rb +9 -0
- data/lib/dugway/liquid/drops/product_option_drop.rb +5 -0
- data/lib/dugway/liquid/filters/default_pagination.rb +22 -4
- data/lib/dugway/liquid/filters/url_filters.rb +1 -1
- data/lib/dugway/liquid/filters/util_filters.rb +2 -2
- data/lib/dugway/theme.rb +1 -1
- data/lib/dugway/version.rb +1 -1
- metadata +14 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4d4b19083d6ca54cd01c02838818a67437e42b289d41cba01f502b9037d6921e
|
4
|
+
data.tar.gz: 886d1b3a6ed97edd75fd617c17671c196fc048ef3bd5323d0454d05d24f3ffdf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae4ac7698a7287aa79a97b630ec46272f7e81a036b2c45fb1b48398341545eadd412825a2dda85350cf3414fb34a88bb776dd97dc986726f1ff4f5418ee92816
|
7
|
+
data.tar.gz: 4ed1fe5591df26ffbd2cebb3b2d714909490c381d262b69bff1fa1e9593b3cdb63b156ba183a3b4c530cd1d2fe4b5ff588da0f69ae9a67af19605c2687d20729
|
data/README.md
CHANGED
@@ -120,7 +120,7 @@ utilities.
|
|
120
120
|
|
121
121
|
Prefer [LESS](http://lesscss.org)? No problem, you'll just need to create a
|
122
122
|
[Gemfile like this one](https://gist.github.com/mattwigham/5569898) in the
|
123
|
-
root directory of your theme, run
|
123
|
+
root directory of your theme, run `bundle install`, and append the
|
124
124
|
**.less** extension to your CSS files.
|
125
125
|
|
126
126
|
And finally, for you JavaScript folks, we've baked
|
data/dugway.gemspec
CHANGED
@@ -23,10 +23,10 @@ Gem::Specification.new do |s|
|
|
23
23
|
s.add_dependency('rack-mount', '~> 0.8.3')
|
24
24
|
s.add_dependency('activesupport', '~> 5.2')
|
25
25
|
s.add_dependency('liquid', '~> 3.0.6')
|
26
|
-
s.add_dependency('coffee-script', '~> 2.
|
26
|
+
s.add_dependency('coffee-script', '~> 2.4.1')
|
27
27
|
s.add_dependency('sass', '~> 3.2.5')
|
28
28
|
s.add_dependency('sprockets', '~> 2.0')
|
29
|
-
s.add_dependency('sprockets-sass', '~>
|
29
|
+
s.add_dependency('sprockets-sass', '~> 1.3.1')
|
30
30
|
s.add_dependency('compass', '~> 0.12.2')
|
31
31
|
s.add_dependency('httparty', '~> 0.10.0')
|
32
32
|
s.add_dependency('better_errors', '~> 0.9.0')
|
@@ -35,7 +35,7 @@ Gem::Specification.new do |s|
|
|
35
35
|
s.add_dependency('htmlentities', '~> 4.3.1')
|
36
36
|
s.add_dependency('thor', '~> 0.20.3')
|
37
37
|
s.add_dependency('rubyzip', '~> 0.9.9')
|
38
|
-
s.add_dependency('uglifier', '~> 1
|
38
|
+
s.add_dependency('uglifier', '~> 4.1')
|
39
39
|
s.add_dependency('thin', '~> 1.7.2')
|
40
40
|
s.add_dependency('bigcartel-theme-fonts')
|
41
41
|
s.add_dependency('bigcartel-currency-locales')
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Dugway
|
2
|
+
module Drops
|
3
|
+
class OptionGroupDrop < BaseDrop
|
4
|
+
|
5
|
+
def id
|
6
|
+
source['id']
|
7
|
+
end
|
8
|
+
|
9
|
+
def name
|
10
|
+
source['name']
|
11
|
+
end
|
12
|
+
|
13
|
+
def position
|
14
|
+
source['position']
|
15
|
+
end
|
16
|
+
|
17
|
+
def values
|
18
|
+
@values ||= source['values'].present? ?
|
19
|
+
source['values'].map { |value| OptionGroupValueDrop.new(value) } : []
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module Dugway
|
2
|
+
module Drops
|
3
|
+
class OptionGroupValueDrop < BaseDrop
|
4
|
+
|
5
|
+
def id
|
6
|
+
source['id']
|
7
|
+
end
|
8
|
+
|
9
|
+
def name
|
10
|
+
source['name']
|
11
|
+
end
|
12
|
+
|
13
|
+
def position
|
14
|
+
source['position']
|
15
|
+
end
|
16
|
+
|
17
|
+
def option_group_id
|
18
|
+
source['option_group_id']
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -37,6 +37,15 @@ module Dugway
|
|
37
37
|
@options_in_stock ||= options.reject { |o| o.sold_out }
|
38
38
|
end
|
39
39
|
|
40
|
+
def has_option_groups
|
41
|
+
source['has_option_groups']
|
42
|
+
end
|
43
|
+
|
44
|
+
def option_groups
|
45
|
+
@option_groups ||= source['option_groups'].present? ?
|
46
|
+
source['option_groups'].map { |group| OptionGroupDrop.new(group) } : []
|
47
|
+
end
|
48
|
+
|
40
49
|
def shipping
|
41
50
|
@shipping ||= source['shipping'].present? ? source['shipping'].map { |o| ShippingOptionDrop.new(o.update('product' => self)) } : []
|
42
51
|
end
|
@@ -22,6 +22,11 @@ module Dugway
|
|
22
22
|
def inventory
|
23
23
|
((quantity.to_f / (quantity + sold).to_f) * 100).round
|
24
24
|
end
|
25
|
+
|
26
|
+
def option_group_values
|
27
|
+
@option_group_values ||= source['option_group_values'].present? ?
|
28
|
+
source['option_group_values'].map { |value| OptionGroupValueDrop.new(value) } : []
|
29
|
+
end
|
25
30
|
end
|
26
31
|
end
|
27
32
|
end
|
@@ -7,22 +7,22 @@ module Dugway
|
|
7
7
|
|
8
8
|
prev_label = prev_label.blank? ? paginate['previous']['title'] : prev_label
|
9
9
|
if paginate['previous']['is_link']
|
10
|
-
html << %(<a class="previous" href="#{ paginate['previous']['url'] }">#{ prev_label }</a>)
|
10
|
+
html << %(<a class="previous" href="#{ paginate['previous']['url'] }" aria-label="Go to previous page">#{ prev_label }</a>)
|
11
11
|
else
|
12
12
|
html << %(<span class="previous disabled">#{ prev_label }</span>)
|
13
13
|
end
|
14
14
|
|
15
15
|
paginate['parts'].each do |part|
|
16
16
|
if part['is_link']
|
17
|
-
html << %(<a href="#{ part['url'] }">#{ part['title'] }</a>)
|
17
|
+
html << %(<a href="#{ part['url'] }" aria-label="Go to page #{part['title']}">#{ part['title'] }</a>)
|
18
18
|
else
|
19
|
-
html <<
|
19
|
+
html << build_non_link_span(part, paginate)
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
23
|
next_label = next_label.blank? ? paginate['next']['title'] : next_label
|
24
24
|
if paginate['next']['is_link']
|
25
|
-
html << %(<a class="next" href="#{ paginate['next']['url'] }">#{ next_label }</a>)
|
25
|
+
html << %(<a class="next" href="#{ paginate['next']['url'] }" aria-label="Go to next page">#{ next_label }</a>)
|
26
26
|
else
|
27
27
|
html << %(<span class="next disabled">#{ next_label }</span>)
|
28
28
|
end
|
@@ -30,6 +30,24 @@ module Dugway
|
|
30
30
|
html << %(</div>)
|
31
31
|
}.join(' ')
|
32
32
|
end
|
33
|
+
|
34
|
+
private
|
35
|
+
|
36
|
+
def build_non_link_span(part, paginate)
|
37
|
+
is_current = is_current_page?(part, paginate)
|
38
|
+
span_class = is_current ? 'current' : 'gap'
|
39
|
+
|
40
|
+
span = %(<span )
|
41
|
+
span << %(class="#{span_class}" )
|
42
|
+
span << %(aria-label="Current page, page #{part['title']}") if is_current
|
43
|
+
span << %(>)
|
44
|
+
span << %(#{ part['title'] }</span>)
|
45
|
+
span
|
46
|
+
end
|
47
|
+
|
48
|
+
def is_current_page?(part, paginate)
|
49
|
+
part['title'] == paginate['current_page'].to_s
|
50
|
+
end
|
33
51
|
end
|
34
52
|
end
|
35
53
|
end
|
@@ -86,13 +86,13 @@ module Dugway
|
|
86
86
|
digits, rounded_number = 1, 0
|
87
87
|
else
|
88
88
|
digits = (Math.log10(number.abs) + 1).floor
|
89
|
-
rounded_number = (BigDecimal
|
89
|
+
rounded_number = (BigDecimal(number.to_s) / BigDecimal((10 ** (digits - precision)).to_f.to_s)).round.to_f * 10 ** (digits - precision)
|
90
90
|
digits = (Math.log10(rounded_number.abs) + 1).floor # After rounding, the number of digits may have changed
|
91
91
|
end
|
92
92
|
precision -= digits
|
93
93
|
precision = precision > 0 ? precision : 0 #don't let it be negative
|
94
94
|
else
|
95
|
-
rounded_number = BigDecimal
|
95
|
+
rounded_number = BigDecimal(number.to_s).round(precision).to_f
|
96
96
|
end
|
97
97
|
formatted_number = number_with_delimiter("%01.#{precision}f" % rounded_number, options)
|
98
98
|
if strip_insignificant_zeros
|
data/lib/dugway/theme.rb
CHANGED
data/lib/dugway/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dugway
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.12.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Big Cartel
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-09-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -86,14 +86,14 @@ dependencies:
|
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: 2.
|
89
|
+
version: 2.4.1
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: 2.
|
96
|
+
version: 2.4.1
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: sass
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -128,14 +128,14 @@ dependencies:
|
|
128
128
|
requirements:
|
129
129
|
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version:
|
131
|
+
version: 1.3.1
|
132
132
|
type: :runtime
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version:
|
138
|
+
version: 1.3.1
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: compass
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
@@ -254,14 +254,14 @@ dependencies:
|
|
254
254
|
requirements:
|
255
255
|
- - "~>"
|
256
256
|
- !ruby/object:Gem::Version
|
257
|
-
version: 1
|
257
|
+
version: '4.1'
|
258
258
|
type: :runtime
|
259
259
|
prerelease: false
|
260
260
|
version_requirements: !ruby/object:Gem::Requirement
|
261
261
|
requirements:
|
262
262
|
- - "~>"
|
263
263
|
- !ruby/object:Gem::Version
|
264
|
-
version: 1
|
264
|
+
version: '4.1'
|
265
265
|
- !ruby/object:Gem::Dependency
|
266
266
|
name: thin
|
267
267
|
requirement: !ruby/object:Gem::Requirement
|
@@ -452,6 +452,8 @@ files:
|
|
452
452
|
- lib/dugway/liquid/drops/country_drop.rb
|
453
453
|
- lib/dugway/liquid/drops/currency_drop.rb
|
454
454
|
- lib/dugway/liquid/drops/image_drop.rb
|
455
|
+
- lib/dugway/liquid/drops/option_group_drop.rb
|
456
|
+
- lib/dugway/liquid/drops/option_group_value_drop.rb
|
455
457
|
- lib/dugway/liquid/drops/page_drop.rb
|
456
458
|
- lib/dugway/liquid/drops/pages_drop.rb
|
457
459
|
- lib/dugway/liquid/drops/product_drop.rb
|
@@ -543,7 +545,7 @@ homepage: https://github.com/bigcartel/dugway
|
|
543
545
|
licenses:
|
544
546
|
- MIT
|
545
547
|
metadata: {}
|
546
|
-
post_install_message:
|
548
|
+
post_install_message:
|
547
549
|
rdoc_options: []
|
548
550
|
require_paths:
|
549
551
|
- lib
|
@@ -558,9 +560,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
558
560
|
- !ruby/object:Gem::Version
|
559
561
|
version: '0'
|
560
562
|
requirements: []
|
561
|
-
|
562
|
-
|
563
|
-
signing_key:
|
563
|
+
rubygems_version: 3.0.6
|
564
|
+
signing_key:
|
564
565
|
specification_version: 4
|
565
566
|
summary: Easily build and test Big Cartel themes.
|
566
567
|
test_files:
|