effective_regions 1.8.3 → 1.10.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 +4 -4
- data/MIT-LICENSE +1 -1
- data/README.md +5 -48
- data/app/assets/config/effective_regions_manifest.js +3 -0
- data/app/assets/javascripts/effective/snippets/drop_cap.js.coffee +25 -0
- data/app/assets/stylesheets/drop_cap.scss +7 -0
- data/app/controllers/effective/regions_controller.rb +12 -17
- data/app/helpers/effective_regions_controller_helper.rb +1 -1
- data/app/helpers/effective_regions_helper.rb +2 -6
- data/app/models/concerns/acts_as_regionable.rb +2 -3
- data/app/models/effective/ck_asset.rb +3 -6
- data/app/models/effective/region.rb +9 -12
- data/app/models/effective/snippets/drop_cap.rb +11 -0
- data/app/views/effective/snippets/_drop_cap.html.haml +2 -0
- data/config/effective_regions.rb +0 -23
- data/lib/effective_regions.rb +4 -23
- data/lib/effective_regions/engine.rb +5 -3
- data/lib/effective_regions/version.rb +1 -1
- data/lib/generators/effective_regions/install_generator.rb +1 -0
- metadata +39 -7
- data/app/models/effective/access_denied.rb +0 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a7aa0433b2e695dd195090cb20d46d4baedecce240bdf62d36cb5e3a071266bf
|
4
|
+
data.tar.gz: 0f9ec81c8a9b84d55cc2a4acd76c076b442c012946d2943b60082ed067cb8295
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a9d15123d4576f57191b4ef573b310b1b0dd86aa890e0621740975fdd5666250a07d419c7f21658f52ab669624ee933a163390ff988c79f85137f62086671a37
|
7
|
+
data.tar.gz: 42e37bab17b09f62870ef01e40df40e751644953ed0e8b0c46dc36f2ca6f8fd1544a0371648ae010236280841ca16b3197ba0c19989576b42c2b461a9232d25b
|
data/MIT-LICENSE
CHANGED
data/README.md
CHANGED
@@ -252,36 +252,14 @@ You can overide the default behaviour by passing an Exit URL as a parameter:
|
|
252
252
|
= link_to 'Edit Post Content', effective_regions.edit_path(post_path(@post), :exit => edit_admin_post_path(@post))
|
253
253
|
```
|
254
254
|
|
255
|
-
|
256
255
|
## Authorization
|
257
256
|
|
258
|
-
All authorization checks are handled
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
The authorization method can be defined as:
|
263
|
-
|
264
|
-
```ruby
|
265
|
-
EffectiveRegions.setup do |config|
|
266
|
-
config.authorization_method = Proc.new { |controller, action, resource| can?(action, resource) }
|
267
|
-
end
|
268
|
-
```
|
257
|
+
All authorization checks are handled through the
|
258
|
+
[effective_resources](https://github.com/code-and-effect/effective_resources/)
|
259
|
+
gem and its `config.authorization_method` found in
|
260
|
+
the `config/initializers/effective_resources.rb` initializer.
|
269
261
|
|
270
|
-
|
271
|
-
|
272
|
-
```ruby
|
273
|
-
EffectiveRegions.setup do |config|
|
274
|
-
config.authorization_method = :authorize_effective_regions
|
275
|
-
end
|
276
|
-
```
|
277
|
-
|
278
|
-
and then in your application_controller.rb:
|
279
|
-
|
280
|
-
```ruby
|
281
|
-
def authorize_effective_regions(action, resource)
|
282
|
-
can?(action, resource)
|
283
|
-
end
|
284
|
-
```
|
262
|
+
## Permissions
|
285
263
|
|
286
264
|
There are 3 different levels of permissions to be considered:
|
287
265
|
|
@@ -297,19 +275,6 @@ can :update, Effective::Region
|
|
297
275
|
|
298
276
|
can :update, ActsAsRegionableObject # This would be your Event, Post, or Page, or whatever.
|
299
277
|
|
300
|
-
If the method or proc returns false (user is not authorized) an `Effective::AccessDenied` exception will be raised
|
301
|
-
|
302
|
-
You can rescue from this exception by adding the following to your application_controller.rb
|
303
|
-
|
304
|
-
```ruby
|
305
|
-
rescue_from Effective::AccessDenied do |exception|
|
306
|
-
respond_to do |format|
|
307
|
-
format.html { render 'static_pages/access_denied', :status => 403 }
|
308
|
-
format.any { render :text => 'Access Denied', :status => 403 }
|
309
|
-
end
|
310
|
-
end
|
311
|
-
```
|
312
|
-
|
313
278
|
## Snippets
|
314
279
|
|
315
280
|
Snippets are intelligent pieces of content that can be dropped into an effective_region through the full-screen editor's 'Insert Snippet' dropdown.
|
@@ -633,13 +598,6 @@ Code and Effect is the product arm of [AgileStyle](http://www.agilestyle.com/),
|
|
633
598
|
|
634
599
|
The test suite for this gem is unfortunately not yet complete.
|
635
600
|
|
636
|
-
Run tests by:
|
637
|
-
|
638
|
-
```ruby
|
639
|
-
rake spec
|
640
|
-
```
|
641
|
-
|
642
|
-
|
643
601
|
## Contributing
|
644
602
|
|
645
603
|
1. Fork it
|
@@ -648,4 +606,3 @@ rake spec
|
|
648
606
|
4. Push to the branch (`git push origin my-new-feature`)
|
649
607
|
5. Bonus points for test coverage
|
650
608
|
6. Create new Pull Request
|
651
|
-
|
@@ -0,0 +1,25 @@
|
|
1
|
+
CKEDITOR.dialog.add 'drop_cap', (editor) -> # Must match the class name of the snippet
|
2
|
+
title: 'A drop cap',
|
3
|
+
minWidth: 200,
|
4
|
+
minHeight: 100,
|
5
|
+
contents: [
|
6
|
+
{
|
7
|
+
id: 'drop_cap_id', # Just an html id, doesn't really matter what is here
|
8
|
+
elements: [
|
9
|
+
{
|
10
|
+
id: 'letter'
|
11
|
+
type: 'text',
|
12
|
+
label: 'Letter (required)',
|
13
|
+
setup: (widget) -> this.setValue(widget.data.letter)
|
14
|
+
commit: (widget) -> widget.setData('letter', this.getValue())
|
15
|
+
},
|
16
|
+
{
|
17
|
+
id: 'html_class'
|
18
|
+
type: 'text',
|
19
|
+
label: 'Additional html classes (optional)',
|
20
|
+
setup: (widget) -> this.setValue(widget.data.html_class)
|
21
|
+
commit: (widget) -> widget.setData('html_class', this.getValue())
|
22
|
+
}
|
23
|
+
]
|
24
|
+
}
|
25
|
+
]
|
@@ -3,24 +3,20 @@ module Effective
|
|
3
3
|
respond_to :html, :json
|
4
4
|
layout false
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
before_action :authenticate_user! if defined?(Devise)
|
9
|
-
else
|
10
|
-
skip_before_filter :verify_authenticity_token, only: :update
|
11
|
-
before_filter :authenticate_user! if defined?(Devise)
|
12
|
-
end
|
6
|
+
skip_before_action :verify_authenticity_token, only: :update
|
7
|
+
before_action(:authenticate_user!) if defined?(Devise)
|
13
8
|
|
14
|
-
skip_log_page_views
|
9
|
+
skip_log_page_views(quiet: true, only: [:snippet]) if defined?(EffectiveLogging)
|
15
10
|
|
16
11
|
def edit
|
17
|
-
|
12
|
+
EffectiveResources.authorize!(self, :edit, Effective::Region.new)
|
18
13
|
|
19
14
|
cookies['effective_regions_editting'] = {:value => params[:exit].presence || request.referrer, :path => '/'}
|
20
15
|
|
21
16
|
# TODO: turn this into a cookie or something better.
|
22
17
|
uri = URI.parse(Rack::Utils.unescape(request.url.sub('/edit', '')))
|
23
18
|
uri.query = [uri.query, "edit=true"].compact.join('&')
|
19
|
+
|
24
20
|
redirect_to uri.to_s
|
25
21
|
end
|
26
22
|
|
@@ -37,15 +33,15 @@ module Effective
|
|
37
33
|
regionable, title = find_regionable(key)
|
38
34
|
|
39
35
|
if regionable
|
40
|
-
|
36
|
+
EffectiveResources.authorized?(self, :update, regionable) # can I update the regionable object?
|
41
37
|
|
42
38
|
region = regionable.regions.find { |region| region.title == title }
|
43
|
-
region ||= regionable.regions.build(:
|
39
|
+
region ||= regionable.regions.build(title: title)
|
44
40
|
|
45
41
|
to_save = regionable
|
46
42
|
else
|
47
|
-
region = Effective::Region.global.where(:
|
48
|
-
|
43
|
+
region = Effective::Region.global.where(title: title).first_or_initialize
|
44
|
+
EffectiveResources.authorized?(self, :update, region) # can I update the global region?
|
49
45
|
|
50
46
|
to_save = region
|
51
47
|
end
|
@@ -68,15 +64,15 @@ module Effective
|
|
68
64
|
|
69
65
|
response[:refresh] = true if refresh_page
|
70
66
|
|
71
|
-
render
|
67
|
+
render(json: response.to_json(), status: 200)
|
72
68
|
return
|
73
69
|
end
|
74
70
|
|
75
|
-
render
|
71
|
+
render(text: 'error', status: :unprocessable_entity)
|
76
72
|
end
|
77
73
|
|
78
74
|
def snippet # This is a GET. CKEDITOR passes us data, we need to render the non-editable content
|
79
|
-
|
75
|
+
EffectiveResources.authorize!(self, :edit, Effective::Region.new)
|
80
76
|
|
81
77
|
klass = "Effective::Snippets::#{region_params[:name].try(:classify)}".safe_constantize
|
82
78
|
|
@@ -153,4 +149,3 @@ module Effective
|
|
153
149
|
|
154
150
|
end
|
155
151
|
end
|
156
|
-
|
@@ -2,7 +2,7 @@ module EffectiveRegionsControllerHelper
|
|
2
2
|
def effectively_editing?
|
3
3
|
@effectively_editing ||= (
|
4
4
|
request.fullpath.include?('edit=true') &&
|
5
|
-
|
5
|
+
EffectiveResources.authorized?(controller, :edit, Effective::Region.new)
|
6
6
|
)
|
7
7
|
end
|
8
8
|
alias_method :effectively_editting?, :effectively_editing?
|
@@ -38,8 +38,6 @@ module EffectiveRegionsHelper
|
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
41
|
-
private
|
42
|
-
|
43
41
|
def ckeditor_region(args, options = {}, &block)
|
44
42
|
obj = args.first
|
45
43
|
title = args.last.to_s.parameterize
|
@@ -63,7 +61,7 @@ module EffectiveRegionsHelper
|
|
63
61
|
region = obj.regions.find { |region| region.title == title }
|
64
62
|
|
65
63
|
if effectively_editing?
|
66
|
-
can_edit =
|
64
|
+
can_edit = EffectiveResources.authorized?(controller, :update, obj)
|
67
65
|
opts[:id] = [model_name_from_record_or_class(obj).param_key(), obj.id, title].join('_')
|
68
66
|
end
|
69
67
|
else # This is a global region
|
@@ -71,7 +69,7 @@ module EffectiveRegionsHelper
|
|
71
69
|
region = regions.find { |region| region.title == title } || Effective::Region.new(:title => title)
|
72
70
|
|
73
71
|
if effectively_editing?
|
74
|
-
can_edit =
|
72
|
+
can_edit = EffectiveResources.authorized?(controller, :update, region)
|
75
73
|
opts[:id] = title.to_s.parameterize
|
76
74
|
end
|
77
75
|
end
|
@@ -112,6 +110,4 @@ module EffectiveRegionsHelper
|
|
112
110
|
end.html_safe
|
113
111
|
end
|
114
112
|
|
115
|
-
|
116
|
-
|
117
113
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module ActsAsRegionable
|
2
2
|
extend ActiveSupport::Concern
|
3
3
|
|
4
|
-
module
|
4
|
+
module Base
|
5
5
|
def acts_as_regionable(*options)
|
6
6
|
@acts_as_regionable_opts = options || []
|
7
7
|
include ::ActsAsRegionable
|
@@ -9,7 +9,7 @@ module ActsAsRegionable
|
|
9
9
|
end
|
10
10
|
|
11
11
|
included do
|
12
|
-
has_many :regions, :
|
12
|
+
has_many :regions, as: :regionable, class_name: 'Effective::Region', dependent: :delete_all, autosave: true
|
13
13
|
end
|
14
14
|
|
15
15
|
module ClassMethods
|
@@ -36,4 +36,3 @@ module ActsAsRegionable
|
|
36
36
|
end
|
37
37
|
|
38
38
|
end
|
39
|
-
|
@@ -11,15 +11,12 @@ module Effective
|
|
11
11
|
# The instance ones will have just one file
|
12
12
|
has_one_attached :file
|
13
13
|
|
14
|
-
|
15
|
-
|
14
|
+
effective_resource do
|
15
|
+
global :boolean
|
16
|
+
end
|
16
17
|
|
17
18
|
def self.global
|
18
19
|
CkAsset.where(global: true).first || CkAsset.create!(global: true)
|
19
20
|
end
|
20
21
|
end
|
21
22
|
end
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
@@ -2,21 +2,22 @@ module Effective
|
|
2
2
|
class Region < ActiveRecord::Base
|
3
3
|
self.table_name = EffectiveRegions.regions_table_name.to_s
|
4
4
|
|
5
|
-
belongs_to :regionable, :
|
5
|
+
belongs_to :regionable, polymorphic: true, optional: true
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
7
|
+
effective_resource do
|
8
|
+
title :string
|
9
|
+
content :text
|
10
|
+
snippets :text
|
11
|
+
|
12
|
+
timestamps
|
13
|
+
end
|
13
14
|
|
14
15
|
serialize :snippets, HashWithIndifferentAccess
|
15
16
|
|
16
17
|
scope :global, -> { where("#{EffectiveRegions.regions_table_name}.regionable_type IS NULL").where("#{EffectiveRegions.regions_table_name}.regionable_id IS NULL") }
|
17
18
|
scope :with_snippets, -> { where("#{EffectiveRegions.regions_table_name}.snippets ILIKE ?", '%snippet_%') }
|
18
19
|
|
19
|
-
|
20
|
+
validates :title, presence: true
|
20
21
|
|
21
22
|
def snippets
|
22
23
|
self[:snippets] || HashWithIndifferentAccess.new()
|
@@ -41,7 +42,3 @@ module Effective
|
|
41
42
|
|
42
43
|
end
|
43
44
|
end
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
data/config/effective_regions.rb
CHANGED
@@ -2,29 +2,6 @@ EffectiveRegions.setup do |config|
|
|
2
2
|
config.regions_table_name = :regions
|
3
3
|
config.ck_assets_table_name = :ck_assets
|
4
4
|
|
5
|
-
# Authorization Method
|
6
|
-
#
|
7
|
-
# This method is called by all controller actions with the appropriate action and resource
|
8
|
-
# If the method returns false, an Effective::AccessDenied Error will be raised (see README.md for complete info)
|
9
|
-
#
|
10
|
-
# Use via Proc (and with CanCan):
|
11
|
-
# config.authorization_method = Proc.new { |controller, action, resource| can?(action, resource) }
|
12
|
-
#
|
13
|
-
# Use via custom method:
|
14
|
-
# config.authorization_method = :my_authorization_method
|
15
|
-
#
|
16
|
-
# And then in your application_controller.rb:
|
17
|
-
#
|
18
|
-
# def my_authorization_method(action, resource)
|
19
|
-
# current_user.is?(:admin)
|
20
|
-
# end
|
21
|
-
#
|
22
|
-
# Or disable the check completely:
|
23
|
-
# config.authorization_method = false
|
24
|
-
config.authorization_method = Proc.new { |controller, action, resource| authorize!(action, resource) } # CanCanCan
|
25
|
-
|
26
|
-
|
27
|
-
|
28
5
|
# Before Region Save Method
|
29
6
|
#
|
30
7
|
# This method is called when a User clicks the 'Save' button in the full screen editor.
|
data/lib/effective_regions.rb
CHANGED
@@ -1,34 +1,15 @@
|
|
1
|
+
require 'effective_resources'
|
1
2
|
require 'effective_ckeditor'
|
2
3
|
require 'effective_regions/engine'
|
3
4
|
require 'effective_regions/version'
|
4
5
|
|
5
6
|
module EffectiveRegions
|
6
|
-
mattr_accessor :regions_table_name
|
7
|
-
mattr_accessor :ck_assets_table_name
|
8
7
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
def self.setup
|
13
|
-
yield self
|
8
|
+
def self.config_keys
|
9
|
+
[:regions_table_name, :ck_assets_table_name, :before_save_method]
|
14
10
|
end
|
15
11
|
|
16
|
-
|
17
|
-
@_exceptions ||= [Effective::AccessDenied, (CanCan::AccessDenied if defined?(CanCan)), (Pundit::NotAuthorizedError if defined?(Pundit))].compact
|
18
|
-
|
19
|
-
return !!authorization_method unless authorization_method.respond_to?(:call)
|
20
|
-
controller = controller.controller if controller.respond_to?(:controller)
|
21
|
-
|
22
|
-
begin
|
23
|
-
!!(controller || self).instance_exec((controller || self), action, resource, &authorization_method)
|
24
|
-
rescue *@_exceptions
|
25
|
-
false
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
def self.authorize!(controller, action, resource)
|
30
|
-
raise Effective::AccessDenied.new('Access Denied', action, resource) unless authorized?(controller, action, resource)
|
31
|
-
end
|
12
|
+
include EffectiveGem
|
32
13
|
|
33
14
|
# Returns a Snippet.new() for every class in the /app/effective/snippets/* directory
|
34
15
|
def self.snippets
|
@@ -6,7 +6,9 @@ module EffectiveRegions
|
|
6
6
|
|
7
7
|
# Include Helpers to base application
|
8
8
|
initializer 'effective_regions.action_controller' do |app|
|
9
|
-
ActiveSupport.on_load :
|
9
|
+
ActiveSupport.on_load :action_controller_base do
|
10
|
+
helper EffectiveRegionsHelper
|
11
|
+
|
10
12
|
ActionController::Base.send(:include, ::EffectiveRegionsControllerHelper)
|
11
13
|
end
|
12
14
|
end
|
@@ -14,7 +16,7 @@ module EffectiveRegions
|
|
14
16
|
# Include acts_as_addressable concern and allow any ActiveRecord object to call it
|
15
17
|
initializer 'effective_regions.active_record' do |app|
|
16
18
|
ActiveSupport.on_load :active_record do
|
17
|
-
ActiveRecord::Base.extend(ActsAsRegionable::
|
19
|
+
ActiveRecord::Base.extend(ActsAsRegionable::Base)
|
18
20
|
end
|
19
21
|
end
|
20
22
|
|
@@ -24,7 +26,7 @@ module EffectiveRegions
|
|
24
26
|
end
|
25
27
|
|
26
28
|
initializer "effective_regions.append_precompiled_assets" do |app|
|
27
|
-
|
29
|
+
app.config.assets.precompile += ['effective_regions_manifest.js', 'ck_assets.js', 'ck_assets.css', 'drop_cap.css']
|
28
30
|
end
|
29
31
|
|
30
32
|
end
|
@@ -21,6 +21,7 @@ module EffectiveRegions
|
|
21
21
|
|
22
22
|
def create_migration_file
|
23
23
|
@regions_table_name = ':' + EffectiveRegions.regions_table_name.to_s
|
24
|
+
@ck_assets_table_name = : + EffectiveRegions.ck_assets_table_name.to_s
|
24
25
|
migration_template ('../' * 3) + 'db/migrate/01_create_effective_regions.rb.erb', 'db/migrate/create_effective_regions.rb'
|
25
26
|
end
|
26
27
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_regions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code and Effect
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-06-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 3.2.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: effective_resources
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: effective_ckeditor
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -38,6 +52,20 @@ dependencies:
|
|
38
52
|
- - ">="
|
39
53
|
- !ruby/object:Gem::Version
|
40
54
|
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: sassc
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
41
69
|
description: Create editable content regions within your existing, ordinary ActionView::Base
|
42
70
|
views, and update content with an actually-good full-screen WYSIWYG editor.
|
43
71
|
email:
|
@@ -49,21 +77,24 @@ files:
|
|
49
77
|
- MIT-LICENSE
|
50
78
|
- README.md
|
51
79
|
- Rakefile
|
80
|
+
- app/assets/config/effective_regions_manifest.js
|
52
81
|
- app/assets/images/effective/templates/image_and_title.png
|
53
82
|
- app/assets/javascripts/ck_assets.js.coffee
|
54
83
|
- app/assets/javascripts/effective/snippets/current_date_time.js.coffee
|
55
84
|
- app/assets/javascripts/effective/snippets/current_user_info.js.coffee
|
85
|
+
- app/assets/javascripts/effective/snippets/drop_cap.js.coffee
|
56
86
|
- app/assets/stylesheets/ck_assets.scss
|
87
|
+
- app/assets/stylesheets/drop_cap.scss
|
57
88
|
- app/controllers/effective/ck_assets_controller.rb
|
58
89
|
- app/controllers/effective/regions_controller.rb
|
59
90
|
- app/helpers/effective_regions_controller_helper.rb
|
60
91
|
- app/helpers/effective_regions_helper.rb
|
61
92
|
- app/models/concerns/acts_as_regionable.rb
|
62
|
-
- app/models/effective/access_denied.rb
|
63
93
|
- app/models/effective/ck_asset.rb
|
64
94
|
- app/models/effective/region.rb
|
65
95
|
- app/models/effective/snippets/current_date_time.rb
|
66
96
|
- app/models/effective/snippets/current_user_info.rb
|
97
|
+
- app/models/effective/snippets/drop_cap.rb
|
67
98
|
- app/models/effective/snippets/snippet.rb
|
68
99
|
- app/models/effective/templates/image_and_title.rb
|
69
100
|
- app/models/effective/templates/template.rb
|
@@ -73,6 +104,7 @@ files:
|
|
73
104
|
- app/views/effective/ck_assets/index.html.haml
|
74
105
|
- app/views/effective/snippets/_current_date_time.html.haml
|
75
106
|
- app/views/effective/snippets/_current_user_info.html.haml
|
107
|
+
- app/views/effective/snippets/_drop_cap.html.haml
|
76
108
|
- app/views/effective/templates/_image_and_title.html.haml
|
77
109
|
- app/views/effective/templates/_three_column.html.haml
|
78
110
|
- app/views/effective/templates/_two_column.html.haml
|
@@ -89,7 +121,7 @@ homepage: https://github.com/code-and-effect/effective_regions
|
|
89
121
|
licenses:
|
90
122
|
- MIT
|
91
123
|
metadata: {}
|
92
|
-
post_install_message:
|
124
|
+
post_install_message:
|
93
125
|
rdoc_options: []
|
94
126
|
require_paths:
|
95
127
|
- lib
|
@@ -104,8 +136,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
104
136
|
- !ruby/object:Gem::Version
|
105
137
|
version: '0'
|
106
138
|
requirements: []
|
107
|
-
rubygems_version: 3.
|
108
|
-
signing_key:
|
139
|
+
rubygems_version: 3.1.2
|
140
|
+
signing_key:
|
109
141
|
specification_version: 4
|
110
142
|
summary: Create editable content regions within your existing, ordinary ActionView::Base
|
111
143
|
views, and update content with an actually-good full-screen WYSIWYG editor.
|
@@ -1,17 +0,0 @@
|
|
1
|
-
unless defined?(Effective::AccessDenied)
|
2
|
-
module Effective
|
3
|
-
class AccessDenied < StandardError
|
4
|
-
attr_reader :action, :subject
|
5
|
-
|
6
|
-
def initialize(message = nil, action = nil, subject = nil)
|
7
|
-
@message = message
|
8
|
-
@action = action
|
9
|
-
@subject = subject
|
10
|
-
end
|
11
|
-
|
12
|
-
def to_s
|
13
|
-
@message || I18n.t(:'unauthorized.default', :default => 'Access Denied')
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|