cmor_cms_backend 0.0.54.pre → 0.0.59.pre

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: a2d31760248d535a02c55db5f954dbbeb6c96b8ccb0a23029a0d85a10949b745
4
- data.tar.gz: 87f80ba4ccd1e9d2c18fe975a1445bf89583e9fcaa71abc20101d92f08c09cf5
3
+ metadata.gz: c3098c1927d082d3d5aea6a85f24225e217d8c2698970b5b97be935d669f49e5
4
+ data.tar.gz: f1c81e8c9e4c6562675195ad733cbedf8d6e839760cab0b8a0c85c66457e4c11
5
5
  SHA512:
6
- metadata.gz: ffe0fefae0cfd822e2c60482b3ac2712c8a732371116ecce9a5748456b59ed14068282cdcc51fc43ebbb6cfc170df007708af198cf8cb3b19daab332cb2055ed
7
- data.tar.gz: 3d4d2ecbee2df0b818f8af0655ae545711a44d7df394414e754f0730434f8a6fa95583aeb9438dc6d648816406acfd6c9bdeb826dfff3a1b7030d3df2131b12b
6
+ metadata.gz: 447029f2a557042c65f2df9bec34d6ebf5cc342a334c9a9ed31d2914c9081744ff27eb70d97bf7063199b59662220600e3493a9148e42582fe339f93a12173c3
7
+ data.tar.gz: 5c3861cd865958fbb1be9ee96e908e51e761ffc6e575814094d81c98626c5c3bb417da8e477b5a02fbe8eaa5cc6c7363470cd168156aa443b42849d5ee131ce8
@@ -1,8 +1,19 @@
1
1
  class Cmor::Cms::Backend::ContentBoxesController < Cmor::Core::Backend::ResourcesController::Base
2
+ include Cmor::Transports::ResourcesController::ExportConcern if Cmor::Core.features?(:cmor_transports)
3
+ include Cmor::Audits::ResourcesController::PaperTrailConcern if Cmor::Core.features?(:cmor_audits)
4
+
2
5
  def self.resource_class
3
6
  Cmor::Cms::ContentBox
4
7
  end
5
8
 
9
+ def self.has_paper_trail?
10
+ Object.const_defined?('PaperTrail') && PaperTrail.request.enabled_for_model?(resource_class)
11
+ end
12
+
13
+ def self.available_rest_actions
14
+ super + [:export, (has_paper_trail? ? :versions : nil)].compact
15
+ end
16
+
6
17
  private
7
18
 
8
19
  def permitted_params
@@ -2,12 +2,22 @@ module Cmor
2
2
  module Cms
3
3
  module Backend
4
4
  class LayoutsController < Cmor::Core::Backend::ResourcesController::Base
5
+ include Cmor::Transports::ResourcesController::ExportConcern if Cmor::Core.features?(:cmor_transports)
6
+ include Cmor::Audits::ResourcesController::PaperTrailConcern if Cmor::Core.features?(:cmor_audits)
5
7
  include Rao::ResourcesController::ActsAsPublishedConcern
6
8
 
7
9
  def self.resource_class
8
10
  Cmor::Cms::Layout
9
11
  end
10
12
 
13
+ def self.has_paper_trail?
14
+ Object.const_defined?('PaperTrail') && PaperTrail.request.enabled_for_model?(resource_class)
15
+ end
16
+
17
+ def self.available_rest_actions
18
+ super + [:export, (has_paper_trail? ? :versions : nil)].compact
19
+ end
20
+
11
21
  private
12
22
 
13
23
  def permitted_params
@@ -4,11 +4,21 @@ module Cmor
4
4
  class NavigationItemsController < Cmor::Core::Backend::ResourcesController::Base
5
5
  include Rao::ResourcesController::AwesomeNestedSetConcern
6
6
  include Rao::ResourcesController::ActsAsPublishedConcern
7
+ include Cmor::Transports::ResourcesController::ExportConcern if Cmor::Core.features?(:cmor_transports)
8
+ include Cmor::Audits::ResourcesController::PaperTrailConcern if Cmor::Core.features?(:cmor_audits)
7
9
 
8
10
  def self.resource_class
9
11
  Cmor::Cms::NavigationItem
10
12
  end
11
13
 
