blueberry_cms 0.1.1.7 → 0.1.1.8

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: a57056a3ee51993fb7d560df61aab3e9a167a842fa5e2d226327df16aba5a9bf
4
- data.tar.gz: 98efdc9a3fde1da0051405c56276363090f8b3c53d2f2f2d4569faf9af493228
3
+ metadata.gz: bdc854d7f7cf83c642b9ab794e691b177fc22d30480e7768c3ed7a1af551752e
4
+ data.tar.gz: fc45c4f75f56c0a6d9e5c250cdb7b5a3fb6a264007619ea37e6eed4e39116f9f
5
5
  SHA512:
6
- metadata.gz: ab36a01469dc5171c67deb72f73306826a0a55075c2d31e72f4ac50641dd098ef5f5cdd621ec282ff4a090801cf24d08b2ecf6eab453f395a28dee6d7d8b0a13
7
- data.tar.gz: bd9f4eff12dca2b24adb05fc4be27ec159df79730f79b7831c8390b2adfb25fc7f62f8d6fc10d19382be9481c97e5c5b436f3691eb6524c1c073c0285abc30fb
6
+ metadata.gz: 234893a8482ee5a3538e1c0657770508da7a1992ec4d0addd3a5791bafab94ce049a697bbddc0d6961ef56eb4dfe6de87f5f8b16ee443d4ae69d8c29eae9121c
7
+ data.tar.gz: d3ab7e9e6d8c4c764b9aa68cd7b3b783a2e84ffeb00c2d48caa689884aa3203845d107bc9b4154cc852fc8e2171aa44f80f2331f3ec7e03aa9924aac98e5506a
@@ -5,7 +5,7 @@ module BlueberryCMS
5
5
  def to_liquid; @context; end
6
6
  end
7
7
 
8
- around_action :set_locale
8
+ around_action :set_locale, if: -> { BlueberryCMS.force_locale }
9
9
  helper_method :liquid_view_context
10
10
 
11
11
  def show
@@ -56,7 +56,7 @@ module BlueberryCMS
56
56
  end
57
57
 
58
58
  def to_path
59
- "/#{I18n.locale}#{path}"
59
+ BlueberryCMS.force_locale ? "/#{I18n.locale}#{path}" : path
60
60
  end
61
61
 
62
62
  def name_translations=(attributes)
data/config/routes.rb CHANGED
@@ -4,11 +4,15 @@ BlueberryCMS::Engine.routes.draw do
4
4
  resources :menus, except: :show
5
5
  end
6
6
 
7
- scope '/:locale', locale: Regexp.new(I18n.available_locales.join('|')) do
7
+ if BlueberryCMS.force_locale
8
+ scope '/:locale', locale: Regexp.new(I18n.available_locales.join('|')) do
9
+ get '/(*path)', to: 'pages#show', as: :page
10
+ end
11
+
12
+ get '/(*path)', to: 'root#index'
13
+ else
8
14
  get '/(*path)', to: 'pages#show', as: :page
9
15
  end
10
16
 
11
- get '/(*path)', to: 'root#index'
12
-
13
17
  root to: 'root#index'
14
18
  end
@@ -1,3 +1,3 @@
1
1
  module BlueberryCMS
2
- VERSION = '0.1.1.7'.freeze
2
+ VERSION = '0.1.1.8'.freeze
3
3
  end
data/lib/blueberry_cms.rb CHANGED
@@ -3,10 +3,11 @@ require 'blueberry_cms/liquid_tags/page_link'
3
3
  require 'blueberry_cms/liquid_tags/page_url'
4
4
 
5
5
  module BlueberryCMS
6
- mattr_accessor :page_admin_controller, :custom_blocks
6
+ mattr_accessor :page_admin_controller, :custom_blocks, :force_locale
7
7
 
8
8
  @@parent_controller = 'ApplicationController'
9
9
  @@custom_blocks = []
10
+ @@force_locale = true
10
11
 
11
12
  def self.config
12
13
  yield self
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blueberry_cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1.7
4
+ version: 0.1.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Magnusek
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-04-23 00:00:00.000000000 Z
12
+ date: 2019-05-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: carrierwave
@@ -371,7 +371,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
371
371
  - !ruby/object:Gem::Version
372
372
  version: '0'
373
373
  requirements: []
374
- rubygems_version: 3.0.3
374
+ rubygems_version: 3.0.1
375
375
  signing_key:
376
376
  specification_version: 4
377
377
  summary: Summary of BlueberryCMS.