rocket_cms 0.30.0 → 0.33.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +81 -81
  3. data/README.md +7 -2
  4. data/app/views/{blocks → components}/_counters.html +0 -0
  5. data/app/views/{blocks → components}/_footer.slim +0 -0
  6. data/app/views/{blocks → components}/_header.slim +0 -0
  7. data/app/views/layouts/application.slim +3 -9
  8. data/app/views/news/index.slim +5 -2
  9. data/app/views/news/show.slim +5 -3
  10. data/app/views/shared/_og.slim +2 -2
  11. data/config/locales/ru.kaminari.yml +8 -2
  12. data/lib/generators/rocket_cms/layout_generator.rb +5 -3
  13. data/lib/generators/rocket_cms/templates/.browserlistrc +1 -0
  14. data/lib/generators/rocket_cms/templates/ability.erb +6 -2
  15. data/lib/generators/rocket_cms/templates/admin.erb +1 -1
  16. data/lib/generators/rocket_cms/templates/migration_news.rb +5 -1
  17. data/lib/generators/rocket_cms/templates/package.json +3 -0
  18. data/lib/generators/rocket_cms/templates/webpack.config.js +2 -2
  19. data/lib/generators/rocket_cms/templates/webpack/application.es6 +8 -17
  20. data/lib/generators/rocket_cms/templates/webpack/components/footer/index.sass +2 -0
  21. data/lib/generators/rocket_cms/templates/webpack/components/header/index.sass +1 -0
  22. data/lib/generators/rocket_cms/templates/webpack/{blocks → components}/index.es6 +1 -1
  23. data/lib/generators/rocket_cms/templates/webpack/flash/index.es6 +12 -8
  24. data/lib/generators/rocket_cms/templates/webpack/pages/home/index.es6 +1 -1
  25. data/lib/generators/rocket_cms/webpack_generator.rb +5 -7
  26. data/lib/rocket_cms.rb +7 -1
  27. data/lib/rocket_cms/admin.rb +7 -3
  28. data/lib/rocket_cms/controller.rb +1 -1
  29. data/lib/rocket_cms/engine.rb +0 -12
  30. data/lib/rocket_cms/migration.rb +6 -1
  31. data/lib/rocket_cms/models/active_record/news.rb +6 -2
  32. data/lib/rocket_cms/models/active_record/seo.rb +5 -1
  33. data/lib/rocket_cms/models/mongoid/news.rb +7 -3
  34. data/lib/rocket_cms/models/mongoid/seo.rb +9 -2
  35. data/lib/rocket_cms/models/news.rb +2 -1
  36. data/lib/rocket_cms/models/seo.rb +3 -1
  37. data/lib/rocket_cms/version.rb +1 -1
  38. data/template.rb +292 -62
  39. metadata +13 -17
  40. data/config/locales/ru.devise.yml +0 -65
  41. data/lib/filename_to_slug.rb +0 -32
  42. data/lib/generators/rocket_cms/templates/webpack/blocks/footer/index.sass +0 -2
  43. data/lib/generators/rocket_cms/templates/webpack/blocks/header/index.sass +0 -1
  44. data/lib/generators/rocket_cms/templates/webpack/errors/errors.pug +0 -7
  45. data/lib/generators/rocket_cms/templates/webpack/errors/index.es6 +0 -30
  46. data/lib/generators/rocket_cms/templates/webpack/errors/index.sass +0 -49
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 99f28386f0c25e7b5b4130753a92cbd67879a73103731cfc7ee7becbb5f51b56
4
- data.tar.gz: 4b40826b97201fac4d6e135b7626840b191ce27b196f3c2eae488ad47907ad06
3
+ metadata.gz: 15d7121ecc5a1d3a6cb949ac7d790faeb88cb3df191578687b48d179f583d15e
4
+ data.tar.gz: d3843ac98ba756d4399cad90a83dde8b8a12d56196bec5ed2a393e6bcf84df8a
5
5
  SHA512:
