ecm_cms2 4.0.1 → 4.1.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c56ccfd4bc2c5f592c9dfbef3035f4783e2d03cb
4
- data.tar.gz: 924b2062768486b49156e4220e2311f71f2189c2
3
+ metadata.gz: 7ac26df362ecb4937b1ed4a96fd74dc5cdb0bc60
4
+ data.tar.gz: c3670a31714b6909d84b894fa0827305920ebc4d
5
5
  SHA512:
6
- metadata.gz: 3d5d877b1efab50e30edd1e2ef67b31a2a9408bcd03f1fe00db7b5a71ecabf17e737d83fc7a597e129bf367c87de7d21be79b9379f5d006b4e473a3755a34d37
7
- data.tar.gz: e9f328c183e4a75da1b41de5359980b9b0e485535d5aa3c39af471b98f17e658e31f8b5284843174d40eb6150828db75bcbbf15a2524935900e99b48b63a59cd
6
+ metadata.gz: f63725acae17b34ed135e14708fe7dd7ecdadc5073737b1aa61fa81c017b0b86973135764d41be3d24dc2983e189c7ca94d193539cbb052e35fcfcc1da3e6c77
7
+ data.tar.gz: 9d6f630599a5ab258ec270018249c560a92c6408f1966336693cda16f831e514b8ea116563a7fc8bd2c1e57435ab784945eea412548c9556310645a8f24d5556
@@ -5,15 +5,19 @@ class Ecm::Cms::PageController < Ecm::Cms::Configuration.base_controller.constan
5
5
 
6
6
  # avoid error 500 on missing template
7
7
  rescue_from ActionView::MissingTemplate do
8
- respond_to do |format|
9
- format.html do
10
- render(file: "#{Rails.root}/public/404", formats: [:html],
11
- layout: false,
12
- status: 404
13
- )
8
+ if params[:page] == 'home'
9
+ render_fallback_page
10
+ else
11
+ respond_to do |format|
12
+ format.html do
13
+ render(file: "#{Rails.root}/public/404", formats: [:html],
14
+ layout: false,
15
+ status: 404
16
+ )
17
+ end
18
+ format.xml { head :not_found }
19
+ format.any { head :not_found }
14
20
  end
15
- format.xml { head :not_found }
16
- format.any { head :not_found }
17
21
  end
18
22
  end
19
23
 
@@ -27,4 +31,13 @@ class Ecm::Cms::PageController < Ecm::Cms::Configuration.base_controller.constan
27
31
  end if Gem::Specification.find_all_by_name('wicked_pdf').any?
28
32
  end
29
33
  end
34
+
35
+ private
36
+
37
+ def render_fallback_page
38
+ respond_to do |format|
39
+ format.html { render :fallback }
40
+ format.txt { render :fallback }
41
+ end
42
+ end
30
43
  end
@@ -10,7 +10,8 @@ module Ecm::Cms
10
10
  foreign_key: 'ecm_cms_navigation_id'
11
11
  belongs_to :ecm_cms_page,
12
12
  class_name: 'Ecm::Cms::Page',
13
- foreign_key: 'ecm_cms_page_id'
13
+ foreign_key: 'ecm_cms_page_id',
14
+ optional: true
14
15
 
15
16
  # awesome nested set
16
17
  acts_as_nested_set dependent: :destroy, counter_cache: :children_count, scope: :ecm_cms_navigation_id
@@ -5,7 +5,8 @@ class Ecm::Cms::Template < ActiveRecord::Base
5
5
  # associations
6
6
  belongs_to :ecm_cms_folder,
7
7
  class_name: 'Ecm::Cms::Folder',
8
- foreign_key: 'ecm_cms_folder_id'
8
+ foreign_key: 'ecm_cms_folder_id',
9
+ optional: true
9
10
 
10
11
  # callbacks
11
12
  before_validation :ensure_basename_starts_without_underscore, if: proc { |t| t.basename.present? }
@@ -0,0 +1 @@
1
+ <h1>Fallback</h1>
@@ -0,0 +1 @@
1
+ Fallback
@@ -1,6 +1,4 @@
1
1
  Ecm::Cms::Engine.routes.draw do
2
- localized do
3
- get '/*page', to: 'page#respond', as: :page
4
- get '/', to: 'page#respond', page: 'home'
5
- end
2
+ get '/*page', to: 'page#respond', as: :page
3
+ get '/', to: 'page#respond', page: 'home'
6
4
  end
@@ -1,4 +1,4 @@
1
- class CreateEcmCmsFolders < ActiveRecord::Migration
1
+ class CreateEcmCmsFolders < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :ecm_cms_folders do |t|
4
4
  t.string :basename
@@ -1,4 +1,4 @@
1
- class CreateEcmCmsPages < ActiveRecord::Migration
1
+ class CreateEcmCmsPages < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :ecm_cms_pages do |t|
4
4
  t.string :basename
@@ -1,4 +1,4 @@
1
- class CreateEcmCmsTemplates < ActiveRecord::Migration
1
+ class CreateEcmCmsTemplates < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :ecm_cms_templates do |t|
4
4
  t.string :basename
@@ -1,4 +1,4 @@
1
- class CreateEcmCmsPartials < ActiveRecord::Migration
1
+ class CreateEcmCmsPartials < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :ecm_cms_partials do |t|
4
4
  t.string :basename
@@ -1,4 +1,4 @@
1
- class CreateEcmCmsNavigations < ActiveRecord::Migration
1
+ class CreateEcmCmsNavigations < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :ecm_cms_navigations do |t|
4
4
  t.string :locale
@@ -1,4 +1,4 @@
1
- class CreateEcmCmsNavigationItems < ActiveRecord::Migration
1
+ class CreateEcmCmsNavigationItems < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :ecm_cms_navigation_items do |t|
4
4
  t.string :name
@@ -1,4 +1,4 @@
1
- class CreateEcmCmsContentBoxes < ActiveRecord::Migration
1
+ class CreateEcmCmsContentBoxes < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :ecm_cms_content_boxes do |t|
4
4
  t.string :name
@@ -1,4 +1,4 @@
1
- class CreateEcmCmsPageContentBlocks < ActiveRecord::Migration
1
+ class CreateEcmCmsPageContentBlocks < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :ecm_cms_page_content_blocks do |t|
4
4
  t.text :body
@@ -7,7 +7,8 @@ module Ecm
7
7
  # associations
8
8
  base.belongs_to :ecm_cms_folder,
9
9
  class_name: 'Ecm::Cms::Folder',
10
- foreign_key: 'ecm_cms_folder_id'
10
+ foreign_key: 'ecm_cms_folder_id',
11
+ optional: true
11
12
 
12
13
  # callbacks
13
14
  base.after_initialize :set_defaults
@@ -1,5 +1,5 @@
1
1
  module Ecm
2
2
  module Cms
3
- VERSION = '4.0.1'
3
+ VERSION = '4.1.0'
4
4
  end
5
5
  end
@@ -2,7 +2,7 @@ module Ecm
2
2
  module Cms
3
3
  module Generators
4
4
  class InstallGenerator < Rails::Generators::Base
5
- desc 'Generates the intializer'
5
+ desc 'Generates the initializer'
6
6
 
7
7
  source_root File.expand_path('../templates', __FILE__)
8
8
 
@@ -1,5 +1,6 @@
1
1
  FactoryGirl.define do
2
2
  factory :ecm_cms_navigation, class: Ecm::Cms::Navigation do
3
3
  sequence(:name) { |i| "Navigation ##{i}" }
4
+ locale I18n.locale
4
5
  end
5
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ecm_cms2
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.1
4
+ version: 4.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roberto Vasquez Angel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-07 00:00:00.000000000 Z
11
+ date: 2017-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -429,6 +429,8 @@ files:
429
429
  - app/services/ecm/cms/create_navigation_service.rb
430
430
  - app/services/ecm/cms/import_partials_service.rb
431
431
  - app/views/ecm/cms/_link_to_top.html.erb
432
+ - app/views/ecm/cms/page/fallback.html
433
+ - app/views/ecm/cms/page/fallback.txt
432
434
  - config/initializers/assets.rb
433
435
  - config/initializers/mime_types.rb
434
436
  - config/locales/ecm.cms.content_box.de.yml
@@ -507,9 +509,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
507
509
  version: '0'
508
510
  requirements: []
509
511
  rubyforge_project:
510
- rubygems_version: 2.4.8
512
+ rubygems_version: 2.6.11
511
513
  signing_key:
512
514
  specification_version: 4
513
515
  summary: CMS base module for ruby on rails.
514
516
  test_files: []
515
- has_rdoc: