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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 71cf0a840e9fc4d90edd0b8e308078414d68d866
4
- data.tar.gz: 38d6511abca3082f32617f41a1c7a7fe7125a969
3
+ metadata.gz: 2f39cfacc357ca647734190fedd1794b32d728dc
4
+ data.tar.gz: e073a68790d363d36b7ef180b79f1ce998ba6e1c
5
5
  SHA512:
6
- metadata.gz: ad84e1aae5374151b462a1cb293289219ca036d2974f4bc4a9281f05fa3329249ea217d77d04bcd746353e1127737b31c400b41d969acf6a11ae5cd335fe93ee
7
- data.tar.gz: 5c06f4eeed839d11ef4d98b076ab62f6b6d8ceb86c1166a746b2df5aa14d5dc2485a7abd4fc74f714b9f602c636f73972075b339133dfea453511bd73a013a24
6
+ metadata.gz: cd57575bbb83c2207cbbb0202284c9ee9dd28e3402160f21f46f85be82a373cda6102d4058036e9c67716231859985de6c96649b39556eeed95aa757b4a6ec7e
7
+ data.tar.gz: a29f0e643d30da6c23f5a8667bf02ec0c327533c38a9003b8cbd4a64b0e6e845a6cc33aa01b9ef9118182c7a199e33b01edd4baa7f880356c83f0918fb7773c9
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ack_rocket_cms (0.7.2.1)
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.0)
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.6)
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.1)
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.3)
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.11)
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 our needs.
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 'rocket_cms_mongoid', github: "ack43/rocket_cms", branch: :master
16
+ gem 'ack_rocket_cms_mongoid'
17
17
 
18
18
  or:
19
19
 
20
- gem 'rocket_cms_activerecord', github: "ack43/rocket_cms", branch: :master
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 rocket_cms
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 our common models and controllers, capistrano config, etc.
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
@@ -46,6 +46,9 @@ ru:
46
46
  attributes:
47
47
  user:
48
48
  email: E-mail
49
+ name: ФИО
50
+ login: Логин
51
+ roles: "Права доступа"
49
52
  old_password: Текущий пароль
50
53
  password: Пароль
51
54
  password_confirmation: Подтвердите пароль
@@ -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
@@ -13,6 +13,11 @@ module RocketCMS
13
13
 
14
14
  def show
15
15
  @news = model.after_now.find(params[:id])
16
+
17
+ if @news and @news.text_slug != params[:id]
18
+ redirect_to @news, status_code: 301
19
+ return true
20
+ end
16
21
  end
17
22
 
18
23
  private
@@ -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
- unless params[:id].blank?
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
@@ -21,7 +21,6 @@ module RocketCMS
21
21
 
22
22
  has_and_belongs_to_many :pages, inverse_of: :menus
23
23
  alias_method :items, :pages
24
- manual_slug :name
25
24
  end
26
25
  end
27
26
  end
@@ -1,3 +1,3 @@
1
1
  module RocketCMS
2
- VERSION = "0.7.2.1"
2
+ VERSION = "0.7.2.2"
3
3
  end
@@ -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.1
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-13 00:00:00.000000000 Z
12
+ date: 2015-02-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler