enjoy_cms 0.3.0.3 → 0.3.0.4

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: 0d4b5b178e611666382fde0a7a3cde395a3286be
4
- data.tar.gz: c9ac4904406670aba5e654e24c4a1b1db62f155c
3
+ metadata.gz: 7ae5da74a58d1eb3e17743f4c15776d9d7c4aff2
4
+ data.tar.gz: 38dd9e7610598eea2e5db3a8ca6123a8916fc5d2
5
5
  SHA512:
6
- metadata.gz: 61ec8a5b08fa8100e61233c58b525d0c422227e67798dc6a2d34c4e1a77b28588a933ef889453492c1b7a8dadc552f032c3a9019771e58eec9f6b9fd273221cf
7
- data.tar.gz: a35ef5829d329dbc83a7d3000a752663e86d3d87b0fb988a329123125175521a8aa3ee9b7de1e213cb32b102a017ba4c50633c751b65ea9b50a32ce19a503421
6
+ metadata.gz: a419713fdc0e06afb71897a2913160fad87572d66f50111c2da4916121d977fbeb9b98088a849cef0142cbadb1114e114e451e04aff1815763eb1aa56d3eb9b7
7
+ data.tar.gz: b77afda381a54a93dbdd2158b5744bf49f61c9c16c58539cf6660e0e8b19b1183caebb3fbd2c95eddde8da69ef5245b3344e3e96eb3124d52e6a2705bb02e747
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- enjoy_cms (0.3.0.3)
4
+ enjoy_cms (0.3.0.4)
5
5
  ack_rails_admin_jcrop
6
6
  addressable
7
7
  ckeditor
@@ -0,0 +1,5 @@
1
+ module Enjoy::Decorators
2
+ module PageBlock
3
+ extend ActiveSupport::Concern
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ module Enjoy::Decorators
2
+ module PageBlockset
3
+ extend ActiveSupport::Concern
4
+ end
5
+ end
@@ -4,6 +4,10 @@ module Enjoy
4
4
  include Enjoy::Models::PageBlock
5
5
 
6
6
  include Enjoy::Decorators::PageBlock
7
+
8
+ rails_admin(&Enjoy::Admin::PageBlock.config(rails_admin_add_fields) { |config|
9
+ rails_admin_add_config(config)
10
+ })
7
11
  end
8
12
  end
9
13
  end
@@ -4,6 +4,10 @@ module Enjoy
4
4
  include Enjoy::Models::PageBlockset
5
5
 
6
6
  include Enjoy::Decorators::PageBlockset
7
+
8
+ rails_admin(&Enjoy::Admin::PageBlockset.config(rails_admin_add_fields) { |config|
9
+ rails_admin_add_config(config)
10
+ })
7
11
  end
8
12
  end
9
13
  end
@@ -7,6 +7,7 @@ module Enjoy
7
7
 
8
8
  field :enabled, :toggle
9
9
  field :name
10
+ field :content, :enjoy_html
10
11
 
11
12
  fields.each_pair do |name, type|
12
13
  if type.nil?
@@ -20,18 +21,18 @@ module Enjoy
20
21
  end
21
22
  end
22
23
 
23
- field :items do
24
- read_only true
25
- help 'Список блоков'
26
-
27
- pretty_value do
28
- bindings[:object].items.to_a.map { |i|
29
- route = (bindings[:view] || bindings[:controller])
30
- model_name = i.rails_admin_model
31
- route.link_to(i.name, route.rails_admin.show_path(model_name: model_name, id: i.id), title: i.name)
32
- }.join("<br>").html_safe
33
- end
34
- end
24
+ # field :blocksets do
25
+ # read_only true
26
+ # help 'Список групп блоков'
27
+ #
28
+ # pretty_value do
29
+ # bindings[:object].blocksets.to_a.map { |bs|
30
+ # route = (bindings[:view] || bindings[:controller])
31
+ # model_name = bs.rails_admin_model
32
+ # route.link_to(bs.name, route.rails_admin.show_path(model_name: model_name, id: bs.id), title: bs.name)
33
+ # }.join("<br>").html_safe
34
+ # end
35
+ # end
35
36
 
36
37
  if block_given?
37
38
  yield self
@@ -8,6 +8,9 @@ module Enjoy
8
8
  field :enabled, :toggle
9
9
  field :name
10
10
 
11
+
12
+ field :blocks
13
+
11
14
  fields.each_pair do |name, type|
12
15
  if type.nil?
13
16
  field name
@@ -20,18 +23,18 @@ module Enjoy
20
23
  end
