ack_rocket_cms 0.7.4.1 → 0.7.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: fb751cd827d9540b4607b9541a55463389644be3
4
- data.tar.gz: 9951979bcb4420849d5c191ff4a5902da153a603
3
+ metadata.gz: 557908fc1b5dd12ceb8c379fd207afec464532e9
4
+ data.tar.gz: cccd441d5f529a2665214556282d0e36f4c56578
5
5
  SHA512:
6
- metadata.gz: c4737b9ace9b011bb6fae56bfc62731dd386331ab7c8747d30041f1df9fd2bf346e3319c2eeca8815f0dc27c947eb3383df87a3122f4404ced57aa9c5af55f98
7
- data.tar.gz: 7112e4a686cf41efc081eb2d13fbe73f39a514e4a00aa001ac97c93eb0a1c2d2d7cf9cacfe0713767c2a53d691c41c9d9c425f9ec50273cdf443a28823939790
6
+ metadata.gz: 6253ead7989b587f991c532c522b3fe5fe9f7a02f3a635d328b5dba330bfc379252db2b61e4181498fef586e6ce7475f8f64f322b15b4c6997a6458a1a61050d
7
+ data.tar.gz: b96eb825f88427b488d991079db2e1653e32e1e0d632e960411410e2bb1b4b9ca8f9151b9a42b2f46690e55f1ee1129c8be8d898f858631d53d34e697366121b
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ack_rocket_cms (0.7.4.1)
4
+ ack_rocket_cms (0.7.5)
5
5
  addressable
6
6
  ckeditor
7
7
  coffee-rails
@@ -0,0 +1,13 @@
1
+ if RocketCMS.mongoid?
2
+ class EmbeddedElement
3
+ include RocketCMS::Models::EmbeddedElement
4
+ RocketCMS.apply_patches self
5
+
6
+ # use it in inherited model
7
+ #rails_admin &RocketCMS.embedded_image_config
8
+
9
+ # use it in rails_admin in parent model for sort
10
+ # sort_embedded({fields: [:embedded_field_1, :embedded_field_2...]})
11
+ # or u need to override rails_admin in inherited model to add sort field
12
+ end
13
+ end
@@ -1,5 +1,5 @@
1
1
  if RocketCMS.mongoid?
2
- class EmbeddedGalleryImage
2
+ class EmbeddedGalleryImage < EmbeddedElement
3
3
  include RocketCMS::Models::EmbeddedGalleryImage
4
4
  RocketCMS.apply_patches self
5
5
 
@@ -63,7 +63,7 @@ RailsAdmin.config do |config|
63
63
  config.excluded_models = [
64
64
  'RailsAdmin::CustomShowInApp', 'HistoryTracker',
65
65
  'Ckeditor::Asset', 'Ckeditor::AttachmentFile', 'Ckeditor::Picture',
66
- 'EmbeddedGalleryImage'
66
+ 'EmbeddedGalleryImage', 'EmbeddedElement'
67
67
  ]
68
68
  end
69
69
 
@@ -74,7 +74,8 @@ module RocketCMS
74
74
  end
75
75
  RocketCMS.only_patches self, [:show, :export]
76
76
  nested_set({
77
- max_depth: RocketCMS.configuration.menu_max_depth
77
+ max_depth: RocketCMS.configuration.menu_max_depth,
78
+ scopes: []
78
79
  })
79
80
  }
80
81
  end
@@ -164,13 +165,28 @@ module RocketCMS
164
165
 
165
166
 
166
167
 
167
- def embedded_image_config
168
+ def embedded_element_config(navigation_label = I18n.t('rs.cms'), fields = {})
168
169
  Proc.new {
170
+ navigation_label(navigation_label) unless navigation_label.nil?
169
171
  field :enabled, :toggle
170
172
  field :name, :string
171
- field :image
173
+ fields.each_pair do |name, type|
174
+ if type.nil?
175
+ field name
176
+ else
177
+ field name, type
178
+ end
179
+ end
172
180
  }
181
+ end
173
182
 
183
+ def embedded_image_config
184
+ RocketCMS.embedded_element_config(
185
+ nil,
186
+ {
187
+ image: nil
188
+ }
189
+ )
174
190
  end
175
191
 
176
192
  def gallery_config