14
+ def self.has_paper_trail?
15
+ Object.const_defined?('PaperTrail') && PaperTrail.request.enabled_for_model?(resource_class)
16
+ end
17
+
18
+ def self.available_rest_actions
19
+ super + [:export, (has_paper_trail? ? :versions : nil)].compact
20
+ end
21
+
12
22
  private
13
23
 
14
24
  def load_collection_scope
@@ -1,8 +1,19 @@
1
1
  class Cmor::Cms::Backend::NavigationsController < Cmor::Core::Backend::ResourcesController::Base
2
+ include Cmor::Transports::ResourcesController::ExportConcern if Cmor::Core.features?(:cmor_transports)
3
+ include Cmor::Audits::ResourcesController::PaperTrailConcern if Cmor::Core.features?(:cmor_audits)
4
+
2
5
  def self.resource_class
3
6
  Cmor::Cms::Navigation
4
7
  end
5
8
 
9
+ def self.has_paper_trail?
10
+ Object.const_defined?('PaperTrail') && PaperTrail.request.enabled_for_model?(resource_class)
11
+ end
12
+
13
+ def self.available_rest_actions
14
+ super + [:export, (has_paper_trail? ? :versions : nil)].compact
15
+ end
16
+
6
17
  private
7
18
 
8
19
  def permitted_params
@@ -3,11 +3,21 @@ module Cmor
3
3
  module Backend
4
4
  class PagesController < Cmor::Core::Backend::ResourcesController::Base
5
5
  include Rao::ResourcesController::ActsAsPublishedConcern
6
+ include Cmor::Transports::ResourcesController::ExportConcern if Cmor::Core.features?(:cmor_transports)
7
+ include Cmor::Audits::ResourcesController::PaperTrailConcern if Cmor::Core.features?(:cmor_audits)
6
8
 
7
9
  def self.resource_class
8
10
  Cmor::Cms::Page
9
11
  end
10
12
 
13
+ def self.has_paper_trail?
14
+ Object.const_defined?('PaperTrail') && PaperTrail.request.enabled_for_model?(resource_class)
15
+ end
16
+
17
+ def self.available_rest_actions
18
+ super + [:export, (has_paper_trail? ? :versions : nil)].compact
19
+ end
20
+
11
21
  private
12
22
 
13
23
  def permitted_params
@@ -3,11 +3,22 @@ module Cmor
3
3
  module Backend
4
4
  class PartialsController < Cmor::Core::Backend::ResourcesController::Base
5
5
  include Rao::ResourcesController::ActsAsPublishedConcern
6
+ include Cmor::Transports::ResourcesController::ExportConcern if Cmor::Core.features?(:cmor_transports)
7
+ include Cmor::Audits::ResourcesController::PaperTrailConcern if Cmor::Core.features?(:cmor_audits)
6
8
 
7
9
  def self.resource_class
8
10
  Cmor::Cms::Partial
9
11
  end
10
12
 
13
+ def self.has_paper_trail?
14
+ Object.const_defined?('PaperTrail') && PaperTrail.request.enabled_for_model?(resource_class)
15
+ end
16
+
17
+ def self.available_rest_actions
18
+ super + [:export, (has_paper_trail? ? :versions : nil)].compact
19
+ end
20
+
21
+
11
22
  private
12
23
 
13
24
  def permitted_params
@@ -0,0 +1,30 @@
1
+ module Cmor
2
+ module Cms
3
+ module Backend
4
+ class RedirectsController < Cmor::Core::Backend::ResourcesController::Base
5
+ include Rao::ResourcesController::ActsAsPublishedConcern
6
+ include Cmor::Transports::ResourcesController::ExportConcern if Cmor::Core.features?(:cmor_transports)
7
+ include Cmor::Audits::ResourcesController::PaperTrailConcern if Cmor::Core.features?(:cmor_audits)
8
+
9
+ def self.resource_class
10
+ Cmor::Cms::Redirect
11
+ end
12
+
13
+ def self.has_paper_trail?
14
+ Object.const_defined?('PaperTrail') && PaperTrail.request.enabled_for_model?(resource_class)
15
+ end
16
+
17
+ def self.available_rest_actions
18
+ super + [:export, (has_paper_trail? ? :versions : nil)].compact
19
+ end
20
+
21
+ private
22
+
23
+ def permitted_params
24
+ params.require(:redirect)
25
+ .permit(:source, :target, :published)
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
@@ -3,11 +3,21 @@ module Cmor
3
3
  module Backend