6
- metadata.gz: 64a1c82f6fdd78704826efcf596168a8d8307b5d000cf7fc615f6f2a20aa595df4d8768b3d70a8f3a89293dcdc1beb8641ed42f253086b1e7337133c91ba0bd1
7
- data.tar.gz: 8b02db625b5ce810e9b14fe92b2048e00c78f759c940bed48916abe8481932d91fcc4aeeb74daeac8579d9564d4c11ccb7a0d20383aabe06b2b5f7109e5e1cf3
6
+ metadata.gz: aeaf5510cd6d74c56c934c00bde9d1de486247b01d342ae925a07de6561579df2adced525dc009d2317ef5e7c43ae68600cc3f812bd715f44c2d46169a9961ab
7
+ data.tar.gz: d17429f5fd7b2433120f4fb2a8bccf91428a7b4d69569bf44014ba6e5523c4bab6d53e4eec28740c95c8528fbb6de1992d87bcfab025cdc0b5856ac3e361c974
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rocket_cms (0.30.0)
4
+ rocket_cms (0.33.1)
5
5
  addressable
6
6
  coffee-rails
7
7
  jquery-rails
@@ -16,64 +16,64 @@ PATH
16
16
  GEM
17
17
  remote: https://rubygems.org/
18
18
  specs:
19
- actioncable (6.0.1)
20
- actionpack (= 6.0.1)
19
+ actioncable (6.0.3.2)
20
+ actionpack (= 6.0.3.2)
21
21
  nio4r (~> 2.0)
22
22
  websocket-driver (>= 0.6.1)
23
- actionmailbox (6.0.1)
24
- actionpack (= 6.0.1)
25
- activejob (= 6.0.1)
26
- activerecord (= 6.0.1)
27
- activestorage (= 6.0.1)
28
- activesupport (= 6.0.1)
23
+ actionmailbox (6.0.3.2)
24
+ actionpack (= 6.0.3.2)
25
+ activejob (= 6.0.3.2)
26
+ activerecord (= 6.0.3.2)
27
+ activestorage (= 6.0.3.2)
28
+ activesupport (= 6.0.3.2)
29
29
  mail (>= 2.7.1)
30
- actionmailer (6.0.1)
31
- actionpack (= 6.0.1)
32
- actionview (= 6.0.1)
33
- activejob (= 6.0.1)
30
+ actionmailer (6.0.3.2)
31
+ actionpack (= 6.0.3.2)
32
+ actionview (= 6.0.3.2)
33
+ activejob (= 6.0.3.2)
34
34
  mail (~> 2.5, >= 2.5.4)
35
35
  rails-dom-testing (~> 2.0)
36
- actionpack (6.0.1)
37
- actionview (= 6.0.1)
38
- activesupport (= 6.0.1)
39
- rack (~> 2.0)
36
+ actionpack (6.0.3.2)
37
+ actionview (= 6.0.3.2)
38
+ activesupport (= 6.0.3.2)
39
+ rack (~> 2.0, >= 2.0.8)
40
40
  rack-test (>= 0.6.3)
41
41
  rails-dom-testing (~> 2.0)
42
42
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
43
- actiontext (6.0.1)
44
- actionpack (= 6.0.1)
45
- activerecord (= 6.0.1)
46
- activestorage (= 6.0.1)
47
- activesupport (= 6.0.1)
43
+ actiontext (6.0.3.2)
44
+ actionpack (= 6.0.3.2)
45
+ activerecord (= 6.0.3.2)
46
+ activestorage (= 6.0.3.2)
47
+ activesupport (= 6.0.3.2)
48
48
  nokogiri (>= 1.8.5)
49
- actionview (6.0.1)
50
- activesupport (= 6.0.1)
49
+ actionview (6.0.3.2)
50
+ activesupport (= 6.0.3.2)
51
51
  builder (~> 3.1)
52
52
  erubi (~> 1.4)
53
53
  rails-dom-testing (~> 2.0)
54
54
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
55
- activejob (6.0.1)
56
- activesupport (= 6.0.1)
55
+ activejob (6.0.3.2)
56
+ activesupport (= 6.0.3.2)
57
57
  globalid (>= 0.3.6)
58
- activemodel (6.0.1)
59
- activesupport (= 6.0.1)
60
- activerecord (6.0.1)
61
- activemodel (= 6.0.1)
62
- activesupport (= 6.0.1)
63
- activestorage (6.0.1)
64
- actionpack (= 6.0.1)
65
- activejob (= 6.0.1)
66
- activerecord (= 6.0.1)
58
+ activemodel (6.0.3.2)
59
+ activesupport (= 6.0.3.2)
60
+ activerecord (6.0.3.2)
61
+ activemodel (= 6.0.3.2)
62
+ activesupport (= 6.0.3.2)
63
+ activestorage (6.0.3.2)
64
+ actionpack (= 6.0.3.2)
65
+ activejob (= 6.0.3.2)
66
+ activerecord (= 6.0.3.2)
67
67
  marcel (~> 0.3.1)
68
- activesupport (6.0.1)
68
+ activesupport (6.0.3.2)
69
69
  concurrent-ruby (~> 1.0, >= 1.0.2)
70
70
  i18n (>= 0.7, < 2)
71
71
  minitest (~> 5.1)
72
72
  tzinfo (~> 1.1)
73
- zeitwerk (~> 2.2)
73
+ zeitwerk (~> 2.2, >= 2.2.2)
74
74
  addressable (2.7.0)
75
75
  public_suffix (>= 2.0.2, < 5.0)
76
- builder (3.2.3)
76
+ builder (3.2.4)
77
77
  coffee-rails (5.0.0)
78
78
  coffee-script (>= 2.2.0)
79
79
  railties (>= 5.2.0)
@@ -81,32 +81,32 @@ GEM
81
81
  coffee-script-source
82
82
  execjs
83
83
  coffee-script-source (1.12.2)
84
- concurrent-ruby (1.1.5)
85
- crass (1.0.5)
84
+ concurrent-ruby (1.1.7)
85
+ crass (1.0.6)
86
86
  erubi (1.9.0)
87
87
  execjs (2.7.0)
88
88
  globalid (0.4.2)
89
89
  activesupport (>= 4.2.0)
90
90
  htmlentities (4.3.4)
91
- i18n (1.7.0)
91
+ i18n (1.8.5)
92
92
  concurrent-ruby (~> 1.0)
93
- jquery-rails (4.3.5)
93
+ jquery-rails (4.4.0)
94
94
  rails-dom-testing (>= 1, < 3)
95
95
  railties (>= 4.2.0)
96
96
  thor (>= 0.14, < 2.0)
97
- kaminari (1.1.1)
97
+ kaminari (1.2.1)
98
98
  activesupport (>= 4.1.0)
99
- kaminari-actionview (= 1.1.1)
100
- kaminari-activerecord (= 1.1.1)
101
- kaminari-core (= 1.1.1)
102
- kaminari-actionview (1.1.1)
99
+ kaminari-actionview (= 1.2.1)
100
+ kaminari-activerecord (= 1.2.1)
101
+ kaminari-core (= 1.2.1)
102
+ kaminari-actionview (1.2.1)
103
103
  actionview
104
- kaminari-core (= 1.1.1)
105
- kaminari-activerecord (1.1.1)
104
+ kaminari-core (= 1.2.1)
105
+ kaminari-activerecord (1.2.1)
106
106
  activerecord
107
- kaminari-core (= 1.1.1)
108
- kaminari-core (1.1.1)
109
- loofah (2.3.1)
107
+ kaminari-core (= 1.2.1)
108
+ kaminari-core (1.2.1)
109
+ loofah (2.6.0)
110
110
  crass (~> 1.0.2)
111
111
  nokogiri (>= 1.5.9)
112
112
  mail (2.7.1)
@@ -115,41 +115,41 @@ GEM
115
115
  activesupport
116
116
  marcel (0.3.3)
117
117
  mimemagic (~> 0.3.2)
118
- method_source (0.9.2)
119
- mimemagic (0.3.3)
118
+ method_source (1.0.0)
119
+ mimemagic (0.3.5)
120
120
  mini_mime (1.0.2)
121
121
  mini_portile2 (2.4.0)
