dato 0.5.0 → 0.5.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 +4 -4
- data/lib/dato/local/field_type/gallery.rb +1 -1
- data/lib/dato/local/field_type/theme.rb +43 -0
- data/lib/dato/local/site.rb +5 -1
- data/lib/dato/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a9b90a79945cd778861e44a0d09bfffad27a606d4f51e448cf3a83c85ef98b5a
|
4
|
+
data.tar.gz: 9dfa1d22880392d377e0fd15d2f72302c7acbc242d58d954ebfe7fa4242e1a26
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 29413d8c200bcc4c648151409d6be67889edb172325fc78e8b9d81d4042eae7c6a880aef623c505a2c697ec727577d393b4cdff861f8f2369ce63ec1cf20485d
|
7
|
+
data.tar.gz: 46b2fb45112a58f7942deeda7143d2493976ae4957f2a6996b75b06c56cdb892a142355da83f09cbed705bacf249f9c7249f2ba652eb64b6199dccfed16bb7b8
|
@@ -0,0 +1,43 @@
|
|
1
|
+
module Dato
|
2
|
+
module Local
|
3
|
+
module FieldType
|
4
|
+
class Theme
|
5
|
+
attr_reader :primary_color, :dark_color, :light_color, :accent_color
|
6
|
+
|
7
|
+
def self.parse(value, repo)
|
8
|
+
value && new(
|
9
|
+
value[:logo],
|
10
|
+
value[:primary_color],
|
11
|
+
value[:dark_color],
|
12
|
+
value[:light_color],
|
13
|
+
value[:accent_color],
|
14
|
+
repo
|
15
|
+
)
|
16
|
+
end
|
17
|
+
|
18
|
+
def initialize(logo, primary_color, dark_color, light_color, accent_color, repo)
|
19
|
+
@logo = logo
|
20
|
+
@primary_color = primary_color
|
21
|
+
@dark_color = dark_color
|
22
|
+
@light_color = light_color
|
23
|
+
@accent_color = accent_color
|
24
|
+
@repo = repo
|
25
|
+
end
|
26
|
+
|
27
|
+
def logo
|
28
|
+
@logo && File.parse(@logo, @repo)
|
29
|
+
end
|
30
|
+
|
31
|
+
def to_hash(*args)
|
32
|
+
{
|
33
|
+
primary_color: primary_color,
|
34
|
+
dark_color: dark_color,
|
35
|
+
light_color: light_color,
|
36
|
+
accent_color: accent_color,
|
37
|
+
logo: logo && logo.to_hash(*args)
|
38
|
+
}
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
data/lib/dato/local/site.rb
CHANGED
@@ -10,7 +10,7 @@ module Dato
|
|
10
10
|
extend Forwardable
|
11
11
|
|
12
12
|
attr_reader :entity
|
13
|
-
def_delegators :entity, :id, :name, :locales, :
|
13
|
+
def_delegators :entity, :id, :name, :locales, :domain,
|
14
14
|
:internal_domain, :no_index, :frontend_url
|
15
15
|
|
16
16
|
def initialize(entity, items_repo)
|
@@ -22,6 +22,10 @@ module Dato
|
|
22
22
|
read_attribute(:global_seo, FieldType::GlobalSeo, locales.size > 1)
|
23
23
|
end
|
24
24
|
|
25
|
+
def theme
|
26
|
+
read_attribute(:theme, FieldType::Theme, false)
|
27
|
+
end
|
28
|
+
|
25
29
|
def favicon
|
26
30
|
read_attribute(:favicon, FieldType::File, false)
|
27
31
|
end
|
data/lib/dato/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dato
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stefano Verna
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-05-
|
11
|
+
date: 2018-05-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -413,6 +413,7 @@ files:
|
|
413
413
|
- lib/dato/local/field_type/slug.rb
|
414
414
|
- lib/dato/local/field_type/string.rb
|
415
415
|
- lib/dato/local/field_type/text.rb
|
416
|
+
- lib/dato/local/field_type/theme.rb
|
416
417
|
- lib/dato/local/field_type/video.rb
|
417
418
|
- lib/dato/local/item.rb
|
418
419
|
- lib/dato/local/items_repo.rb
|