4
4
  class TemplatesController < Cmor::Core::Backend::ResourcesController::Base
5
5
  include Rao::ResourcesController::ActsAsPublishedConcern
6
+ include Cmor::Transports::ResourcesController::ExportConcern if Cmor::Core.features?(:cmor_transports)
7
+ include Cmor::Audits::ResourcesController::PaperTrailConcern if Cmor::Core.features?(:cmor_audits)
6
8
 
7
9
  def self.resource_class
8
10
  Cmor::Cms::Template
9
11
  end
10
12
 
13
+ def self.has_paper_trail?
14
+ Object.const_defined?('PaperTrail') && PaperTrail.request.enabled_for_model?(resource_class)
15
+ end
16
+
17
+ def self.available_rest_actions
18
+ super + [:export, (has_paper_trail? ? :versions : nil)].compact
19
+ end
20
+
11
21
  private
12
22
 
13
23
  def permitted_params
@@ -1,7 +1,7 @@
1
1
  = table.column :title, sort: true, class: 'truncate-chars truncate-chars-30'
2
2
  = table.column :pathname, sort: true, class: 'truncate-chars truncate-chars-30'
3
- = table.column :filename, sort: true, class: 'truncate-chars truncate-chars-30'
4
- = table.boolean :home_page?, sort: true
3
+ = table.column :filename, sort: { column_name: 'basename' }, class: 'truncate-chars truncate-chars-30'
4
+ = table.boolean :home_page?
5
5
  = table.column :layout, sort: true
6
6
  = table.column(:navigation_items, sortable: false) do |page|
7
7
  - page.navigation_items.collect{ |navigation_item| link_to(navigation_item, navigation_item_path(navigation_item)) }.join('<br />').html_safe
@@ -0,0 +1,3 @@
1
+ = form.input :source, as: :string
2
+ = form.input :target, as: :string
3
+ = form.input :published, as: :boolean
@@ -0,0 +1,10 @@
1
+ = table.batch_actions
2
+ = table.acts_as_list_actions
3
+ = table.column(:source, sort: true) do |resource|
4
+ - capture_haml do
5
+ = link_to(resource.source, resource.source)
6
+ = table.column(:target, sort: true) do |resource|
7
+ - capture_haml do
8
+ = link_to(resource.target, resource.target)
9
+ = table.timestamps sort: true
10
+ = table.acts_as_published_actions sort: true
@@ -0,0 +1,8 @@
1
+ = table.row :source do |resource|
2
+ - capture_haml do
3
+ = link_to(resource.source, resource.source)
4
+ = table.row :target do |resource|
5
+ - capture_haml do
6
+ = link_to(resource.target, resource.target)
7
+ = table.timestamp :published_at
8
+ = table.timestamps
@@ -2,28 +2,45 @@ Cmor::Cms::Backend::Engine.routes.draw do
2
2
  resources :add_homepages_service, only: [:create, :new]
3
3
  resources :import_partials_service, only: [:create, :new]
4
4
 
5
- resources :content_boxes
6
- resources :navigations
5
+ resources :content_boxes do
6
+ Cmor::Core::Backend::Routing::ResourcesRoutes.inject_routes(self)
7
+ end
8
+
9
+ resources :navigations do
10
+ Cmor::Core::Backend::Routing::ResourcesRoutes.inject_routes(self)
11
+ end
7
12
 
8
13
  resources :navigation_items do
9
- post :toggle_published, on: :member
10
- post :reposition, on: :member
14
+ Cmor::Core::Backend::Routing::ResourcesRoutes.inject_routes(self)
15
+ acts_as_published
16
+ acts_as_list
11
17
  end
12
18
 
13
19
  resources :layouts do
14
- post :toggle_published, on: :member
20
+ Cmor::Core::Backend::Routing::ResourcesRoutes.inject_routes(self)
21
+ acts_as_published
15
22
  end
16
23
 
17
24
  resources :pages do
18
- post :toggle_published, on: :member
25
+ Cmor::Core::Backend::Routing::ResourcesRoutes.inject_routes(self)
26
+ acts_as_published
19
27
  end
20
28
 
21
29
  resources :partials do
22
- post :toggle_published, on: :member
30
+ Cmor::Core::Backend::Routing::ResourcesRoutes.inject_routes(self)
31
+ acts_as_published
32
+ end
33
+
34
+ resources :redirects do
35
+ Cmor::Core::Backend::Routing::ResourcesRoutes.inject_routes(self)
36
+ acts_as_published
37
+ acts_as_list
38
+ post :destroy_many, on: :collection
23
39
  end