@@ -0,0 +1,11 @@
1
+ module RocketCMS
2
+ module Models
3
+ module EmbeddedElement
4
+ extend ActiveSupport::Concern
5
+ include RocketCMS::Model
6
+ include Enableable
7
+ include Sortable
8
+ include RocketCMS.orm_specific('EmbeddedElement')
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,13 @@
1
+ module RocketCMS
2
+ module Models
3
+ module Mongoid
4
+ module EmbeddedElement
5
+ extend ActiveSupport::Concern
6
+
7
+ included do
8
+ field :name, type: String, localize: RocketCMS.configuration.localize
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -8,7 +8,7 @@ module RocketCMS
8
8
  included do
9
9
  #embedded_in :model # need to override
10
10
 
11
- field :name, type: String, localize: RocketCMS.configuration.localize
11
+ include EmbeddedElement
12
12
 
13
13
  has_mongoid_attached_file :image # need to override
14
14
  validates_attachment :image, content_type: { content_type: ["image/jpg", "image/jpeg", "image/png"] }
@@ -1,3 +1,3 @@
1
1
  module RocketCMS
2
- VERSION = "0.7.4.1"
2
+ VERSION = "0.7.5"
3
3
  end
data/lib/rocket_cms.rb CHANGED
@@ -61,6 +61,8 @@ module RocketCMS
61
61
  autoload :News, 'rocket_cms/models/news'
62
62
  autoload :ContactMessage, 'rocket_cms/models/contact_message'
63
63
 
64
+ autoload :EmbeddedElement, 'rocket_cms/models/embedded_element'
65
+
64
66
  autoload :EmbeddedGalleryImage, 'rocket_cms/models/embedded_gallery_image'
65
67
  autoload :GalleryImage, 'rocket_cms/models/gallery_image'
66
68
  autoload :Gallery, 'rocket_cms/models/gallery'
@@ -71,6 +73,8 @@ module RocketCMS
71
73
  autoload :News, 'rocket_cms/models/mongoid/news'
72
74
  autoload :ContactMessage, 'rocket_cms/models/mongoid/contact_message'
73
75
 
76
+ autoload :EmbeddedElement, 'rocket_cms/models/mongoid/embedded_element'
77
+
74
78
  autoload :EmbeddedGalleryImage, 'rocket_cms/models/mongoid/embedded_gallery_image'
75
79
  autoload :GalleryImage, 'rocket_cms/models/mongoid/gallery_image'
76
80
  autoload :Gallery, 'rocket_cms/models/mongoid/gallery'
data/template.rb CHANGED
@@ -592,6 +592,11 @@ sudo /etc/init.d/god_bootup_#{app_name.downcase}
592
592
  TEXT
593
593
  end
594
594
 
595
+ inject_into_file 'config/initializers/assets.rb', before: /\z/ do <<-TEXT
596
+ Rails.application.config.assets.precompile += %w( ckeditor/* )
597
+ TEXT
598
+ end
599
+
595
600
 
596
601
 
597
602
  if mongoid
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ack_rocket_cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.4.1
4
+ version: 0.7.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - glebtv
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-03-23 00:00:00.000000000 Z
12
+ date: 2015-03-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -412,6 +412,7 @@ files:
412
412
  - app/models/concerns/sort_field.rb
413
413
  - app/models/concerns/sortable.rb
414
414
  - app/models/contact_message.rb
415
+ - app/models/embedded_element.rb
415
416
  - app/models/embedded_gallery_image.rb
416
417
  - app/models/gallery.rb
417
418
  - app/models/gallery_image.rb
@@ -493,11 +494,13 @@ files:
493
494
  - lib/rocket_cms/models/active_record/news.rb
494
495
  - lib/rocket_cms/models/active_record/page.rb
495
496
  - lib/rocket_cms/models/contact_message.rb
497
+ - lib/rocket_cms/models/embedded_element.rb
496
498
  - lib/rocket_cms/models/embedded_gallery_image.rb
497
499
  - lib/rocket_cms/models/gallery.rb
498
500
  - lib/rocket_cms/models/gallery_image.rb
499
501
  - lib/rocket_cms/models/menu.rb
500
502
  - lib/rocket_cms/models/mongoid/contact_message.rb
503
+ - lib/rocket_cms/models/mongoid/embedded_element.rb
501
504
  - lib/rocket_cms/models/mongoid/embedded_gallery_image.rb
502
505
  - lib/rocket_cms/models/mongoid/gallery.rb
503
506
  - lib/rocket_cms/models/mongoid/gallery_image.rb