21
24
  end
22
25
 
23
- field :items do
24
- read_only true
25
- help 'Список блоков'
26
-
27
- pretty_value do
28
- bindings[:object].items.to_a.map { |i|
29
- route = (bindings[:view] || bindings[:controller])
30
- model_name = i.rails_admin_model
31
- route.link_to(i.name, route.rails_admin.show_path(model_name: model_name, id: i.id), title: i.name)
32
- }.join("<br>").html_safe
33
- end
34
- end
26
+ # field :blocks do
27
+ # read_only true
28
+ # help 'Список блоков'
29
+ #
30
+ # pretty_value do
31
+ # bindings[:object].blocks.to_a.map { |b|
32
+ # route = (bindings[:view] || bindings[:controller])
33
+ # model_name = b.rails_admin_model
34
+ # route.link_to(b.name, route.rails_admin.show_path(model_name: model_name, id: b.id), title: b.name)
35
+ # }.join("<br>").html_safe
36
+ # end
37
+ # end
35
38
 
36
39
  if block_given?
37
40
  yield self
@@ -38,7 +38,7 @@ module Enjoy
38
38
  attr_accessor :routes_config
39
39
 
40
40
  def initialize
41
- @news_image_convert_options {}
41
+ @news_image_convert_options = {}
42
42
  @news_image_styles = {
43
43
  main: '400x200>',
44
44
  thumb: '200x100>'
@@ -7,6 +7,8 @@ module Enjoy
7
7
  include Enjoy::HtmlField
8
8
 
9
9
  included do
10
+ has_and_belongs_to_many :blocksets, inverse_of: :blocks, class_name: "Enjoy::PageBlockset"
11
+
10
12
  enjoy_cms_html_field :content, type: String, localize: Enjoy.config.localize, default: ""
11
13
  end
12
14
  end
data/lib/enjoy/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Enjoy
2
- VERSION = "0.3.0.3"
2
+ VERSION = "0.3.0.4"
3
3
  end
data/lib/enjoy_cms.rb CHANGED
@@ -76,6 +76,9 @@ module Enjoy
76
76
  autoload :EmbeddedGalleryImage, 'enjoy/admin/embedded_gallery_image'
77
77
  autoload :GalleryImage, 'enjoy/admin/gallery_image'
78
78
  autoload :Gallery, 'enjoy/admin/gallery'
79
+
80
+ autoload :PageBlock, 'enjoy/admin/page_block'
81
+ autoload :PageBlockset, 'enjoy/admin/page_blockset'
79
82
  end
80
83
 
81
84
  module Models
@@ -92,6 +95,9 @@ module Enjoy
92
95
  autoload :GalleryImage, 'enjoy/models/gallery_image'
93
96
  autoload :Gallery, 'enjoy/models/gallery'
94
97
 
98
+ autoload :PageBlock, 'enjoy/models/page_block'
99
+ autoload :PageBlockset, 'enjoy/models/page_blockset'
100
+
95
101
  module Mongoid
96
102
  autoload :SitemapData, 'enjoy/models/mongoid/sitemap_data'
97
103
  autoload :Seo, 'enjoy/models/mongoid/seo'
@@ -105,6 +111,9 @@ module Enjoy
105
111
  autoload :EmbeddedGalleryImage, 'enjoy/models/mongoid/embedded_gallery_image'
106
112
  autoload :GalleryImage, 'enjoy/models/mongoid/gallery_image'
107
113
  autoload :Gallery, 'enjoy/models/mongoid/gallery'
114
+
115
+ autoload :PageBlock, 'enjoy/models/mongoid/page_block'
116
+ autoload :PageBlockset, 'enjoy/models/mongoid/page_blockset'
108
117
  end
109
118
 
110
119
  module ActiveRecord
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: enjoy_cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0.3
4
+ version: 0.3.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Kiseliev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-22 00:00:00.000000000 Z
11
+ date: 2016-02-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -483,6 +483,8 @@ files:
483
483
  - app/models/concerns/enjoy/decorators/menu.rb
484
484
  - app/models/concerns/enjoy/decorators/news.rb
485
485
  - app/models/concerns/enjoy/decorators/page.rb
486
+ - app/models/concerns/enjoy/decorators/page_block.rb
487
+ - app/models/concerns/enjoy/decorators/page_blockset.rb
486
488
  - app/models/concerns/enjoy/decorators/seo.rb
487
489
  - app/models/concerns/enjoy/decorators/sitemap_data.rb
488
490
  - app/models/concerns/enjoy/enableable.rb