wcc-contentful-app 1.3.2 → 1.4.0.rc2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb8544accdf8bb9c26bcf200d5fdff9b4ae21c1292e6878958bc72d99cf38bb2
|
4
|
+
data.tar.gz: 955a3aaeb9d8bbee66955e29df093637a005fd58886369c2114a7df178cb53a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a7e458f40876b6eb374f7916b55854ead7ff0b619ae741b068a2c3871699ca9f31dc87cbf450a5474bf8f3026baaa109519ff2030ecb49981f6b8abd2cb0386
|
7
|
+
data.tar.gz: 81c39f1053eff4f0144b5a1b536bf1cec297c4c061b7a2eefd789e3d8668654b8dcfa4ce17e0fe883ee1ee8fccfc4fc39e174a2886542ad80aab30eb976762c8
|
@@ -43,6 +43,6 @@ class WCC::Contentful::App::PagesController < ApplicationController
|
|
43
43
|
def global_site_config
|
44
44
|
return unless model = site_config_model
|
45
45
|
|
46
|
-
@global_site_config ||= model.instance(preview
|
46
|
+
@global_site_config ||= model.instance(preview?, locale: I18n.locale)
|
47
47
|
end
|
48
48
|
end
|
@@ -16,14 +16,27 @@ class WCC::Contentful::Model::MenuButton < WCC::Contentful::Model
|
|
16
16
|
return external_link if external_link
|
17
17
|
|
18
18
|
url = (link&.try(:slug) || link&.try(:url))
|
19
|
-
return url unless fragment.present?
|
20
|
-
|
21
19
|
url = URI(url || '')
|
22
|
-
|
20
|
+
|
21
|
+
url = rewrite_to_locale(url, sys.locale) if default_locale && sys.locale != default_locale
|
22
|
+
|
23
|
+
url.fragment = fragment if fragment.present?
|
23
24
|
url.to_s
|
24
25
|
end
|
25
26
|
|
26
27
|
def fragment
|
27
28
|
WCC::Contentful::App::SectionHelper.section_id(section_link) if section_link
|
28
29
|
end
|
30
|
+
|
31
|
+
private
|
32
|
+
|
33
|
+
def default_locale
|
34
|
+
WCC::Contentful.configuration&.default_locale
|
35
|
+
end
|
36
|
+
|
37
|
+
def rewrite_to_locale(uri, locale)
|
38
|
+
uri = URI(uri)
|
39
|
+
uri.path = File.join("/#{locale}", uri.path)
|
40
|
+
uri.to_s
|
41
|
+
end
|
29
42
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
class WCC::Contentful::Model::SiteConfig < WCC::Contentful::Model
|
4
|
-
def self.instance(preview = false) # rubocop:disable Style/OptionalBooleanParameter
|
5
|
-
find_by(foreign_key: 'default', options: { include: 4, preview: preview })
|
4
|
+
def self.instance(preview = false, locale: nil) # rubocop:disable Style/OptionalBooleanParameter
|
5
|
+
find_by(foreign_key: 'default', options: { include: 4, preview: preview, locale: locale })
|
6
6
|
end
|
7
7
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wcc-contentful-app
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0.rc2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Watermark Dev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-04-
|
11
|
+
date: 2023-04-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capybara
|
@@ -338,14 +338,14 @@ dependencies:
|
|
338
338
|
requirements:
|
339
339
|
- - "~>"
|
340
340
|
- !ruby/object:Gem::Version
|
341
|
-
version: 1.
|
341
|
+
version: 1.4.0.rc2
|
342
342
|
type: :runtime
|
343
343
|
prerelease: false
|
344
344
|
version_requirements: !ruby/object:Gem::Requirement
|
345
345
|
requirements:
|
346
346
|
- - "~>"
|
347
347
|
- !ruby/object:Gem::Version
|
348
|
-
version: 1.
|
348
|
+
version: 1.4.0.rc2
|
349
349
|
description: Models, Controllers, and Views common to Watermark Church apps
|
350
350
|
email:
|
351
351
|
- dev@watermark.org
|
@@ -444,7 +444,7 @@ homepage: https://github.com/watermarkchurch/wcc-contentful
|
|
444
444
|
licenses:
|
445
445
|
- MIT
|
446
446
|
metadata:
|
447
|
-
documentation_uri: https://watermarkchurch.github.io/wcc-contentful/1.
|
447
|
+
documentation_uri: https://watermarkchurch.github.io/wcc-contentful/1.4/wcc-contentful-app
|
448
448
|
rubygems_mfa_required: 'true'
|
449
449
|
post_install_message:
|
450
450
|
rdoc_options: []
|
@@ -457,9 +457,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
457
457
|
version: '2.7'
|
458
458
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
459
459
|
requirements:
|
460
|
-
- - "
|
460
|
+
- - ">"
|
461
461
|
- !ruby/object:Gem::Version
|
462
|
-
version:
|
462
|
+
version: 1.3.1
|
463
463
|
requirements: []
|
464
464
|
rubygems_version: 3.3.7
|
465
465
|
signing_key:
|