effective_regions 1.4.3 → 1.4.5

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: ba332da231fdbe20fe72361c6ddbaaec95f11d2b
4
- data.tar.gz: 558a7f5bc4f7915e37f8cf12428634613ea1d89c
3
+ metadata.gz: 16ff122b803fc62f6a918fcab2d2182a54420b9f
4
+ data.tar.gz: 6e86c2873a393b7a0d10c44c0db5591a6dd92379
5
5
  SHA512:
6
- metadata.gz: b27f521ef64906ecabd1f10af9cba946d9c934396eecc9a5c3e5947c425a85a3ce3db0862ce196cff3b97fdcc6448b2b174d1c5802cefb4dd89a9e82e65e5755
7
- data.tar.gz: 401510a46e9548a74adc2124ddb8d247418565a2c4f605cfde3354edc1fd59ffb0248c25730d19d127d2e3dbdfcbbf4538474ff377aec39c25281f575e0e31f1
6
+ metadata.gz: d6339ef137bfb03ee9d9519dea1bc52538d103c63b1235292e6501d45871bbb6b71c663d4c05fe9ddcf172104ba3e077714d3af34c17ef49a332b01db30b2016
7
+ data.tar.gz: b64ca62f1693c9738d88ff1b61b8ee7b86e4dfc788debd9ed69ff2a28a1c4d87a641dda023734e27ef649b16921dd827e79ad89c5eb38da40920014dfb1808e6
@@ -22,8 +22,21 @@ module EffectiveRegionsHelper
22
22
  # Loads the Ckeditor Javascript & Stylesheets only when in edit mode
23
23
  def effective_regions_include_tags
24
24
  if effectively_editting?
25
+ payload = {
26
+ :snippets => Effective::Snippets::Snippet.all(controller),
27
+ :templates => Effective::Templates::Template.all(controller)
28
+ }
29
+
30
+ if defined?(EffectiveRoles)
31
+ payload[:roles] = EffectiveRoles.roles_collection(Effective::Menu.new(), current_user)
32
+ end
33
+
34
+ if defined?(EffectivePages)
35
+ payload[:pages] = ([['', '']] + Effective::Page.order(:title).map { |page| [page.title, page.id] })
36
+ end
37
+
25
38
  javascript_include_tag('effective_ckeditor') + stylesheet_link_tag('effective_ckeditor') +
26
- render(:partial => 'effective_regions/include_tags_javascript')
39
+ render(:partial => 'effective_regions/include_tags_javascript', :locals => {:payload => payload})
27
40
  end
28
41
  end
29
42
 
@@ -1,4 +1,2 @@
1
- - payload = {:snippets => Effective::Snippets::Snippet.all(controller), :templates => Effective::Templates::Template.all(controller)}
2
-
3
1
  :javascript
4
2
  CKEDITOR.config['effective_regions'] = #{payload.to_json()};
@@ -1,3 +1,3 @@
1
1
  module EffectiveRegions
2
- VERSION = '1.4.3'.freeze
2
+ VERSION = '1.4.5'.freeze
3
3
  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.3
4
+ version: 1.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-13 00:00:00.000000000 Z
11
+ date: 2015-03-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 1.1.0
33
+ version: 1.5.1
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: 1.1.0
40
+ version: 1.5.1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: migrant
43
43
  requirement: !ruby/object:Gem::Requirement