enjoy_cms 0.3.0.2 → 0.3.0.3
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/Gemfile.lock +9 -9
- data/app/models/enjoy/page_block.rb +9 -0
- data/app/models/enjoy/page_blockset.rb +9 -0
- data/lib/enjoy/admin/page_block.rb +43 -0
- data/lib/enjoy/admin/page_blockset.rb +43 -0
- data/lib/enjoy/configuration.rb +2 -0
- data/lib/enjoy/models/embedded_gallery_image.rb +1 -4
- data/lib/enjoy/models/mongoid/page_block.rb +15 -0
- data/lib/enjoy/models/mongoid/page_blockset.rb +18 -0
- data/lib/enjoy/models/page_block.rb +12 -0
- data/lib/enjoy/models/page_blockset.rb +14 -0
- data/lib/enjoy/version.rb +1 -1
- metadata +10 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0d4b5b178e611666382fde0a7a3cde395a3286be
|
4
|
+
data.tar.gz: c9ac4904406670aba5e654e24c4a1b1db62f155c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61ec8a5b08fa8100e61233c58b525d0c422227e67798dc6a2d34c4e1a77b28588a933ef889453492c1b7a8dadc552f032c3a9019771e58eec9f6b9fd273221cf
|
7
|
+
data.tar.gz: a35ef5829d329dbc83a7d3000a752663e86d3d87b0fb988a329123125175521a8aa3ee9b7de1e213cb32b102a017ba4c50633c751b65ea9b50a32ce19a503421
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
enjoy_cms (0.3.0.
|
4
|
+
enjoy_cms (0.3.0.3)
|
5
5
|
ack_rails_admin_jcrop
|
6
6
|
addressable
|
7
7
|
ckeditor
|
@@ -76,7 +76,7 @@ GEM
|
|
76
76
|
addressable (2.4.0)
|
77
77
|
arel (6.0.3)
|
78
78
|
bcrypt (3.1.10)
|
79
|
-
bson (4.0.
|
79
|
+
bson (4.0.2)
|
80
80
|
builder (3.2.2)
|
81
81
|
ckeditor (4.1.6)
|
82
82
|
cocaine
|
@@ -106,7 +106,7 @@ GEM
|
|
106
106
|
font-awesome-rails (4.5.0.1)
|
107
107
|
railties (>= 3.2, < 5.1)
|
108
108
|
fspath (2.1.1)
|
109
|
-
geocoder (1.3.
|
109
|
+
geocoder (1.3.1)
|
110
110
|
glebtv-simple_captcha (0.6.7)
|
111
111
|
globalid (0.3.6)
|
112
112
|
activesupport (>= 4.1.0)
|
@@ -114,16 +114,16 @@ GEM
|
|
114
114
|
tilt
|
115
115
|
htmlentities (4.3.4)
|
116
116
|
i18n (0.7.0)
|
117
|
-
image_optim (0.22.
|
117
|
+
image_optim (0.22.1)
|
118
118
|
exifr (~> 1.2, >= 1.2.2)
|
119
119
|
fspath (~> 2.1)
|
120
120
|
image_size (~> 1.3)
|
121
121
|
in_threads (~> 1.3)
|
122
122
|
progress (~> 3.0, >= 3.0.1)
|
123
|
-
image_optim_pack (0.2.1.
|
123
|
+
image_optim_pack (0.2.1.20160221)
|
124
124
|
fspath (~> 2.1)
|
125
125
|
image_optim (~> 0.19)
|
126
|
-
image_size (1.4.
|
126
|
+
image_size (1.4.2)
|
127
127
|
in_threads (1.3.1)
|
128
128
|
jquery-rails (4.1.0)
|
129
129
|
rails-dom-testing (~> 1.0)
|
@@ -139,14 +139,14 @@ GEM
|
|
139
139
|
nokogiri (>= 1.5.9)
|
140
140
|
mail (2.6.3)
|
141
141
|
mime-types (>= 1.16, < 3)
|
142
|
-
mime-types (2.99)
|
142
|
+
mime-types (2.99.1)
|
143
143
|
mimemagic (0.3.0)
|
144
144
|
mini_magick (4.4.0)
|
145
145
|
mini_portile2 (2.0.0)
|
146
146
|
minitest (5.8.4)
|
147
|
-
mongo (2.2.
|
147
|
+
mongo (2.2.3)
|
148
148
|
bson (~> 4.0)
|
149
|
-
mongoid (5.1.
|
149
|
+
mongoid (5.1.1)
|
150
150
|
activemodel (~> 4.0)
|
151
151
|
mongo (~> 2.1)
|
152
152
|
origin (~> 2.2)
|
@@ -0,0 +1,43 @@
|
|
1
|
+
module Enjoy
|
2
|
+
module Admin
|
3
|
+
module PageBlock
|
4
|
+
def self.config(fields = {})
|
5
|
+
Proc.new {
|
6
|
+
# navigation_label 'CMS'
|
7
|
+
|
8
|
+
field :enabled, :toggle
|
9
|
+
field :name
|
10
|
+
|
11
|
+
fields.each_pair do |name, type|
|
12
|
+
if type.nil?
|
13
|
+
field name
|
14
|
+
else
|
15
|
+
if type.is_a?(Array)
|
16
|
+
field name, type[0], &type[1]
|
17
|
+
else
|
18
|
+
field name, type
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
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
|
35
|
+
|
36
|
+
if block_given?
|
37
|
+
yield self
|
38
|
+
end
|
39
|
+
}
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
module Enjoy
|
2
|
+
module Admin
|
3
|
+
module PageBlockset
|
4
|
+
def self.config(fields = {})
|
5
|
+
Proc.new {
|
6
|
+
# navigation_label 'CMS'
|
7
|
+
|
8
|
+
field :enabled, :toggle
|
9
|
+
field :name
|
10
|
+
|
11
|
+
fields.each_pair do |name, type|
|
12
|
+
if type.nil?
|
13
|
+
field name
|
14
|
+
else
|
15
|
+
if type.is_a?(Array)
|
16
|
+
field name, type[0], &type[1]
|
17
|
+
else
|
18
|
+
field name, type
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
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
|
35
|
+
|
36
|
+
if block_given?
|
37
|
+
yield self
|
38
|
+
end
|
39
|
+
}
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
data/lib/enjoy/configuration.rb
CHANGED
@@ -11,6 +11,7 @@ module Enjoy
|
|
11
11
|
end
|
12
12
|
|
13
13
|
class Configuration
|
14
|
+
attr_accessor :news_image_convert_options
|
14
15
|
attr_accessor :news_image_styles
|
15
16
|
attr_accessor :news_per_page
|
16
17
|
attr_accessor :news_excerpt
|
@@ -37,6 +38,7 @@ module Enjoy
|
|
37
38
|
attr_accessor :routes_config
|
38
39
|
|
39
40
|
def initialize
|
41
|
+
@news_image_convert_options {}
|
40
42
|
@news_image_styles = {
|
41
43
|
main: '400x200>',
|
42
44
|
thumb: '200x100>'
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Enjoy
|
2
|
+
module Models
|
3
|
+
module Mongoid
|
4
|
+
module PageBlock
|
5
|
+
extend ActiveSupport::Concern
|
6
|
+
|
7
|
+
include Enjoy::HtmlField
|
8
|
+
|
9
|
+
included do
|
10
|
+
enjoy_cms_html_field :content, type: String, localize: Enjoy.config.localize, default: ""
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module Enjoy
|
2
|
+
module Models
|
3
|
+
module Mongoid
|
4
|
+
module PageBlockset
|
5
|
+
extend ActiveSupport::Concern
|
6
|
+
|
7
|
+
included do
|
8
|
+
field :name, type: String, default: ""
|
9
|
+
|
10
|
+
has_and_belongs_to_many :blocks, inverse_of: :blocksets, class_name: "Enjoy::PageBlock"
|
11
|
+
|
12
|
+
scope :sorted, -> { order_by([:lft, :asc]) }
|
13
|
+
scope :blockset, ->(block_id) { enabled.sorted.where(block_ids: block_id) }
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
data/lib/enjoy/version.rb
CHANGED
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.
|
4
|
+
version: 0.3.0.3
|
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-
|
11
|
+
date: 2016-02-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -504,6 +504,8 @@ files:
|
|
504
504
|
- app/models/enjoy/menu.rb
|
505
505
|
- app/models/enjoy/news.rb
|
506
506
|
- app/models/enjoy/page.rb
|
507
|
+
- app/models/enjoy/page_block.rb
|
508
|
+
- app/models/enjoy/page_blockset.rb
|
507
509
|
- app/models/enjoy/seo.rb
|
508
510
|
- app/models/enjoy/sitemap_data.rb
|
509
511
|
- app/views/blocks/_favicon.html.slim
|
@@ -563,6 +565,8 @@ files:
|
|
563
565
|
- lib/enjoy/admin/menu.rb
|
564
566
|
- lib/enjoy/admin/news.rb
|
565
567
|
- lib/enjoy/admin/page.rb
|
568
|
+
- lib/enjoy/admin/page_block.rb
|
569
|
+
- lib/enjoy/admin/page_blockset.rb
|
566
570
|
- lib/enjoy/admin/seo.rb
|
567
571
|
- lib/enjoy/admin/sitemap_data.rb
|
568
572
|
- lib/enjoy/configuration.rb
|
@@ -596,10 +600,14 @@ files:
|
|
596
600
|
- lib/enjoy/models/mongoid/menu.rb
|
597
601
|
- lib/enjoy/models/mongoid/news.rb
|
598
602
|
- lib/enjoy/models/mongoid/page.rb
|
603
|
+
- lib/enjoy/models/mongoid/page_block.rb
|
604
|
+
- lib/enjoy/models/mongoid/page_blockset.rb
|
599
605
|
- lib/enjoy/models/mongoid/seo.rb
|
600
606
|
- lib/enjoy/models/mongoid/sitemap_data.rb
|
601
607
|
- lib/enjoy/models/news.rb
|
602
608
|
- lib/enjoy/models/page.rb
|
609
|
+
- lib/enjoy/models/page_block.rb
|
610
|
+
- lib/enjoy/models/page_blockset.rb
|
603
611
|
- lib/enjoy/models/seo.rb
|
604
612
|
- lib/enjoy/models/sitemap_data.rb
|
605
613
|
- lib/enjoy/rails_admin_enjoy_html.rb
|