122
- minitest (5.13.0)
122
+ minitest (5.14.1)
123
123
  nio4r (2.5.2)
124
- nokogiri (1.10.5)
124
+ nokogiri (1.10.10)
125
125
  mini_portile2 (~> 2.4.0)
126
- public_suffix (4.0.1)
127
- rack (2.0.7)
126
+ public_suffix (4.0.5)
127
+ rack (2.2.3)
128
128
  rack-test (1.1.0)
129
129
  rack (>= 1.0, < 3)
130
- rails (6.0.1)
131
- actioncable (= 6.0.1)
132
- actionmailbox (= 6.0.1)
133
- actionmailer (= 6.0.1)
134
- actionpack (= 6.0.1)
135
- actiontext (= 6.0.1)
136
- actionview (= 6.0.1)
137
- activejob (= 6.0.1)
138
- activemodel (= 6.0.1)
139
- activerecord (= 6.0.1)
140
- activestorage (= 6.0.1)
141
- activesupport (= 6.0.1)
130
+ rails (6.0.3.2)
131
+ actioncable (= 6.0.3.2)
132
+ actionmailbox (= 6.0.3.2)
133
+ actionmailer (= 6.0.3.2)
134
+ actionpack (= 6.0.3.2)
135
+ actiontext (= 6.0.3.2)
136
+ actionview (= 6.0.3.2)
137
+ activejob (= 6.0.3.2)
138
+ activemodel (= 6.0.3.2)
139
+ activerecord (= 6.0.3.2)
140
+ activestorage (= 6.0.3.2)
141
+ activesupport (= 6.0.3.2)
142
142
  bundler (>= 1.3.0)
143
- railties (= 6.0.1)
143
+ railties (= 6.0.3.2)
144
144
  sprockets-rails (>= 2.0.0)
145
145
  rails-dom-testing (2.0.3)
146
146
  activesupport (>= 4.2.0)
147
147
  nokogiri (>= 1.6)
148
148
  rails-html-sanitizer (1.3.0)
149
149
  loofah (~> 2.3)
150
- railties (6.0.1)
151
- actionpack (= 6.0.1)
152
- activesupport (= 6.0.1)
150
+ railties (6.0.3.2)
151
+ actionpack (= 6.0.3.2)
152
+ activesupport (= 6.0.3.2)
153
153
  method_source
154
154
  rake (>= 0.8.7)
155
155
  thor (>= 0.20.3, < 2.0)
@@ -157,7 +157,7 @@ GEM
157
157
  smart_excerpt (0.1.6)
158
158
  activesupport
159
159
  htmlentities
160
- sprockets (4.0.0)
160
+ sprockets (4.0.2)
161
161
  concurrent-ruby (~> 1.0)
162
162
  rack (> 1, < 3)
163
163
  sprockets-rails (3.2.1)
@@ -165,16 +165,16 @@ GEM
165
165
  activesupport (>= 4.0)
166
166
  sprockets (>= 3.0.0)
167
167
  stringex (2.8.5)
168
- thor (0.20.3)
168
+ thor (1.0.1)
169
169
  thread_safe (0.3.6)
170
- tzinfo (1.2.5)
170
+ tzinfo (1.2.7)
171
171
  thread_safe (~> 0.1)
172
172
  validates_email_format_of (1.6.3)
173
173
  i18n
174
- websocket-driver (0.7.1)
174
+ websocket-driver (0.7.3)
175
175
  websocket-extensions (>= 0.1.0)
176
- websocket-extensions (0.1.4)
177
- zeitwerk (2.2.1)
176
+ websocket-extensions (0.1.5)
177
+ zeitwerk (2.4.0)
178
178
 
179
179
  PLATFORMS
180
180
  ruby
@@ -185,4 +185,4 @@ DEPENDENCIES
185
185
  rocket_cms!
186
186
 
187
187
  BUNDLED WITH
188
- 1.17.3
188
+ 2.1.4
data/README.md CHANGED
@@ -70,14 +70,19 @@ If not, uninstall rails and install again
70
70
 
71
71
  Then, for mongoid:
72
72
 