24
40
 
25
41
  resources :templates do
26
- post :toggle_published, on: :member
42
+ Cmor::Core::Backend::Routing::ResourcesRoutes.inject_routes(self)
43
+ acts_as_published
27
44
  end
28
45
 
29
46
  root to: 'home#index'
@@ -8,6 +8,7 @@ Cmor::Cms::Backend.configure do |config|
8
8
  # Cmor::Cms::Backend::LayoutsController,
9
9
  # Cmor::Cms::Backend::PagesController,
10
10
  # Cmor::Cms::Backend::PartialsController,
11
+ # Cmor::Cms::Backend::RedirectsController,
11
12
  # Cmor::Cms::Backend::TemplatesController
12
13
  # ]}
13
14
  #
@@ -19,6 +20,7 @@ Cmor::Cms::Backend.configure do |config|
19
20
  Cmor::Cms::Backend::LayoutsController,
20
21
  Cmor::Cms::Backend::PagesController,
21
22
  Cmor::Cms::Backend::PartialsController,
23
+ Cmor::Cms::Backend::RedirectsController,
22
24
  Cmor::Cms::Backend::TemplatesController
23
25
  ]
24
26
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cmor_cms_backend
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.54.pre
4
+ version: 0.0.59.pre
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: 2020-05-20 00:00:00.000000000 Z
11
+ date: 2020-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -30,28 +30,28 @@ dependencies:
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 0.0.54.pre
33
+ version: 0.0.59.pre
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 0.0.54.pre
40
+ version: 0.0.59.pre
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: cmor_core_backend
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: 0.0.54.pre
47
+ version: 0.0.59.pre
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - '='
53
53
  - !ruby/object:Gem::Version
54
- version: 0.0.54.pre
54
+ version: 0.0.59.pre
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: sqlite3
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -324,14 +324,14 @@ dependencies:
324
324
  requirements:
325
325
  - - '='
326
326
  - !ruby/object:Gem::Version
327
- version: 0.0.54.pre
327
+ version: 0.0.59.pre
328
328
  type: :runtime
329
329
  prerelease: false
330
330
  version_requirements: !ruby/object:Gem::Requirement
331
331
  requirements:
332
332
  - - '='
333
333
  - !ruby/object:Gem::Version
334
- version: 0.0.54.pre
334
+ version: 0.0.59.pre
335
335
  description: Provides a Backend for CMOR CMS
336
336
  email:
337
337
  - roberto@vasquez-angel.de
@@ -357,6 +357,7 @@ files:
357
357
  - app/controllers/cmor/cms/backend/navigations_controller.rb
358
358
  - app/controllers/cmor/cms/backend/pages_controller.rb
359
359
  - app/controllers/cmor/cms/backend/partials_controller.rb
360
+ - app/controllers/cmor/cms/backend/redirects_controller.rb
360
361
  - app/controllers/cmor/cms/backend/templates_controller.rb
361
362
  - app/helpers/cmor/cms/backend/application_helper.rb
362
363
  - app/policies/cmor/cms/add_homepages_service_policy.rb
@@ -393,6 +394,9 @@ files:
393
394
  - app/views/cmor/cms/backend/partials/_index_table.html.haml
394
395
  - app/views/cmor/cms/backend/partials/_query_form.html.haml
395
396
  - app/views/cmor/cms/backend/partials/_show_table.html.haml
397
+ - app/views/cmor/cms/backend/redirects/_form.html.haml
398
+ - app/views/cmor/cms/backend/redirects/_index_table.html.haml
399
+ - app/views/cmor/cms/backend/redirects/_show_table.html.haml
396
400
  - app/views/cmor/cms/backend/templates/_form.html.haml
397
401
  - app/views/cmor/cms/backend/templates/_index_table.html.haml
398
402
  - app/views/cmor/cms/backend/templates/_query_form.html.haml
@@ -431,7 +435,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
431
435
  - !ruby/object:Gem::Version
432
436
  version: 1.3.1
433
437
  requirements: []
434
- rubygems_version: 3.1.3
438
+ rubygems_version: 3.1.4
435
439
  signing_key:
436
440
  specification_version: 4
437
441
  summary: Backend Module for CMOR CMS 2