ack_rocket_cms 0.8.2 → 0.9

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: 6e33e7acc64054a4dd51d9937ebe3d041f6feabd
4
- data.tar.gz: ea547035e193c9a8e691588f3304787191aa790a
3
+ metadata.gz: 5e35b8bd53dfff5fe5474dbf033c3ac8a2830cf7
4
+ data.tar.gz: f6d188b33c9618a88a7b5737a0ab4811ff42027e
5
5
  SHA512:
6
- metadata.gz: 90706ad746c30a490c29e78ee23f5219ae7cb8ab283e222aad489f416385c15970f037eb24fca56cb368f0316ea8a1ed0597e61b4ebea0e06f4988990303563f
7
- data.tar.gz: 7768a9ebaabb4120f7bbff96d0e4e15560e36c7fff30aa4a123af590585ef8aa84f3829372520ab20278b1da55f4b4ae38457ea93043e02f506d7aba52cbf903
6
+ metadata.gz: 5283a162baddab8afb493637a3e62b668c52a921278c01ecd0ecb63290e1d256cb38cb478fccaceef2a5526aef8a1f970c35e532edc106b044e1245204e0207b
7
+ data.tar.gz: 036880209f68f49eb5785af5ad8eb83f36f9a969a0915c2e544591fe4af2e90bb4a7010e89df3e9ec1f7de91f93c076577b2507f692c2f518fb182a330cc7049
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.2.2
1
+ 2.2.3
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ack_rocket_cms (0.8.2)
4
+ ack_rocket_cms (0.9)
5
5
  ack_rails_admin_jcrop
6
6
  addressable
7
7
  ckeditor
@@ -34,36 +34,36 @@ GEM
34
34
  mini_magick
35
35
  rails (>= 3.0.0)
36
36
  rails_admin (>= 0.3.0)
37
- actionmailer (4.2.3)
38
- actionpack (= 4.2.3)
39
- actionview (= 4.2.3)
40
- activejob (= 4.2.3)
37
+ actionmailer (4.2.4)
38
+ actionpack (= 4.2.4)
39
+ actionview (= 4.2.4)
40
+ activejob (= 4.2.4)
41
41
  mail (~> 2.5, >= 2.5.4)
42
42
  rails-dom-testing (~> 1.0, >= 1.0.5)
43
- actionpack (4.2.3)
44
- actionview (= 4.2.3)
45
- activesupport (= 4.2.3)
43
+ actionpack (4.2.4)
44
+ actionview (= 4.2.4)
45
+ activesupport (= 4.2.4)
46
46
  rack (~> 1.6)
47
47
  rack-test (~> 0.6.2)
48
48
  rails-dom-testing (~> 1.0, >= 1.0.5)
49
49
  rails-html-sanitizer (~> 1.0, >= 1.0.2)
50
- actionview (4.2.3)
51
- activesupport (= 4.2.3)
50
+ actionview (4.2.4)
51
+ activesupport (= 4.2.4)
52
52
  builder (~> 3.1)
53
53
  erubis (~> 2.7.0)
54
54
  rails-dom-testing (~> 1.0, >= 1.0.5)
55
55
  rails-html-sanitizer (~> 1.0, >= 1.0.2)
56
- activejob (4.2.3)
57
- activesupport (= 4.2.3)
56
+ activejob (4.2.4)
57
+ activesupport (= 4.2.4)
58
58
  globalid (>= 0.3.0)
59
- activemodel (4.2.3)
60
- activesupport (= 4.2.3)
59
+ activemodel (4.2.4)
60
+ activesupport (= 4.2.4)
61
61
  builder (~> 3.1)
62
- activerecord (4.2.3)
63
- activemodel (= 4.2.3)
64
- activesupport (= 4.2.3)
62
+ activerecord (4.2.4)
63
+ activemodel (= 4.2.4)
64
+ activesupport (= 4.2.4)
65
65
  arel (~> 6.0)
66
- activesupport (4.2.3)
66
+ activesupport (4.2.4)
67
67
  i18n (~> 0.7)
68
68
  json (~> 1.7, >= 1.7.7)
69
69
  minitest (~> 5.1)
@@ -72,9 +72,9 @@ GEM
72
72
  addressable (2.3.8)
73
73
  arel (6.0.3)
74
74
  bcrypt (3.1.10)
75
- bson (3.2.1)
75
+ bson (3.2.6)
76
76
  builder (3.2.2)
77
- ckeditor (4.1.3)
77
+ ckeditor (4.1.4)
78
78
  cocaine
79
79
  orm_adapter (~> 0.5.0)
80
80
  climate_control (0.0.3)
@@ -88,7 +88,6 @@ GEM
88
88
  coffee-script-source
89
89
  execjs
90
90
  coffee-script-source (1.9.1.1)
91
- connection_pool (2.2.0)
92
91
  devise (3.5.2)
93
92
  bcrypt (~> 3.0)
94
93
  orm_adapter (~> 0.1)
@@ -97,10 +96,10 @@ GEM
97
96
  thread_safe (~> 0.1)
98
97
  warden (~> 1.2.3)
99
98
  erubis (2.7.0)
100
- execjs (2.5.2)
99
+ execjs (2.6.0)
101
100
  font-awesome-rails (4.4.0.0)
102
101
  railties (>= 3.2, < 5.0)
103
- geocoder (1.2.9)
102
+ geocoder (1.2.11)
104
103
  glebtv-simple_captcha (0.6.7)
105
104
  globalid (0.3.6)
106
105
  activesupport (>= 4.1.0)
@@ -108,7 +107,7 @@ GEM
108
107
  tilt
109
108
  htmlentities (4.3.4)
110
109
  i18n (0.7.0)
111
- jquery-rails (4.0.4)
110
+ jquery-rails (4.0.5)
112
111
  rails-dom-testing (~> 1.0)
113
112
  railties (>= 4.2.0)
114
113
  thor (>= 0.14, < 2.0)
@@ -118,27 +117,24 @@ GEM
118
117
  kaminari (0.16.3)
119
118
  actionpack (>= 3.0.0)
120
119
  activesupport (>= 3.0.0)
121
- loofah (2.0.2)
120
+ loofah (2.0.3)
122
121
  nokogiri (>= 1.5.9)
123
122
  mail (2.6.3)
124
123
  mime-types (>= 1.16, < 3)
125
- mime-types (2.6.1)
126
- mini_magick (4.2.10)
124
+ mime-types (2.6.2)
125
+ mini_magick (4.3.6)
127
126
  mini_portile (0.6.2)
128
- minitest (5.8.0)
129
- mongoid (4.0.2)
127
+ minitest (5.8.1)
128
+ mongo (2.1.1)
129
+ bson (~> 3.0)
130
+ mongoid (5.0.0)
130
131
  activemodel (~> 4.0)
131
- moped (~> 2.0.0)
132
+ mongo (~> 2.1)
132
133
  origin (~> 2.1)
133
134
  tzinfo (>= 0.3.37)
134
- moped (2.0.6)
135
- bson (~> 3.0)
136
- connection_pool (~> 2.0)
137
- optionable (~> 0.2.0)
138
135
  nested_form (0.3.2)
139
136
  nokogiri (1.6.6.2)
140
137
  mini_portile (~> 0.6.0)
141
- optionable (0.2.0)
142
138
  origin (2.1.1)
143
139
  orm_adapter (0.5.0)
144
140
  rack (1.6.4)
@@ -147,26 +143,26 @@ GEM
147
143
  rack (~> 1.1)
148
144
  rack-test (0.6.3)
149
145
  rack (>= 1.0)
150
- rails (4.2.3)
151
- actionmailer (= 4.2.3)
152
- actionpack (= 4.2.3)
153
- actionview (= 4.2.3)
154
- activejob (= 4.2.3)
155
- activemodel (= 4.2.3)
156
- activerecord (= 4.2.3)
157
- activesupport (= 4.2.3)
146
+ rails (4.2.4)
147
+ actionmailer (= 4.2.4)
148
+ actionpack (= 4.2.4)
149
+ actionview (= 4.2.4)
150
+ activejob (= 4.2.4)
151
+ activemodel (= 4.2.4)
152
+ activerecord (= 4.2.4)
153
+ activesupport (= 4.2.4)
158
154
  bundler (>= 1.3.0, < 2.0)
159
- railties (= 4.2.3)
155
+ railties (= 4.2.4)
160
156
  sprockets-rails
161
157
  rails-deprecated_sanitizer (1.0.3)
