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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 129c5e1f7b72e2bfb91cd533f6fb41457d01cbed
4
- data.tar.gz: b507a570511479bae72da94a433bdffb2ee33be9
3
+ metadata.gz: 16198fe2f18bbd0394f5d9b7a93d4aaab023752d
4
+ data.tar.gz: 2514f9a7ae0d80a69b3f118c1e00c650a4491642
5
5
  SHA512:
6
- metadata.gz: e5d0a597b1bf2042b421dc9d25fc9d52ab29fa1e9cd2d9944e58c2f61fb55b3f6e1f27007d8c80925f197af70f98a7488bacc7fec7b6604432dfc2e810337c01
7
- data.tar.gz: 3ef4040760a5ab69c73c8a928d989f8317876b0b614d57535150460ef3ddcc927cc65a011827f2132914f4baeee73260c002c524c1062dfb5b9fc5e1ee5ebd87
6
+ metadata.gz: 54a54b0f67863309e193540efafd2a365a0acfbf2a620b6fe38a575244a344ca871fbe238957833b53bbe2213426ef77d5bdb16984ffd0d3b1723b46facdd96b
7
+ data.tar.gz: 7008fc4c464193874388006dac7bb83dd970600d04e0f3fda9ab343a69e0261eb237b0ac9fbdb15bc7e5fa31de6921e4424c3f5fce1d432c8a425069e3bac339
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rocket_cms (0.6.16)
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.1)
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 rails_admin_controller?
49
- render text: 'Внутренняя ошибка', status: 500
53
+ if rails_admin?
54
+ render text: t('rs.errors.internal_error'), status: 500
50
55
  return
51
56
  end
52
57
  rescue
@@ -1,3 +1,3 @@
1
1
  #rocket_cms_error{class: "error-#{code}"}
2
- %h1 Ошибка #{code}
2
+ %h1= t('rs.errors.title', code: code)
3
3
  %p #{text}
@@ -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')
@@ -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'
@@ -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
@@ -1,3 +1,3 @@
1
1
  module RocketCMS
2
- VERSION = "0.6.16"
2
+ VERSION = "0.6.17"
3
3
  end
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.16
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-22 00:00:00.000000000 Z
11
+ date: 2015-04-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler