cmor_cms_backend 0.0.55.pre → 0.0.60.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: 5a323a1d88801ffd8c893a7e1e6d739c8ee0889c8391e7d2bce3f019e4392dd9
4
- data.tar.gz: 60a9a2af9c062398cecaa0ff61a235dc977844c382a8b3014ecce41ca53d31ff
3
+ metadata.gz: f702a409129150ef9fd9e4c00e33f6b665c189e818361dc4448c67920f6db1fd
4
+ data.tar.gz: 0d869194b57c3a7ba9c3cc35f962155df7bd7fce33b1e20fc1cf57e3682ce541
5
5
  SHA512:
6
- metadata.gz: 55206c868cb91751f80710398ddaa873235baaa8f6e75f44ea490a07665468c6938b086358da79d270522bc518097613f40c17d1b9931afe37475646456aa989
7
- data.tar.gz: 90b54390a6db4d7deeac504f04470377afa3f494c73ff1679b36cae954bca9ebfb61f3f5bd8632770cac7b25f74c5cc32efbdd052f3d54568021805261f3c15b
6
+ metadata.gz: c0322397d18764ac76ef5ca110bc2e00cf9b6922e67f052274d0da544bd76c6e00d26c03566885d7ff9d9bfb00f9fdaa709c1efda7d25742a719514601371a43
7
+ data.tar.gz: e65393d5f5f396ea2e97dee436168657ddc5079b7ffacb404497233473550e951aed3c90afc324d084d54060d824f96ac92de39ee4e4bbf5e11d015734ac43f1
@@ -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
@@ -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.55.pre
4
+ version: 0.0.60.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-06-28 00:00:00.000000000 Z
11
+ date: 2020-10-21 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.55.pre
33
+ version: 0.0.60.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.55.pre
40
+ version: 0.0.60.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.55.pre
47
+ version: 0.0.60.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.55.pre
54
+ version: 0.0.60.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.55.pre
327
+ version: 0.0.60.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.55.pre
334
+ version: 0.0.60.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