ack_rocket_cms 0.7.2.1 → 0.7.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +6 -6
- data/README.md +6 -6
- data/app/controllers/concerns/rs_pages.rb +27 -0
- data/config/locales/ru.models.yml +3 -0
- data/lib/rocket_cms/admin.rb +13 -0
- data/lib/rocket_cms/controllers/news.rb +5 -0
- data/lib/rocket_cms/controllers/pages.rb +3 -3
- data/lib/rocket_cms/models/menu.rb +0 -1
- data/lib/rocket_cms/version.rb +1 -1
- data/template.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f39cfacc357ca647734190fedd1794b32d728dc
|
4
|
+
data.tar.gz: e073a68790d363d36b7ef180b79f1ce998ba6e1c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd57575bbb83c2207cbbb0202284c9ee9dd28e3402160f21f46f85be82a373cda6102d4058036e9c67716231859985de6c96649b39556eeed95aa757b4a6ec7e
|
7
|
+
data.tar.gz: a29f0e643d30da6c23f5a8667bf02ec0c327533c38a9003b8cbd4a64b0e6e845a6cc33aa01b9ef9118182c7a199e33b01edd4baa7f880356c83f0918fb7773c9
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ack_rocket_cms (0.7.2.
|
4
|
+
ack_rocket_cms (0.7.2.2)
|
5
5
|
addressable
|
6
6
|
coffee-rails
|
7
7
|
devise
|
@@ -75,7 +75,7 @@ GEM
|
|
75
75
|
coffee-script (2.3.0)
|
76
76
|
coffee-script-source
|
77
77
|
execjs
|
78
|
-
coffee-script-source (1.9.
|
78
|
+
coffee-script-source (1.9.1)
|
79
79
|
connection_pool (2.1.1)
|
80
80
|
devise (3.4.1)
|
81
81
|
bcrypt (~> 3.0)
|
@@ -89,7 +89,7 @@ GEM
|
|
89
89
|
font-awesome-rails (4.3.0.0)
|
90
90
|
railties (>= 3.2, < 5.0)
|
91
91
|
geocoder (1.2.7)
|
92
|
-
glebtv-ckeditor (4.4.
|
92
|
+
glebtv-ckeditor (4.4.7)
|
93
93
|
mime-types
|
94
94
|
orm_adapter (~> 0.5.0)
|
95
95
|
rails (~> 4.0)
|
@@ -118,12 +118,12 @@ GEM
|
|
118
118
|
mime-types (2.4.3)
|
119
119
|
mini_portile (0.6.2)
|
120
120
|
minitest (5.5.1)
|
121
|
-
mongoid (4.0.
|
121
|
+
mongoid (4.0.2)
|
122
122
|
activemodel (~> 4.0)
|
123
123
|
moped (~> 2.0.0)
|
124
124
|
origin (~> 2.1)
|
125
125
|
tzinfo (>= 0.3.37)
|
126
|
-
moped (2.0.
|
126
|
+
moped (2.0.4)
|
127
127
|
bson (~> 2.2)
|
128
128
|
connection_pool (~> 2.0)
|
129
129
|
optionable (~> 0.2.0)
|
@@ -193,7 +193,7 @@ GEM
|
|
193
193
|
responders (2.1.0)
|
194
194
|
railties (>= 4.2.0, < 5)
|
195
195
|
safe_yaml (1.0.4)
|
196
|
-
sass (3.4.
|
196
|
+
sass (3.4.12)
|
197
197
|
sass-rails (5.0.1)
|
198
198
|
railties (>= 4.0.0, < 5.0)
|
199
199
|
sass (~> 3.1)
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
rails_admin + mongoid/activerecord + elasticsearch CMS
|
4
4
|
|
5
|
-
Very opinionated and tuned for
|
5
|
+
Very opinionated and tuned for my needs.
|
6
6
|
|
7
7
|
Sorry, no documentation or examples are availiable yet. Stay tuned
|
8
8
|
|
@@ -13,13 +13,13 @@ any time!**
|
|
13
13
|
|
14
14
|
Add this line to your application's Gemfile:
|
15
15
|
|
16
|
-
gem '
|
16
|
+
gem 'ack_rocket_cms_mongoid'
|
17
17
|
|
18
18
|
or:
|
19
19
|
|
20
|
-
gem '
|
20
|
+
gem 'ack_rocket_cms_activerecord'
|
21
21
|
|
22
|
-
*Only PostgreSQL is tested or supported for AR. Others will probably work, but untested.*
|
22
|
+
*Only PostgreSQL is tested or supported for AR(from root repo). Others will probably work, but untested.*
|
23
23
|
|
24
24
|
And then execute:
|
25
25
|
|
@@ -27,7 +27,7 @@ And then execute:
|
|
27
27
|
|
28
28
|
Or install it yourself as:
|
29
29
|
|
30
|
-
$ gem install
|
30
|
+
$ gem install ack_rocket_cms
|
31
31
|
|
32
32
|
For activerecord, generate migrations and run them
|
33
33
|
|
@@ -60,7 +60,7 @@ generator creates a new RVM gemset, so after cd'ing to app dir, you should run `
|
|
60
60
|
|
61
61
|
### Documentation
|
62
62
|
|
63
|
-
It's basically Mongoid + Rails Admin + some of
|
63
|
+
It's basically Mongoid + Rails Admin + some of my common models and controllers, capistrano config (from root repo), etc.
|
64
64
|
|
65
65
|
See their documentation for more info
|
66
66
|
|
@@ -38,4 +38,31 @@ module RsPages
|
|
38
38
|
page
|
39
39
|
end
|
40
40
|
|
41
|
+
|
42
|
+
def find_seo_page_with_redirect(path)
|
43
|
+
do_redirect = false
|
44
|
+
if path[0] != '/'
|
45
|
+
path = '/' + path
|
46
|
+
end
|
47
|
+
if path.length > 1 && path[-1] == '/'
|
48
|
+
path = path[0..-2]
|
49
|
+
do_redirect = true
|
50
|
+
end
|
51
|
+
|
52
|
+
page = Page.enabled.any_of({fullpath: path}, {redirect: path}).first
|
53
|
+
if page.nil?
|
54
|
+
do_redirect = true
|
55
|
+
spath = path.chomp(File.extname(path))
|
56
|
+
if spath != path
|
57
|
+
page = Page.enabled.any_of({fullpath: spath}, {redirect: spath}).first
|
58
|
+
end
|
59
|
+
end
|
60
|
+
if !page.nil? && do_redirect
|
61
|
+
redirect_to path, status: :moved_permanently
|
62
|
+
end
|
63
|
+
|
64
|
+
page
|
65
|
+
|
66
|
+
end
|
67
|
+
|
41
68
|
end
|
data/lib/rocket_cms/admin.rb
CHANGED
@@ -121,6 +121,19 @@ module RocketCMS
|
|
121
121
|
field :image
|
122
122
|
end
|
123
123
|
field :excerpt
|
124
|
+
field :slugs, :enum do
|
125
|
+
enum_method do
|
126
|
+
:slugs
|
127
|
+
end
|
128
|
+
visible do
|
129
|
+
bindings[:view].current_user.admin?
|
130
|
+
end
|
131
|
+
multiple do
|
132
|
+
true
|
133
|
+
end
|
134
|
+
end
|
135
|
+
field :text_slug
|
136
|
+
|
124
137
|
RocketCMS.apply_patches self
|
125
138
|
|
126
139
|
edit do
|
@@ -4,13 +4,13 @@ module RocketCMS
|
|
4
4
|
extend ActiveSupport::Concern
|
5
5
|
def show
|
6
6
|
if @seo_page.nil? || !@seo_page.persisted?
|
7
|
-
|
8
|
-
@seo_page = Page.enabled.find(params[:id])
|
7
|
+
if !params[:id].blank? or !params[:slug].blank?
|
8
|
+
@seo_page = Page.enabled.find(params[:id] || params[:slug])
|
9
9
|
end
|
10
10
|
end
|
11
11
|
if @seo_page.nil?
|
12
12
|
render_404
|
13
|
-
return
|
13
|
+
return true
|
14
14
|
end
|
15
15
|
end
|
16
16
|
end
|
data/lib/rocket_cms/version.rb
CHANGED
data/template.rb
CHANGED
@@ -206,7 +206,7 @@ inject_into_file 'app/models/user.rb', before: /^end/ do <<-TEXT
|
|
206
206
|
|
207
207
|
field :name, type: String
|
208
208
|
field :login, type: String
|
209
|
-
field :roles, type: Array
|
209
|
+
field :roles, type: Array, default: []
|
210
210
|
|
211
211
|
before_save do
|
212
212
|
self.roles.reject! { |r| r.blank? }
|
@@ -342,7 +342,7 @@ admin_pw = SecureRandom.urlsafe_base64(6)
|
|
342
342
|
create_file 'db/seeds.rb' do <<-TEXT
|
343
343
|
admin_pw = "#{admin_pw}"
|
344
344
|
User.destroy_all
|
345
|
-
User.create!(email: 'admin@#{app_name.dasherize.downcase}.ru', password: admin_pw, password_confirmation: admin_pw)
|
345
|
+
User.create!(email: 'admin@#{app_name.dasherize.downcase}.ru', password: admin_pw, password_confirmation: admin_pw, roles: ["admin"])
|
346
346
|
TEXT
|
347
347
|
end
|
348
348
|
|
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.2.
|
4
|
+
version: 0.7.2.2
|
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-02-
|
12
|
+
date: 2015-02-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|