rocket_cms 0.6.16 → 0.6.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/app/controllers/concerns/rs_errors.rb +8 -3
- data/app/views/errors/_base.html.haml +1 -1
- data/app/views/errors/error_403.html.haml +1 -1
- data/app/views/errors/error_404.html.haml +1 -1
- data/app/views/errors/error_500.html.haml +1 -1
- data/config/locales/en.rs.yml +7 -1
- data/config/locales/ru.rs.yml +6 -0
- data/lib/rocket_cms/models/page.rb +3 -3
- data/lib/rocket_cms/version.rb +1 -1
- 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: 16198fe2f18bbd0394f5d9b7a93d4aaab023752d
|
4
|
+
data.tar.gz: 2514f9a7ae0d80a69b3f118c1e00c650a4491642
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 54a54b0f67863309e193540efafd2a365a0acfbf2a620b6fe38a575244a344ca871fbe238957833b53bbe2213426ef77d5bdb16984ffd0d3b1723b46facdd96b
|
7
|
+
data.tar.gz: 7008fc4c464193874388006dac7bb83dd970600d04e0f3fda9ab343a69e0261eb237b0ac9fbdb15bc7e5fa31de6921e4424c3f5fce1d432c8a425069e3bac339
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rocket_cms (0.6.
|
4
|
+
rocket_cms (0.6.17)
|
5
5
|
addressable
|
6
6
|
coffee-rails
|
7
7
|
devise
|
@@ -190,7 +190,7 @@ GEM
|
|
190
190
|
smart_excerpt (0.1.5)
|
191
191
|
activesupport
|
192
192
|
htmlentities
|
193
|
-
sprockets (3.0.
|
193
|
+
sprockets (3.0.2)
|
194
194
|
rack (~> 1.0)
|
195
195
|
sprockets-rails (2.2.4)
|
196
196
|
actionpack (>= 3.0)
|
@@ -5,6 +5,7 @@ module RsErrors
|
|
5
5
|
rescue_from Exception, with: :render_500
|
6
6
|
rescue_from ActionController::RoutingError, with: :render_404
|
7
7
|
rescue_from ActionController::UnknownController, with: :render_404
|
8
|
+
rescue_from ActionController::MissingFile, with: :render_404
|
8
9
|
rescue_from AbstractController::ActionNotFound, with: :render_404
|
9
10
|
if RocketCMS.mongoid?
|
10
11
|
rescue_from Mongoid::Errors::DocumentNotFound, with: :render_404
|
@@ -22,10 +23,14 @@ module RsErrors
|
|
22
23
|
#redirect_to scope.new_user_session_path, alert: "Необходимо авторизоваться"
|
23
24
|
authenticate_user!
|
24
25
|
else
|
25
|
-
redirect_to '/', alert:
|
26
|
+
redirect_to '/', alert: t('rs.errors.access_denied')
|
26
27
|
end
|
27
28
|
end
|
28
29
|
end
|
30
|
+
|
31
|
+
rescue_from ActionController::InvalidAuthenticityToken do |exception|
|
32
|
+
redirect_to '/', alert: t('rs.errors.form_expired')
|
33
|
+
end
|
29
34
|
end
|
30
35
|
|
31
36
|
protected
|
@@ -45,8 +50,8 @@ module RsErrors
|
|
45
50
|
Rails.logger.error exception.backtrace.join("\n")
|
46
51
|
capture_exception(exception) if defined?(Raven)
|
47
52
|
begin
|
48
|
-
if
|
49
|
-
render text: '
|
53
|
+
if rails_admin?
|
54
|
+
render text: t('rs.errors.internal_error'), status: 500
|
50
55
|
return
|
51
56
|
end
|
52
57
|
rescue
|
@@ -1 +1 @@
|
|
1
|
-
= render 'errors/base', code: 403, text: '
|
1
|
+
= render 'errors/base', code: 403, text: t('rs.errors.access_denied')
|
@@ -1 +1 @@
|
|
1
|
-
= render 'errors/base', code: 404, text: '
|
1
|
+
= render 'errors/base', code: 404, text: t('rs.errors.not_found')
|
@@ -1 +1 @@
|
|
1
|
-
= render 'errors/base', code: 500, text: '
|
1
|
+
= render 'errors/base', code: 500, text: t('rs.errors.internal_error')
|
data/config/locales/en.rs.yml
CHANGED
@@ -15,4 +15,10 @@ en:
|
|
15
15
|
enabled: 'added to menu "%{menu}"'
|
16
16
|
disabled: 'deleted from menu "%{menu}"'
|
17
17
|
error: "Error: %{err}"
|
18
|
-
no_id: "No ID"
|
18
|
+
no_id: "No ID"
|
19
|
+
errors:
|
20
|
+
title: "Error %{code}"
|
21
|
+
form_expired: "Token expired"
|
22
|
+
internal_error: "Internal error"
|
23
|
+
access_denied: "Access denied"
|
24
|
+
not_found: 'The requested page was not found on this server'
|
data/config/locales/ru.rs.yml
CHANGED
@@ -16,3 +16,9 @@ ru:
|
|
16
16
|
disabled: 'удалено из меню "%{menu}"'
|
17
17
|
error: "Ошибка: %{err}"
|
18
18
|
no_id: "Не указан ID"
|
19
|
+
errors:
|
20
|
+
title: "Ошибка %{code}"
|
21
|
+
form_expired: "Истекло время на заполение формы"
|
22
|
+
internal_error: "Внутренняя ошибка"
|
23
|
+
access_denied: "Доступ запрещен"
|
24
|
+
not_found: 'Запрашиваемая страница была удалена, или введён некорректный адрес'
|
@@ -15,12 +15,12 @@ module RocketCMS
|
|
15
15
|
|
16
16
|
included do
|
17
17
|
has_and_belongs_to_many :menus, inverse_of: :pages
|
18
|
-
before_validation do
|
19
|
-
self.fullpath = "/pages/#{slug}" if self.fullpath.blank?
|
20
|
-
end
|
21
18
|
validates_uniqueness_of :fullpath
|
22
19
|
validates_presence_of :name
|
23
20
|
manual_slug :name
|
21
|
+
before_validation do
|
22
|
+
self.fullpath = "/pages/#{slug}" if self.fullpath.blank?
|
23
|
+
end
|
24
24
|
end
|
25
25
|
|
26
26
|
def get_fullpath
|
data/lib/rocket_cms/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rocket_cms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- glebtv
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|