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 +4 -4
- data/Gemfile.lock +1 -1
- data/app/models/embedded_element.rb +13 -0
- data/app/models/embedded_gallery_image.rb +1 -1
- data/lib/generators/rocket_cms/templates/admin.erb +1 -1
- data/lib/rocket_cms/admin.rb +19 -3
- data/lib/rocket_cms/models/embedded_element.rb +11 -0
- data/lib/rocket_cms/models/mongoid/embedded_element.rb +13 -0
- data/lib/rocket_cms/models/mongoid/embedded_gallery_image.rb +1 -1
- data/lib/rocket_cms/version.rb +1 -1
- data/lib/rocket_cms.rb +4 -0
- data/template.rb +5 -0
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 557908fc1b5dd12ceb8c379fd207afec464532e9
|
4
|
+
data.tar.gz: cccd441d5f529a2665214556282d0e36f4c56578
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6253ead7989b587f991c532c522b3fe5fe9f7a02f3a635d328b5dba330bfc379252db2b61e4181498fef586e6ce7475f8f64f322b15b4c6997a6458a1a61050d
|
7
|
+
data.tar.gz: b96eb825f88427b488d991079db2e1653e32e1e0d632e960411410e2bb1b4b9ca8f9151b9a42b2f46690e55f1ee1129c8be8d898f858631d53d34e697366121b
|
data/Gemfile.lock
CHANGED
@@ -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
|
@@ -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
|
|
data/lib/rocket_cms/admin.rb
CHANGED
@@ -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
|
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
|
-
|
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
|
@@ -8,7 +8,7 @@ module RocketCMS
|
|
8
8
|
included do
|
9
9
|
#embedded_in :model # need to override
|
10
10
|
|
11
|
-
|
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"] }
|
data/lib/rocket_cms/version.rb
CHANGED
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
|
+
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-
|
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
|