ecm_cms2 3.0.3 → 4.0.0

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
  SHA1:
3
- metadata.gz: 02c1f90f33a369042aefdddaa0bd122dac5b0f15
4
- data.tar.gz: 08b81416e80b266b5f23a7ac92d8bc268d97e1ad
3
+ metadata.gz: 46b9f659c11704ab0d14daabfae017942ab45c46
4
+ data.tar.gz: 5020a0e1cfd67c407d9dded23e9f3f52acd008a9
5
5
  SHA512:
6
- metadata.gz: 969030c1f190ff7ee2b5fb754da7a3d8cce753e7b461b221dbb9a6878d92328dca21036f3b9d42e65a1cd076c159e90b7182fbe5ff275e289c916a35134caa59
7
- data.tar.gz: ea9db10b4b58c3ba346919590d1347d62d43a948b3dd96d40447580c363938603aadf7bc1f3ba6246a846dc14f679357dadbece5b7450e04c710a9f7e5871784
6
+ metadata.gz: 074baa82b04f3f0a2bd920648fd40754cc8d4fcf76f9ec091ee664f219a1842e7f0fbbca14ddb7a9ffd9ab06cf546a6aa133aadcc0f0eaa5ca055e1f42e5de79
7
+ data.tar.gz: 227f07aa496cca71eb51074a5276bf1bf819b7c49485d4dcf85324af9083c148dcc72ee73c04a19abaaf56109285729301cc4e82c405d75d17aa0457e80ee975
@@ -0,0 +1,2 @@
1
+ Rails.application.config.assets.precompile << 'ecm_cms.js'
2
+ Rails.application.config.assets.precompile << 'ecm_cms.css'
data/config/routes.rb CHANGED
@@ -1,2 +1,6 @@
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
6
  end
@@ -1,7 +1,7 @@
1
1
  module ActionView::Template::Handlers
2
2
  class Textile
3
3
  class_attribute :default_format
4
- self.default_format = Mime::HTML
4
+ self.default_format = Mime[:html]
5
5
 
6
6
  def erb_handler
7
7
  @@erb_handler ||= ActionView::Template.registered_template_handler(:erb)
@@ -10,19 +10,6 @@ module Ecm
10
10
  c.integration_tool :rspec
11
11
  c.performance_tool :rspec
12
12
  end
13
-
14
- initializer :ecm_cms_engine do
15
- ::ActiveAdmin.setup do |config|
16
- config.load_paths += Dir[root.join('app', 'admin')]
17
- config.register_stylesheet 'ecm_cms.css'
18
- config.register_javascript 'ecm_cms.js'
19
- end
20
- end if Gem::Specification.find_all_by_name('activeadmin').any?
21
-
22
- initializer 'ecm_cms.asset_pipeline' do |app|
23
- app.config.assets.precompile << 'ecm_cms.js'
24
- app.config.assets.precompile << 'ecm_cms.css'
25
- end
26
13
  end
27
14
  end
28
15
  end
@@ -1,5 +1,5 @@
1
1
  module Ecm
2
2
  module Cms
3
- VERSION = '3.0.3'
3
+ VERSION = '4.0.0'
4
4
  end
5
5
  end
data/lib/ecm_cms2.rb CHANGED
@@ -10,7 +10,6 @@ require 'simple-navigation-bootstrap'
10
10
 
11
11
  require 'ecm/cms/engine'
12
12
  require 'ecm/cms/configuration'
13
- require 'ecm/cms/routing'
14
13
 
15
14
  require 'ecm/cms/database_template'
16
15
 
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: 3.0.3
4
+ version: 4.0.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-01-31 00:00:00.000000000 Z
11
+ date: 2017-05-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -412,12 +412,6 @@ files:
412
412
  - MIT-LICENSE
413
413
  - README.rdoc
414
414
  - Rakefile
415
- - app/admin/ecm_cms_content_box.rb
416
- - app/admin/ecm_cms_navigation_items.rb
417
- - app/admin/ecm_cms_navigations.rb
418
- - app/admin/ecm_cms_pages.rb
419
- - app/admin/ecm_cms_partials.rb
420
- - app/admin/ecm_cms_templates.rb
421
415
  - app/assets/javascripts/ecm_cms.js.coffee
422
416
  - app/assets/stylesheets/ecm_cms.css.less
423
417
  - app/controllers/ecm/cms/page_controller.rb
@@ -435,6 +429,7 @@ files:
435
429
  - app/services/ecm/cms/create_navigation_service.rb
436
430
  - app/services/ecm/cms/import_partials_service.rb
437
431
  - app/views/ecm/cms/_link_to_top.html.erb
432
+ - config/initializers/assets.rb
438
433
  - config/initializers/mime_types.rb
439
434
  - config/locales/ecm.cms.content_box.de.yml
440
435
  - config/locales/ecm.cms.content_box.en.yml
@@ -477,7 +472,6 @@ files:
477
472
  - lib/ecm/cms/resolvers/ecm/cms/page_resolver.rb
478
473
  - lib/ecm/cms/resolvers/ecm/cms/partial_resolver.rb
479
474
  - lib/ecm/cms/resolvers/ecm/cms/template_resolver.rb
480
- - lib/ecm/cms/routing.rb
481
475
  - lib/ecm/cms/version.rb
482
476
  - lib/ecm_cms2.rb
483
477
  - lib/generators/ecm/cms/install/install_generator.rb