162
158
  activesupport (>= 4.2.0.alpha)
163
- rails-dom-testing (1.0.6)
159
+ rails-dom-testing (1.0.7)
164
160
  activesupport (>= 4.2.0.beta, < 5.0)
165
161
  nokogiri (~> 1.6.0)
166
162
  rails-deprecated_sanitizer (>= 1.0.1)
167
163
  rails-html-sanitizer (1.0.2)
168
164
  loofah (~> 2.0)
169
- rails_admin (0.6.8)
165
+ rails_admin (0.7.0)
170
166
  builder (~> 3.1)
171
167
  coffee-rails (~> 4.0)
172
168
  font-awesome-rails (>= 3.0, < 5)
@@ -190,9 +186,9 @@ GEM
190
186
  rails_admin_settings (1.0.1)
191
187
  rails_admin_toggleable (0.5.1)
192
188
  rails_admin
193
- railties (4.2.3)
194
- actionpack (= 4.2.3)
195
- activesupport (= 4.2.3)
189
+ railties (4.2.4)
190
+ actionpack (= 4.2.4)
191
+ activesupport (= 4.2.4)
196
192
  rake (>= 0.8.7)
197
193
  thor (>= 0.18.1, < 2.0)
198
194
  rake (10.4.2)
@@ -200,16 +196,16 @@ GEM
200
196
  responders (2.1.0)
201
197
  railties (>= 4.2.0, < 5)
202
198
  safe_yaml (1.0.4)
203
- sass (3.4.16)
204
- sass-rails (5.0.3)
199
+ sass (3.4.19)
200
+ sass-rails (5.0.4)
205
201
  railties (>= 4.0.0, < 5.0)
206
202
  sass (~> 3.1)
207
203
  sprockets (>= 2.8, < 4.0)
208
204
  sprockets-rails (>= 2.0, < 4.0)
209
- tilt (~> 1.1)
205
+ tilt (>= 1.1, < 3)
210
206
  simple-navigation (4.0.3)
211
207
  activesupport (>= 2.3.2)
212
- simple_form (3.1.0)
208
+ simple_form (3.2.0)
213
209
  actionpack (~> 4.0)
214
210
  activemodel (~> 4.0)
215
211
  sitemap_generator (5.1.0)
@@ -217,16 +213,16 @@ GEM
217
213
  smart_excerpt (0.1.5)
218
214
  activesupport
219
215
  htmlentities
220
- sprockets (3.2.0)
221
- rack (~> 1.0)
222
- sprockets-rails (2.3.2)
216
+ sprockets (3.4.0)
217
+ rack (> 1, < 3)
218
+ sprockets-rails (2.3.3)
223
219
  actionpack (>= 3.0)
224
220
  activesupport (>= 3.0)
225
221
  sprockets (>= 2.8, < 4.0)
226
222
  stringex (2.5.2)
227
223
  thor (0.19.1)
228
224
  thread_safe (0.3.5)
229
- tilt (1.4.1)
225
+ tilt (2.0.1)
230
226
  turbolinks (2.5.3)
231
227
  coffee-rails
232
228
  tzinfo (1.2.2)
@@ -248,4 +244,4 @@ DEPENDENCIES
248
244
  rake
249
245
 
250
246
  BUNDLED WITH
251
- 1.10.2
247
+ 1.10.6
@@ -84,7 +84,7 @@ module RsErrors
84
84
  end
85
85
 
86
86
  def render_error(code = 500)
87
- render template: "errors/error_#{code}", formats: [:html], handlers: [:haml, :slim], layout: RocketCMS.config.error_layout, status: code
87
+ render template: "errors/error_#{code}", formats: [:html], handlers: [:slim], layout: RocketCMS.config.error_layout, status: code
88
88
  end
89
89
 
90
90
  def rails_admin?
@@ -17,7 +17,7 @@ module RsMenu
17
17
  cr = item.clean_regexp
18
18
  navigation_item(primary, item, block)
19
19
  end
20
-
20
+
21
21
  def navigation_item(primary, item, block=nil)
22
22
  url = nav_get_url(item)
23
23
  if block.nil?
@@ -32,10 +32,10 @@ module RsMenu
32
32
  SimpleNavigation.config.autogenerate_item_ids = false
33
33
  begin
34
34
  nav_extra_data_before(type, primary)
35
- items = nav_get_menu_items(type)
36
- items = items.select { |i| i.parent_id.nil? && !i.name.blank? && i.enabled }
35
+ all_items = nav_get_menu_items(type)
36
+ items = all_items.select { |i| i.parent_id.nil? && !i.name.blank? && i.enabled }
37
37
  items.each do |item|
38
- render_with_subs(items, primary, item)
38
+ render_with_subs(all_items, primary, item)
39
39
  end
40
40
  nav_extra_data_after(type, primary)
41
41
  rescue Exception => exception
@@ -62,4 +62,3 @@ module RsMenu
62
62
  # override for additional config or items
63
63
  end
64
64
  end
65
-
@@ -19,7 +19,7 @@ module RocketCMS
19
19
  end
20
20
  }
21
21
  end
22
-
22
+
23
23
  def seo_config(is_active = true)
24
24
  Proc.new {
25
25
  if respond_to?(:active)
@@ -51,7 +51,7 @@ module RocketCMS
51
51
  end
52
52
  end
53
53
  end
54
-
54
+
55
55
  def page_config(fields = {})
56
56
  Proc.new {
57
57
  RocketCMS.apply_patches self
@@ -124,7 +124,7 @@ module RocketCMS
124
124
  end
125
125
  }
126
126
  end
127
-
127
+
128
128
  def menu_config
129
129
  Proc.new {
130
130
  navigation_label 'CMS'
@@ -140,11 +140,11 @@ module RocketCMS
140
140
  end
141
141
  }
142
142
  end
143
-
143
+
144
144
  def contact_message_config
145
145
  Proc.new {
146
146
  navigation_label I18n.t('rs.settings')
147
- field :created_at do
147
+ field :c_at do
148
148
  read_only true
149
149
  end
150
150
  field :name
@@ -152,12 +152,21 @@ module RocketCMS
152
152
  field :email
153
153
  field :phone
154
154
 
155
- RocketCMS.apply_patches self
156
- RocketCMS.only_patches self, [:show, :list, :edit, :export]
155
+ RocketCMS.config.contacts_fields.each_pair do |fn, ft|
156
+ next if ft.nil?
157
+ if ft.is_a?(Array)
158
+ field fn, ft[1].to_sym
159
+ else
160
+ field fn
161
+ end
162
+ end
157
163
 
158
164
  if block_given?
159
165
  yield
160
166
  end
167
+
168
+ RocketCMS.apply_patches self
169
+ RocketCMS.only_patches self, [:show, :list, :edit, :export]
161
170
  }
162
171
  end
163
172
 
@@ -17,6 +17,13 @@ module RocketCMS
17
17
 
18
18
  scope :sorted, -> { order_by([:lft, :asc]) }
19
19
  scope :menu, ->(menu_id) { enabled.sorted.where(menu_ids: menu_id) }
20
+
21
+ def page_h1
22
+ _ret = h1
23
+ _ret = name if _ret.blank?
24
+ _ret = title if _ret.blank?
25
+ _ret
26
+ end
20
27
  end
21
28
  end
22
29
  end
@@ -1,3 +1,3 @@
1
1
  module RocketCMS
2
- VERSION = "0.8.2"
2
+ VERSION = "0.9"
3
3
  end
data/template.rb CHANGED
@@ -14,7 +14,7 @@ remove_file 'Gemfile'
14
14
  create_file 'Gemfile' do <<-TEXT
15
15
  source 'https://rubygems.org'
16
16
 
17
- gem 'rails', '4.2.3'
17
+ gem 'rails', '4.2.4'
18
18
  #{if mongoid then "gem 'mongoid', '~> 4.0.0'" else "gem 'pg'" end}
19
19
 
20
20
  # gem 'sass'
@@ -56,6 +56,8 @@ group :development do
56
56
 
57
57
  gem 'favicon_maker', '0.3'
58
58
  gem 'favicon_maker_rails'
59
+
60
+ gem 'rails_email_preview', '~> 0.2.29'
59
61
  end
60
62
 
61
63
  group :test do
@@ -105,6 +107,78 @@ end
105
107
 
106
108
  create_file 'extra/.gitkeep', ''
107
109
 
110
+ generate 'rails_email_preview:install'
111
+ remove_file 'app/mailer_previews/contact_mailer_preview.rb'
112
+ create_file 'app/mailer_previews/contact_mailer_preview.rb' do <<-TEXT
113
+ class ContactMailerPreview
114
+ def new_message_email
115
+ ContactMailer.new_message_email(ContactMessage.all.to_a.sample)
116
+ end
117
+ end
118
+ TEXT
119
+ end
120
+
121
+ if mongoid
122
+ remove_file 'config/initializers/embedded_findable.rb'
123
+ create_file 'config/initializers/embedded_findable.rb' do <<-TEXT
124
+ module Mongoid
125
+
126
+ # Helps to override find method in an embedded document.
127
+ # Usage :
128
+ # - add to your model "include Mongoid::EmbeddedFindable"
129
+ # - override find method with:
130
+ # def self.find(id)
131
+ # find_through(Book, 'chapter', id)
132
+ # end
133
+ module EmbeddedFindable
134
+
135
+ extend ActiveSupport::Concern
136
+
137
+ included do
138
+
139
+ # Search an embedded document by id.
140
+ #
141
+ # Document is stored within embedding_class collection, and can be accessed through provided relation.
142
+ # Also supports chained relationships (if the searched document is nested in several embedded documents)
143
+ #
144
+ # Example, with a chapter embedded in a book, the book being embedded in a library.
145
+ # use find_through(Library, "books", book_id) in Book class
146
+ # and find_through(Library, "books.chapters", chapter_id) in Chapter class
147
+ def self.find_through(embedding_class, relation, id = nil)
148
+ return nil if id.nil? || id.blank?
149
+
150
+ id = BSON::ObjectId.from_string(id) if id.is_a?(String)
151
+ relation = relation.to_s unless relation.is_a?(String)
152
+
153
+ relation_parts = relation.split('.')
154
+ parent = embedding_class.send(:all)
155
+
156
+ while relation_parts.length > 0
157
+ item = if parent.is_a?(Mongoid::Criteria) || parent.is_a?(Array)
158
+ parent.where("#{relation_parts.join('.')}._id" => id).first
159
+ else
160
+ parent
161
+ end
162
+ return nil if item.nil?
163
+ parent = item.send(relation_parts.shift)
164
+ end
165
+
166
+ if parent.is_a?(Mongoid::Criteria) || parent.is_a?(Array)
167
+ parent.where('_id' => id).first
168
+ else
169
+ parent
170
+ end
171
+ end
172
+
173
+ end
174
+
175
+ end
176
+
177
+ end
178
+ TEXT
179
+ end
180
+ end
181
+
108
182
  if mongoid
109
183
  remove_file 'config/initializers/cookies_serializer.rb'
110
184
  create_file 'config/initializers/cookies_serializer.rb' do <<-TEXT
@@ -145,7 +219,7 @@ end
145
219
 
146
220
  create_file 'README.md', "## #{app_name}\nProject generated by RocketCMS\nORM: #{if mongoid then 'Mongoid' else 'ActiveRecord' end}\n\n"
147
221
 
148
- create_file '.ruby-version', "2.2.2\n"
222
+ create_file '.ruby-version', "2.2.3\n"
149
223
  create_file '.ruby-gemset', "#{app_name}\n"
150
224
 
151
225
  run 'bundle install --without production'
@@ -424,7 +498,7 @@ body.rails_admin .modal
424
498
  margin: 0 auto !important
425
499
  .modal-dialog
426
500
  width: 990px !important
427
-
501
+
428
502
  input[type=checkbox]
429
503
  width: 30px !important
430
504
 
@@ -633,4 +707,3 @@ end
633
707
  git :init
634
708
  git add: "."
635
709
  git commit: %Q{ -m 'Initial commit' }
636
-
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.8.2
4
+ version: '0.9'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Kiseliev
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-08-11 00:00:00.000000000 Z
12
+ date: 2015-10-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -566,7 +566,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
566
566
  version: '0'
567
567
  requirements: []
568
568
  rubyforge_project:
569
- rubygems_version: 2.4.7
569
+ rubygems_version: 2.4.8
570
570
  signing_key:
571
571
  specification_version: 4
572
572
  summary: Please DO NOT use this gem directly, use ack_rocket_cms_mongoid or ack_rocket_cms_activerecord