rocket_cms 0.5.1 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +11 -8
- data/app/assets/javascripts/rocket_cms/map.js.coffee +2 -2
- data/app/views/news/index.html.haml +5 -4
- data/app/views/news/show.html.haml +3 -3
- data/app/views/shared/_og.html.haml +1 -1
- data/config/locales/ru.models.yml +6 -2
- data/lib/rocket_cms.rb +1 -1
- data/lib/rocket_cms/controllers/contacts.rb +20 -4
- data/lib/rocket_cms/version.rb +1 -1
- data/release.sh +8 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 66562d5e44dc92ef98efa194f00200855d15bb2c
|
4
|
+
data.tar.gz: 377d160f40e55aaaeeeb1c3f04b887da25324cb5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 41c2405d207f70dc8490776d1ba824489d5b2b266f92fffcc3495781b8eb51431d8914c67d110ce6699205239c1b1c4edae45c2a579d5725ba35adf25e9a4824
|
7
|
+
data.tar.gz: d0d3814eecc0e0569421304ec473b84091d84b6fd80dad9030c2731d923afa54a7c65543a2aa29228c582a6e6543a114110113523763d199af686e960b4efb63
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rocket_cms (0.5.
|
4
|
+
rocket_cms (0.5.2)
|
5
5
|
addressable
|
6
6
|
coffee-rails
|
7
7
|
devise
|
@@ -64,10 +64,11 @@ GEM
|
|
64
64
|
coffee-script-source
|
65
65
|
execjs
|
66
66
|
coffee-script-source (1.8.0)
|
67
|
-
devise (3.
|
67
|
+
devise (3.4.0)
|
68
68
|
bcrypt (~> 3.0)
|
69
69
|
orm_adapter (~> 0.1)
|
70
70
|
railties (>= 3.2.6, < 5)
|
71
|
+
responders
|
71
72
|
thread_safe (~> 0.1)
|
72
73
|
warden (~> 1.2.3)
|
73
74
|
erubis (2.7.0)
|
@@ -88,7 +89,7 @@ GEM
|
|
88
89
|
jquery-rails (3.1.2)
|
89
90
|
railties (>= 3.0, < 5.0)
|
90
91
|
thor (>= 0.14, < 2.0)
|
91
|
-
jquery-ui-rails (
|
92
|
+
jquery-ui-rails (5.0.0)
|
92
93
|
railties (>= 3.2.16)
|
93
94
|
json (1.8.1)
|
94
95
|
kaminari (0.16.1)
|
@@ -96,7 +97,7 @@ GEM
|
|
96
97
|
activesupport (>= 3.0.0)
|
97
98
|
mail (2.6.1)
|
98
99
|
mime-types (>= 1.16, < 3)
|
99
|
-
mime-types (2.
|
100
|
+
mime-types (2.4.1)
|
100
101
|
mini_portile (0.6.0)
|
101
102
|
minitest (5.4.2)
|
102
103
|
multi_json (1.10.1)
|
@@ -120,13 +121,13 @@ GEM
|
|
120
121
|
bundler (>= 1.3.0, < 2.0)
|
121
122
|
railties (= 4.1.6)
|
122
123
|
sprockets-rails (~> 2.0)
|
123
|
-
rails_admin (0.6.
|
124
|
+
rails_admin (0.6.5)
|
124
125
|
builder (~> 3.1)
|
125
126
|
coffee-rails (~> 4.0)
|
126
|
-
font-awesome-rails (>= 3.0)
|
127
|
+
font-awesome-rails (>= 3.0, < 5)
|
127
128
|
haml (~> 4.0)
|
128
129
|
jquery-rails (~> 3.0)
|
129
|
-
jquery-ui-rails (~>
|
130
|
+
jquery-ui-rails (~> 5.0)
|
130
131
|
kaminari (~> 0.14)
|
131
132
|
nested_form (~> 0.3)
|
132
133
|
rack-pjax (~> 0.7)
|
@@ -144,6 +145,8 @@ GEM
|
|
144
145
|
thor (>= 0.18.1, < 2.0)
|
145
146
|
rake (10.3.2)
|
146
147
|
remotipart (1.2.1)
|
148
|
+
responders (1.1.1)
|
149
|
+
railties (>= 3.2, < 4.2)
|
147
150
|
safe_yaml (1.0.4)
|
148
151
|
sass (3.4.5)
|
149
152
|
sass-rails (4.0.1)
|
@@ -173,7 +176,7 @@ GEM
|
|
173
176
|
thor (0.19.1)
|
174
177
|
thread_safe (0.3.4)
|
175
178
|
tilt (1.4.1)
|
176
|
-
turbolinks (2.
|
179
|
+
turbolinks (2.4.0)
|
177
180
|
coffee-rails
|
178
181
|
tzinfo (1.2.2)
|
179
182
|
thread_safe (~> 0.1)
|
@@ -1,5 +1,5 @@
|
|
1
1
|
window.ya_init = ->
|
2
|
-
$('.ymap').each ->
|
2
|
+
$('.ymap').not('.done').addClass('done').each ->
|
3
3
|
$m = $(this)
|
4
4
|
coord = [$m.data('lat'), $m.data('lon')]
|
5
5
|
map = new ymaps.Map($m[0],
|
@@ -15,7 +15,7 @@ window.ya_init = ->
|
|
15
15
|
map.geoObjects.add obj
|
16
16
|
|
17
17
|
$(document).on 'page:change', ->
|
18
|
-
return if $('.ymap').length == 0
|
18
|
+
return if $('.ymap').not('.done').length == 0
|
19
19
|
if window.ymaps
|
20
20
|
ya_init()
|
21
21
|
else
|
@@ -1,8 +1,9 @@
|
|
1
1
|
.rs-news-index
|
2
2
|
%h1= t('rs.news')
|
3
3
|
- @news.each do |news|
|
4
|
-
.rs-news-date= news.time.
|
5
|
-
-
|
6
|
-
|
7
|
-
|
4
|
+
.rs-news-date= l(news.time.to_date)
|
5
|
+
%a.rs-news-title{href: news_path(news)}= news.name
|
6
|
+
- if !RocketCMS.configuration.news_image_styles.nil? && news.image?
|
7
|
+
.rs-news-image= image_tag news.image.url(:thumb)
|
8
|
+
.rs-news-excerpt= news.excerpt
|
8
9
|
= paginate @news
|
@@ -1,8 +1,8 @@
|
|
1
1
|
.rs-news-show
|
2
2
|
%h1.rs-news-title= @news.name
|
3
|
-
.rs-news-date= @news.time.
|
3
|
+
.rs-news-date= l(@news.time.to_date)
|
4
4
|
.rs-news-text= @news.excerpt
|
5
|
-
-
|
6
|
-
.rs-news-image= image_tag @news.image.url(:
|
5
|
+
- if !RocketCMS.configuration.news_image_styles.nil? && @news.image?
|
6
|
+
.rs-news-image= image_tag @news.image.url(:main)
|
7
7
|
.rs-news-content
|
8
8
|
= render 'shared/obj', obj: @news
|
@@ -1,4 +1,4 @@
|
|
1
1
|
- if defined?(title) && !title.blank?
|
2
2
|
%meta{property: 'og:title', content: title}
|
3
3
|
- if defined?(image) && !image.blank?
|
4
|
-
%meta{property: 'og:image', content: "http://#{request.
|
4
|
+
%meta{property: 'og:image', content: "http://#{request.host_with_port}#{image}"}
|
@@ -43,7 +43,6 @@ ru:
|
|
43
43
|
page: Страница
|
44
44
|
contact_message: Сообщение
|
45
45
|
news: Новость
|
46
|
-
|
47
46
|
attributes:
|
48
47
|
user:
|
49
48
|
email: E-mail
|
@@ -57,7 +56,6 @@ ru:
|
|
57
56
|
first_name: Имя
|
58
57
|
last_name: Фамилия
|
59
58
|
phone: Телефон
|
60
|
-
|
61
59
|
page:
|
62
60
|
fullpath: URL
|
63
61
|
regexp: Подсветка меню
|
@@ -70,6 +68,12 @@ ru:
|
|
70
68
|
email: Ваш е-мейл
|
71
69
|
phone: Ваш телефон
|
72
70
|
content: Ваше сообщение
|
71
|
+
errors:
|
72
|
+
models:
|
73
|
+
contact_message:
|
74
|
+
attributes:
|
75
|
+
email:
|
76
|
+
invalid_email_address: Неверный e-mail
|
73
77
|
activerecord:
|
74
78
|
<<: *mongoid
|
75
79
|
|
data/lib/rocket_cms.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
unless defined?(RocketCMS) && [:active_record, :mongoid].include?(RocketCMS.orm)
|
1
|
+
unless defined?(RocketCMS) && RocketCMS.respond_to?(:orm) && [:active_record, :mongoid].include?(RocketCMS.orm)
|
2
2
|
puts "please use rocket_cms_mongoid or rocket_cms_activerecord and not rocket_cms directly"
|
3
3
|
exit 1
|
4
4
|
end
|
@@ -17,10 +17,13 @@ module RocketCMS
|
|
17
17
|
end
|
18
18
|
if @contact_message.send(meth)
|
19
19
|
after_create
|
20
|
-
|
20
|
+
if request.xhr? && process_ajax
|
21
|
+
ajax_success
|
22
|
+
else
|
23
|
+
redirect_after_done
|
24
|
+
end
|
21
25
|
else
|
22
|
-
|
23
|
-
render action: "new"
|
26
|
+
render_error
|
24
27
|
end
|
25
28
|
end
|
26
29
|
|
@@ -28,7 +31,20 @@ module RocketCMS
|
|
28
31
|
end
|
29
32
|
|
30
33
|
private
|
31
|
-
|
34
|
+
def render_error
|
35
|
+
if request.xhr? && process_ajax
|
36
|
+
render json: {errors: @contact_message.errors}, status: 422
|
37
|
+
else
|
38
|
+
flash.now[:alert] = @contact_message.errors.full_messages.join("\n")
|
39
|
+
render action: "new", status: 422
|
40
|
+
end
|
41
|
+
end
|
42
|
+
def process_ajax
|
43
|
+
true
|
44
|
+
end
|
45
|
+
def ajax_success
|
46
|
+
render json: {ok: true}
|
47
|
+
end
|
32
48
|
def redirect_after_done
|
33
49
|
redirect_to :contacts_sent
|
34
50
|
end
|
data/lib/rocket_cms/version.rb
CHANGED
data/release.sh
ADDED
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.5.
|
4
|
+
version: 0.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- glebtv
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10-
|
11
|
+
date: 2014-10-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -459,6 +459,7 @@ files:
|
|
459
459
|
- lib/rocket_cms/rails_admin_menu.rb
|
460
460
|
- lib/rocket_cms/tasks.rb
|
461
461
|
- lib/rocket_cms/version.rb
|
462
|
+
- release.sh
|
462
463
|
- rocket_cms.gemspec
|
463
464
|
- template.rb
|
464
465
|
homepage: https://github.com/rs-pro/rocket_cms
|