@@ -1,33 +0,0 @@
1
- ActiveAdmin.register Ecm::Cms::ContentBox do
2
- permit_params(:name) if Rails.version >= '4.0.0'
3
-
4
- menu parent: proc { I18n.t('ecm.cms.active_admin.menu') }.call
5
-
6
- index do
7
- selectable_column
8
- column :name
9
- column :created_at
10
- column :updated_at
11
- ActiveAdmin::VERSION[0] < '1' ? default_actions : actions
12
- end
13
-
14
- show do
15
- panel Ecm::Cms::ContentBox.human_attribute_name(:ecm_cms_page_content_blocks) do
16
- table_for ecm_cms_content_box.ecm_cms_page_content_blocks, i18n: Ecm::Cms::Page::ContentBlock do |_content_block|
17
- column :ecm_cms_page
18
- column :body
19
- column :created_at
20
- column :updated_at
21
- end
22
- end
23
- end
24
-
25
- sidebar Ecm::Cms::ContentBox.human_attribute_name(:details), only: :show do
26
- attributes_table_for ecm_cms_content_box do
27
- row :name
28
- row :created_at
29
- row :updated_at
30
- row :ecm_cms_page_content_blocks_count
31
- end
32
- end # sidebar
33
- end if Gem::Specification.find_all_by_name('activeadmin').any?
@@ -1,68 +0,0 @@
1
- ActiveAdmin.register Ecm::Cms::NavigationItem do
2
- permit_params(:depth,
3
- :ecm_cms_navigation_id,
4
- :ecm_cms_page_id,
5
- :id,
6
- :key,
7
- :name,
8
- :options,
9
- :parent_id,
10
- :string,
11
- :url,
12
- *Ecm::Cms::Configuration.navigation_item_properties,
13
- :highlights_on
14
- )
15
-
16
- sortable_tree_member_actions
17
-
18
- # Menu
19
- menu parent: proc { I18n.t('ecm.cms.active_admin.menu') }.call
20
-
21
- form do |f|
22
- f.inputs do
23
- f.input :ecm_cms_navigation, collection: Ecm::Cms::Navigation.all.collect { |navigation| [navigation.to_s, navigation.id] }
24
- f.input :parent
25
- f.input :name
26
- end
27
-
28
- f.inputs do
29
- f.input :ecm_cms_page
30
- f.input :url
31
- end
32
-
33
- f.inputs do
34
- f.input :key
35
- f.input :options
36
- end
37
-
38
- f.inputs Ecm::Cms::NavigationItem.human_attribute_name(:options) do
39
- f.input :highlights_on
40
- end
41
-
42
- f.inputs Ecm::Cms::NavigationItem.human_attribute_name(:li_attributes) do
43
- Ecm::Cms::Configuration.navigation_item_properties.each do |navigation_item_property|
44
- f.input navigation_item_property
45
- end
46
- end
47
-
48
- f.actions
49
- end
50
-
51
- index as: :nested_set do
52
- selectable_column
53
- sortable_tree_columns
54
- column(:ecm_cms_navigation) { |ni| link_to(ni.ecm_cms_navigation.to_s, [:admin, ni.ecm_cms_navigation]) }
55
- sortable_tree_indented_column :name
56
- column :url
57
- column :ecm_cms_page do |ni|
58
- if ni.ecm_cms_page.blank?
59
- link_to(I18n.t('active_admin.new_model', model: Ecm::Cms::Page.model_name.human), new_admin_ecm_cms_page_path(ecm_cms_page: ni.params_for_new_page))
60
- else
61
- link_to(ni.ecm_cms_page.title, [:admin, ni.ecm_cms_page])
62
- end
63
- end
64
- column :created_at
65
- column :updated_at
66
- ActiveAdmin::VERSION[0] < '1' ? default_actions : actions
67
- end
68
- end if Gem::Specification.find_all_by_name('activeadmin').any?
@@ -1,64 +0,0 @@
1
- include ActiveAdmin::AwesomeNestedSet::Helper if Gem::Specification.find_all_by_name('activeadmin').any?
2
-
3
- ActiveAdmin.register Ecm::Cms::Navigation do
4
- permit_params(:locale,
5
- :name,
6
- :slug) if Rails.version >= '4.0.0'
7
-
8
- # Filters
9
- filter :locale, as: :select, collection: I18n.available_locales.map(&:to_s)
10
- filter :name
11
-
12
- # Menu
13
- menu parent: proc { I18n.t('ecm.cms.active_admin.menu') }.call
14
-
15
- form do |f|
16
- f.inputs do
17
- f.input :locale, as: :select, collection: I18n.available_locales.map(&:to_s)
18
- f.input :name
19
- end
20
-
21
- f.actions
22
- end
23
-
24
- index do
25
- selectable_column
26
- column :name
27
- column :locale
28
- ActiveAdmin::VERSION[0] < '1' ? default_actions : actions
29
- end
30
-
31
- show do
32
- panel Ecm::Cms::Navigation.human_attribute_name(:ecm_cms_navigation_items) do
33
- table_for ecm_cms_navigation.ecm_cms_navigation_items, i18n: Ecm::Cms::NavigationItem do
34
- sortable_tree_columns
35
- sortable_tree_indented_column :name
36
- column :url
37
- column :ecm_cms_page do |ni|
38
- if ni.ecm_cms_page.blank?
39
- link_to(I18n.t('active_admin.create_model', model: Ecm::Cms::Page.model_name.human), new_admin_ecm_cms_page_path(ecm_cms_page: ni.params_for_new_page))
40
- else
41
- link_to(ni.ecm_cms_page.title, [:admin, ni.ecm_cms_page])
42
- end
43
- end
44
- column :created_at
45
- column :updated_at
46
-
47
- column do |ni|
48
- link_to(I18n.t('active_admin.view'), [:admin, ni], class: 'member_link view_link') +
49
- link_to(I18n.t('active_admin.edit'), [:edit, :admin, ni], class: 'member_link edit_link')
50
- end
51
- end
52
- end
53
- end
54
-
55
- sidebar Ecm::Cms::Navigation.human_attribute_name(:details), only: :show do
56
- attributes_table_for ecm_cms_navigation do
57
- row :locale
58
- row :name
59
- row :slug
60
- row :created_at
61
- row :updated_at
62
- end
63
- end # sidebar
64
- end if Gem::Specification.find_all_by_name('activeadmin').any?
@@ -1,108 +0,0 @@
1
- ActiveAdmin.register Ecm::Cms::Page do
2
- permit_params(:basename,
3
- :body,
4
- :ecm_cms_folder_id,
5
- :ecm_cms_navigation_item_ids,
6
- :ecm_cms_page_content_blocks_attributes,
7
- :format,
8
- :handler,
9
- :layout,
10
- :locale,
11
- :meta_description,
12
- :pathname,
13
- :title) if Rails.version >= '4.0.0'
14
-
15
- menu parent: proc { I18n.t('ecm.cms.active_admin.menu') }.call
16
-
17
- form do |f|
18
- # f.inputs do
19
- # f.object.errors.inspect
20
- # end
21
-
22
- f.inputs do
23
- f.input :title
24
- f.input :meta_description
25
- f.input :body
26
- end
27
-
28
- f.has_many :ecm_cms_page_content_blocks do |cb|
29
- # cb.inputs do
30
- if cb.object.persisted?
31
- cb.input :_destroy, as: :boolean, label: I18n.t('active_admin.delete')
32
- end
33
-
34
- cb.input :ecm_cms_content_box
35
- cb.input :body
36
- # end
37
- end if Ecm::Cms::ContentBox.count > 0
38
-
39
- f.inputs do
40
- f.input :pathname
41
- f.input :basename
42
- f.input :locale, as: :select, collection: I18n.available_locales.map(&:to_s)
43
- f.input :format, as: :select, collection: Mime::SET.symbols.map(&:to_s)
44
- f.input :handler, as: :select, collection: ActionView::Template::Handlers.extensions.map(&:to_s)
45
- end
46
-
47
- f.inputs do
48
- f.input :layout
49
- end
50
-
51
- I18n.available_locales.each do |locale|
52
- Ecm::Cms::Navigation.where(locale: locale).all.each do |navigation|
53
- f.inputs navigation.to_s do
54
- f.input :ecm_cms_navigation_items,
55
- as: :check_boxes,
56
- collection: navigation.ecm_cms_navigation_items.joins(:ecm_cms_navigation).where(ecm_cms_navigations: { locale: locale }),
57
- label_method: :key # .all.collect { |i| "#{'--' * i.depth} #{i.name}" }
58
- end
59
- end
60
- end
61
-
62
- f.actions
63
- end
64
-
65
- index do
66
- selectable_column
67
- column :pathname
68
- column :filename, sortable: :basename
69
- column :title
70
- column :home_page?
71
- column :layout
72
- column(:ecm_cms_navigation_items) do |page|
73
- output = ''
74
- page.ecm_cms_navigation_items.each do |navigation_item|
75
- output << link_to(navigation_item, [:admin, navigation_item])
76
- end
77
- output.html_safe
78
- end
79
- column :created_at
80
- column :updated_at
81
- ActiveAdmin::VERSION[0] < '1' ? default_actions : actions
82
- end
83
-
84
- show do
85
- panel Ecm::Cms::Page.human_attribute_name(:body) do
86
- pre { ecm_cms_page.body }
87
- end
88
-
89
- ecm_cms_page.ecm_cms_page_content_blocks.each do |content_block|
90
- panel content_block.content_box_name do
91
- pre { content_block.body }
92
- end
93
- end
94
- end
95
-
96
- sidebar Ecm::Cms::Page.human_attribute_name(:details), only: :show do
97
- attributes_table_for ecm_cms_page do
98
- # row :ecm_cms_navigation_item
99
- # row :folder
100
- row :pathname
101
- row :filename
102
- row :home_page?
103
- row :layout
104
- row :created_at
105
- row :updated_at
106
- end
107
- end # sidebar
108
- end if Gem::Specification.find_all_by_name('activeadmin').any?
@@ -1,52 +0,0 @@
1
- ActiveAdmin.register Ecm::Cms::Partial do
2
- permit_params(:basename,
3
- :body,
4
- :ecm_cms_folder_id,
5
- :format,
6
- :handler,
7
- :layout,
8
- :locale,
9
- :pathname) if Rails.version >= '4.0.0'
10
- # Menu
11
- menu parent: proc { I18n.t('ecm.cms.active_admin.menu') }.call
12
-
13
- form do |f|
14
- f.inputs do
15
- f.input :body
16
- end
17
-
18
- f.inputs do
19
- f.input :pathname
20
- f.input :basename
21
- f.input :locale, as: :select, collection: I18n.available_locales.map(&:to_s)
22
- f.input :format, as: :select, collection: Mime::SET.symbols.map(&:to_s)
23
- f.input :handler, as: :select, collection: ActionView::Template::Handlers.extensions.map(&:to_s)
24
- end
25
-
26
- f.actions
27
- end
28
-
29
- index do
30
- selectable_column
31
- column :pathname
32
- column :filename
33
- column :created_at
34
- column :updated_at
35
- ActiveAdmin::VERSION[0] < '1' ? default_actions : actions
36
- end
37
-
38
- show do
39
- panel Ecm::Cms::Partial.human_attribute_name(:body) do
40
- pre { ecm_cms_partial.body }
41
- end
42
- end
43
-
44
- sidebar Ecm::Cms::Partial.human_attribute_name(:details), only: :show do
45
- attributes_table_for ecm_cms_partial do
46
- row :pathname
47
- row :filename
48
- row :created_at
49
- row :updated_at
50
- end
51
- end # sidebar
52
- end if Gem::Specification.find_all_by_name('activeadmin').any?
@@ -1,54 +0,0 @@
1
- ActiveAdmin.register Ecm::Cms::Template do
2
- permit_params(:basename,
3
- :body,
4
- :ecm_cms_folder_id,
5
- :format,
6
- :handler,
7
- :layout,
8
- :locale,
9
- :pathname) if Rails.version >= '4.0.0'
10
-
11
- # Menu
12
- menu parent: proc { I18n.t('ecm.cms.active_admin.menu') }.call
13
-
14
- form do |f|
15
- f.inputs do
16
- f.input :body
17
- end
18
-
19
- f.inputs do
20
- f.input :pathname
21
- f.input :basename
22
- f.input :locale, as: :select, collection: I18n.available_locales.map(&:to_s)
23
- f.input :format, as: :select, collection: Mime::SET.symbols.map(&:to_s)
24
- f.input :handler, as: :select, collection: ActionView::Template::Handlers.extensions.map(&:to_s)
25
- end
26
-
27
- f.actions
28
- end
29
-
30
- index do
31
- selectable_column
32
- column :pathname
33
- column :filename
34
- column :created_at
35
- column :updated_at
36
- ActiveAdmin::VERSION[0] < '1' ? default_actions : actions
37
- end
38
-
39
- show do
40
- panel Ecm::Cms::Template.human_attribute_name(:body) do
41
- pre { ecm_cms_template.body }
42
- end
43
- end
44
-
45
- sidebar Ecm::Cms::Template.human_attribute_name(:details), only: :show do
46
- attributes_table_for ecm_cms_template do
47
- # row :folder
48
- row :pathname
49
- row :filename
50
- row :created_at
51
- row :updated_at
52
- end
53
- end # sidebar
54
- end if Gem::Specification.find_all_by_name('activeadmin').any?
@@ -1,12 +0,0 @@
1
- module Ecm
2
- module Cms
3
- class Routing
4
- def self.routes(router, options = {})
5
- options.reverse_merge!({})
6
-
7
- router.get '/*page', to: 'ecm/cms/page#respond', as: :page
8
- router.get '/' => 'ecm/cms/page#respond', :page => 'home' # , :as => :root
9
- end
10
- end
11
- end
12
- end