73
- rails new my_app -T -O -m https://gitlab.com/rocket-science/rocket_cms/raw/master/template.rb --skip-spring
73
+ rails new my_app -T -O -m https://gitlab.com/rocket-science/rocket_cms/raw/master/template.rb --skip-spring --skip-javascript
74
74
 
75
75
  for ActiveRecord:
76
76
 
77
- rails new my_app -T --database=postgresql -m https://gitlab.com/rocket-science/rocket_cms/raw/master/template.rb --skip-spring
77
+ rails new my_app -T --database=postgresql -m https://gitlab.com/rocket-science/rocket_cms/raw/master/template.rb --skip-spring --skip-javascript
78
78
 
79
79
  generator creates a new RVM gemset, so after cd'ing to app dir, you should run `bundle install` again if you use rvm.
80
80
 
81
+ Development mode template:
82
+
83
+ rails new my_app -T --database=postgresql -m /data/rocket_cms/template.rb --skip-spring --skip-javascript
84
+
85
+
81
86
  ### Localization
82
87
 
83
88
  All models included in the gem support localization via either [hstore_translate](https://github.com/Leadformance/hstore_translate) or built-in Mongoid localize: true option.
@@ -5,7 +5,6 @@ html lang="ru"
5
5
  meta name="viewport" content="width=device-width, maximum-scale=1, minimal-ui"
6
6
  -# meta property="fb:app_id" content=Rails.application.secrets.fb_app_id
7
7
  -# meta property="vk:app_id" content=Rails.application.secrets.vk_app_id
8
- meta name="turbolinks-cache-control" content="no-cache"
9
8
 
10
9
  title= page_title
11
10
  = yield :meta
@@ -18,7 +17,7 @@ html lang="ru"
18
17
  = javascript_include_tag *webpack_asset_paths('application', extension: 'js')
19
18
 
20
19
  body.no-js class=body_class
21
- = render 'blocks/header'
20
+ = render 'components/header'
22
21
  script.no-js-script
23
22
  | document.body.classList.remove('no-js');
24
23
 
@@ -26,14 +25,9 @@ html lang="ru"
26
25
  = render 'shared/messages'
27
26
  = yield
28
27
 
29
- = render 'blocks/footer'
30
-
31
- .no-js-error.alert.alert-error
32
- | К сожалению, в вашем браузере отключен JavaScript
33
- span Включите его, чтобы зайти на сайт
34
- a class="btn-transparent" target="_blank" href="https://yandex.ru/support/common/browsers-settings/browsers-java-js-settings.xml" Включить JavaScript
28
+ = render 'components/footer'
35
29
 
36
30
  #fb-root data-turbolinks-permanent=""
37
31
  #vk_api_transport data-turbolinks-permanent=""
38
32
 
39
- = render 'blocks/counters'
33
+ = render 'components/counters'
@@ -4,7 +4,10 @@
4
4
  .rs-news-date= l(news.time.to_date)
5
5
  a.rs-news-title href=news_path(news)
6
6
  = news.name
7
- - if !RocketCMS.config.news_image_styles.nil? && news.image?
8
- .rs-news-image= image_tag news.image.url(:thumb)
7
+ - if !RocketCMS.config.news_image_styles.nil?
8
+ - if RocketCMS.paperclip? && news.image?
9
+ .rs-news-image= image_tag news.image.url(:thumb)
10
+ - elsif RocketCMS.shrine? && !news.image.nil?
11
+ .rs-news-image= image_tag news.image(:thumb).url
9
12
  .rs-news-excerpt= news.excerpt
10
13
  = paginate @news
@@ -4,8 +4,10 @@
4
4
  = l(@news.time.to_date)
5
5
  .rs-news-text
6
6
  = @news.excerpt
7
- - if !RocketCMS.config.news_image_styles.nil? && @news.image?
8
- .rs-news-image
9
- = image_tag @news.image.url(:main)
7
+ - if !RocketCMS.config.news_image_styles.nil?
8
+ - if RocketCMS.paperclip? && @news.image?
9
+ .rs-news-image= image_tag @news.image.url(:main)
10
+ - elsif RocketCMS.shrine? && !news.image.nil?
11
+ .rs-news-image= image_tag @news.image(:main).url
10
12
  .rs-news-content
11
13
  = render 'shared/obj', obj: @news
@@ -4,5 +4,5 @@
4
4
  meta property='og:image' content="http://#{request.host_with_port}#{image}"
5
5
  - if defined?(desc) && !desc.blank?
6
6
  meta property='og:description' content=desc
7
- - if defined?(url) && !url.blank?
8
- meta property='og:url' content=url
7
+ - if defined?(og_url) && !og_url.blank?
8
+ meta property='og:url' content=og_url
@@ -8,10 +8,16 @@ ru:
8
8
  truncate: "&hellip;"
9
9
  helpers:
10
10
  page_entries_info:
11
+ entry:
12
+ one: "запись"
13
+ few: "записи"
14
+ many: "записей"
15
+ other: "записей"
11
16
  one_page:
12
17
  display_entries:
13
- zero: "%{entry_name} не найдены"
14
- one: "Показано <b>1</b> %{entry_name}"
18
+ one: "Показана <b>1</b> %{entry_name}"
19
+ few: "Показано <b>1</b> %{entry_name}"
20
+ many: "Показаны <b>все %{count}</b> %{entry_name}"
15
21
  other: "Показаны <b>все %{count}</b> %{entry_name}"
16
22
  more_pages:
17
23
  display_entries: "Показаны %{entry_name} <b>%{first}&nbsp;-&nbsp;%{last}</b> из <b>%{total}</b>"
@@ -9,9 +9,11 @@ module RocketCms
9
9
  desc 'RocketCMS Layout generator'
10
10
  def layout
11
11
  template('app/views/layouts/application.slim', 'app/views/layouts/application.slim')
12
- template('app/views/blocks/_footer.slim', 'app/views/blocks/_footer.slim')
13
- template('app/views/blocks/_header.slim', 'app/views/blocks/_header.slim')
14
- template('app/views/pages/home/index.slim', 'app/views/pages/home/index.slim')
12
+ template('app/views/components/_header.slim', 'app/views/components/_header.slim')
13
+ template('app/views/components/_footer.slim', 'app/views/components/_footer.slim')
14
+ template('app/views/components/_counters.html', 'app/views/components/_counters.html')
15
+ template('app/views/home/index.slim', 'app/views/home/index.slim')
16
+ template('app/views/pages/show.slim', 'app/views/pages/show.slim')
15
17
  end
16
18
  end
17
19
  end
@@ -7,12 +7,16 @@ class Ability
7
7
  can :manage, :all
8
8
  cannot :destroy, Menu
9
9
  cannot :update, Menu
10
+ if RocketCMS.active_record?
11
+ cannot :destroy, PaperTrail::Version
12
+ cannot :update, PaperTrail::Version
13
+ end
10
14
  admin_ui
11
15
  end
12
16
  end
13
17
 
14
18
  def admin_ui
15
- can :access, :rails_admin # grant access to rails_admin
16
- can :dashboard # grant access to the dashboard
19
+ can :access, :rails_admin
20
+ can :read, :dashboard
17
21
  end
18
22
  end
@@ -14,7 +14,7 @@ RailsAdmin.config do |config|
14
14
  config.current_user_method(&:current_user)
15
15
 
16
16
  ## == Cancan ==
17
- config.authorize_with :cancan
17
+ config.authorize_with :cancancan
18
18
  <% if RocketCMS.mongoid? %>
19
19
  ## == MongoidAudit
20
20
  # config.audit_with :mongoid_audit, 'HistoryTracker'
@@ -15,7 +15,11 @@ class RocketCmsCreateNews < ActiveRecord::Migration[5.0]
15
15
  end
16
16
 
17
17
  t.string :slug, null: false
18
- t.attachment :image
18
+ if RocketCMS.shrine?
19
+ t.jsonb :image_data
20
+ elsif RocketCMS.paperclip?
21
+ t.attachment :image
22
+ end
19
23
  t.timestamps
20
24
  end
21
25