enjoy_cms 0.3.0.2 → 0.3.0.3

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: a31b07bd2773130f799f9cece76e6d15c7f74522
4
- data.tar.gz: 3a01393c4a260036190025c18413a9f201991d58
3
+ metadata.gz: 0d4b5b178e611666382fde0a7a3cde395a3286be
4
+ data.tar.gz: c9ac4904406670aba5e654e24c4a1b1db62f155c
5
5
  SHA512:
6
- metadata.gz: 6ae824740984bb5108a3a4f9be73e5517b2f4a0022bcb1d70076199292db8872818582b2492c440ec753e7891f10e7ced292fa71568e97cff625b77b0a59a80f
7
- data.tar.gz: e6df80fe7c147ee781fa6d9d88d48cdb445aaaaaffac512eb5c1000851e887dc5203ae3d1164a865e9be323106cb50977a05d7c259f3572f6dfb6963de9b9b6b
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.2)
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.1)
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.0)
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.0)
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.20160119)
123
+ image_optim_pack (0.2.1.20160221)
124
124
  fspath (~> 2.1)
125
125
  image_optim (~> 0.19)
126
- image_size (1.4.1)
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.2)
147
+ mongo (2.2.3)
148
148
  bson (~> 4.0)
149
- mongoid (5.1.0)
149
+ mongoid (5.1.1)
150
150
  activemodel (~> 4.0)
151
151
  mongo (~> 2.1)
152
152
  origin (~> 2.2)
@@ -0,0 +1,9 @@
1
+ module Enjoy
2
+ if Enjoy.mongoid?
3
+ class PageBlock < Enjoy::EmbeddedElement
4
+ include Enjoy::Models::PageBlock
5
+
6
+ include Enjoy::Decorators::PageBlock
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ module Enjoy
2
+ if Enjoy.mongoid?
3
+ class PageBlockset
4
+ include Enjoy::Models::PageBlockset
5
+
6
+ include Enjoy::Decorators::PageBlockset
7
+ end
8
+ end
9
+ end
@@ -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
@@ -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>'
@@ -2,10 +2,7 @@ module Enjoy
2
2
  module Models
3
3
  module EmbeddedGalleryImage
4
4
  extend ActiveSupport::Concern
5
- include Enjoy::Model
6
- include Enjoy::Enableable
7
- include Enjoy::Sortable
8
-
5
+
9
6
  include Enjoy.orm_specific('EmbeddedGalleryImage')
10
7
 
11
8
  included do
@@ -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
@@ -0,0 +1,12 @@
1
+ module Enjoy
2
+ module Models
3
+ module PageBlock
4
+ extend ActiveSupport::Concern
5
+
6
+ include Enjoy.orm_specific('PageBlock')
7
+
8
+ included do
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,14 @@
1
+ module Enjoy
2
+ module Models
3
+ module PageBlockset
4
+ extend ActiveSupport::Concern
5
+ include Enjoy::Model
6
+ include Enjoy::Enableable
7
+
8
+ include Enjoy.orm_specific('PageBlockset')
9
+
10
+ included do
11
+ end
12
+ end
13
+ end
14
+ end
data/lib/enjoy/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Enjoy
2
- VERSION = "0.3.0.2"
2
+ VERSION = "0.3.0.3"
3
3
  end
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.2
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-17 00:00:00.000000000 Z
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