rocket_cms 0.24.0 → 0.25.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +4 -4
- data/app/views/blocks/_counters.html +6 -0
- data/app/views/blocks/_footer.slim +1 -1
- data/app/views/blocks/_header.slim +1 -1
- data/app/views/contact_mailer/{new_message_email.html.haml → new_message_email.html.slim} +8 -8
- data/app/views/contacts/{new.html.haml → new.slim} +1 -0
- data/app/views/contacts/sent.slim +4 -0
- data/app/views/errors/_base.slim +3 -0
- data/app/views/errors/{error_403.html.haml → error_403.slim} +0 -0
- data/app/views/errors/{error_404.html.haml → error_404.slim} +0 -0
- data/app/views/errors/{error_500.html.haml → error_500.slim} +0 -0
- data/app/views/home/index.slim +1 -0
- data/app/views/layouts/application.slim +39 -0
- data/app/views/news/{index.html.haml → index.slim} +2 -2
- data/app/views/news/show.slim +11 -0
- data/app/views/pages/{show.html.haml → show.slim} +0 -0
- data/app/views/rails_admin/main/_check_boxes.html.haml +1 -1
- data/app/views/search/index.html.haml +8 -8
- data/app/views/shared/{_admin_link.html.haml → _admin_link.slim} +1 -1
- data/app/views/shared/{_messages.html.haml → _messages.slim} +2 -2
- data/app/views/shared/{_meta.html.haml → _meta.slim} +3 -3
- data/app/views/shared/{_obj.html.haml → _obj.slim} +1 -1
- data/app/views/shared/_og.slim +8 -0
- data/lib/generators/rocket_cms/layout_generator.rb +5 -2
- data/lib/generators/rocket_cms/templates/.babelrc +6 -3
- data/lib/generators/rocket_cms/templates/Capfile +3 -2
- data/lib/generators/rocket_cms/templates/admin.erb +4 -4
- data/lib/generators/rocket_cms/templates/deploy.erb +2 -35
- data/lib/generators/rocket_cms/templates/package.json +21 -15
- data/lib/generators/rocket_cms/templates/webpack.config.js +87 -53
- data/lib/generators/rocket_cms/templates/webpack/analytics.es6 +29 -0
- data/lib/generators/rocket_cms/templates/webpack/application.es6 +23 -13
- data/lib/generators/rocket_cms/templates/webpack/blocks/footer/index.sass +2 -0
- data/lib/generators/rocket_cms/templates/webpack/blocks/header/index.sass +1 -0
- data/lib/generators/rocket_cms/templates/webpack/blocks/index.es6 +4 -0
- data/lib/generators/rocket_cms/templates/webpack/common/index.sass +2 -0
- data/lib/generators/rocket_cms/templates/webpack/common/mixins.sass +5 -0
- data/lib/generators/rocket_cms/templates/webpack/common/variables.sass +1 -0
- data/lib/generators/rocket_cms/templates/webpack/errors/errors.pug +7 -0
- data/lib/generators/rocket_cms/templates/webpack/errors/index.es6 +1 -1
- data/lib/generators/rocket_cms/templates/webpack/fonts/index.sass +6 -0
- data/lib/generators/rocket_cms/templates/webpack/fonts/mixin.sass +25 -0
- data/lib/generators/rocket_cms/templates/webpack/layout/buttons.sass +23 -0
- data/lib/generators/rocket_cms/templates/webpack/layout/index.sass +5 -0
- data/lib/generators/rocket_cms/templates/webpack/layout/main.sass +20 -0
- data/lib/generators/rocket_cms/templates/webpack/layout/typography.sass +4 -0
- data/lib/generators/rocket_cms/templates/webpack/pages/home/index.es6 +1 -0
- data/lib/generators/rocket_cms/templates/webpack/pages/index.es6 +2 -0
- data/lib/generators/rocket_cms/webpack_generator.rb +26 -4
- data/lib/rocket_cms/version.rb +1 -1
- data/template.rb +65 -111
- metadata +36 -21
- data/app/views/contacts/sent.html.haml +0 -4
- data/app/views/errors/_base.html.haml +0 -3
- data/app/views/home/index.html.haml +0 -1
- data/app/views/layouts/application.html.slim +0 -33
- data/app/views/news/show.html.haml +0 -8
- data/app/views/shared/_og.html.haml +0 -8
- data/lib/generators/rocket_cms/templates/webpack/application.sass +0 -6
- data/lib/generators/rocket_cms/templates/webpack/errors/errors.handlebars +0 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aabd9405b787031dfa64acff7d66f70f38f2ce2a847e8ddc9ddb1f63c808803d
|
4
|
+
data.tar.gz: 652c66cb6a073c2c79a38d908177de937627ea8ec2931bb1057e0f872c73b1d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7fce8c94473f098b2830d19f9d13bb1b9891dbc38bd1616207ace5027337ead463153a451b9dcac447ec9e2095570c8ee5666f1a26894dd4beeae6fe482291dc
|
7
|
+
data.tar.gz: 6e8cfcb58d1a026adcd45edd3ca7713db97e7641f4aff4e60eae0ebd00e036c5ad425ba7b162747e421bd4d5ce487896a1c8b18925127d698c38fc6d7e673e71
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rocket_cms (0.
|
4
|
+
rocket_cms (0.25.0)
|
5
5
|
addressable
|
6
6
|
coffee-rails
|
7
7
|
jquery-rails
|
@@ -105,7 +105,7 @@ GEM
|
|
105
105
|
mini_portile2 (~> 2.3.0)
|
106
106
|
public_suffix (3.0.2)
|
107
107
|
rack (2.0.4)
|
108
|
-
rack-test (0.
|
108
|
+
rack-test (1.0.0)
|
109
109
|
rack (>= 1.0, < 3)
|
110
110
|
rails (5.1.5)
|
111
111
|
actioncable (= 5.1.5)
|
@@ -122,8 +122,8 @@ GEM
|
|
122
122
|
rails-dom-testing (2.0.3)
|
123
123
|
activesupport (>= 4.2.0)
|
124
124
|
nokogiri (>= 1.6)
|
125
|
-
rails-html-sanitizer (1.0.
|
126
|
-
loofah (~> 2.
|
125
|
+
rails-html-sanitizer (1.0.4)
|
126
|
+
loofah (~> 2.2, >= 2.2.2)
|
127
127
|
railties (5.1.5)
|
128
128
|
actionpack (= 5.1.5)
|
129
129
|
activesupport (= 5.1.5)
|
@@ -1,2 +1,2 @@
|
|
1
|
-
footer
|
1
|
+
footer.footer
|
2
2
|
| (c) #{Date.today.year}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
header
|
1
|
+
header.header
|
2
2
|
= render_navigation &navigation(:main)
|
@@ -1,16 +1,16 @@
|
|
1
1
|
|
2
2
|
- excluded_column_names = %w[id c_at u_at created_at updated_at _id _type enabled attachment c_at u_at captcha captcha_key version creator_id creator updater_id updater modifier modifier_id]
|
3
3
|
|
4
|
-
|
4
|
+
h3 Сообщение из формы связи:
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
6
|
+
table
|
7
|
+
tr
|
8
|
+
th style='padding: 2px 3px' Поле
|
9
|
+
th style='padding: 2px 3px' Значение
|
10
10
|
- fields = (RocketCMS.mongoid? ? ContactMessage.fields.keys : ContactMessage.columns.map(&:name))
|
11
11
|
- fields.reject{|c| excluded_column_names.include?(c) }.each do |c|
|
12
|
-
|
13
|
-
|
12
|
+
tr
|
13
|
+
td style='padding: 2px 3px'
|
14
14
|
= ContactMessage.human_attribute_name(c)
|
15
|
-
|
15
|
+
td style='padding: 2px 3px'
|
16
16
|
= @message.send(c.to_sym)
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
h1 RocketCMS: Home Page
|
@@ -0,0 +1,39 @@
|
|
1
|
+
doctype html
|
2
|
+
html lang="ru"
|
3
|
+
head
|
4
|
+
meta charset="UTF-8"
|
5
|
+
meta name="viewport" content="width=device-width, maximum-scale=1, minimal-ui"
|
6
|
+
-# meta property="fb:app_id" content=Rails.application.secrets.fb_app_id
|
7
|
+
-# meta property="vk:app_id" content=Rails.application.secrets.vk_app_id
|
8
|
+
meta name="turbolinks-cache-control" content="no-cache"
|
9
|
+
|
10
|
+
title= page_title
|
11
|
+
= yield :meta
|
12
|
+
= csrf_meta_tags
|
13
|
+
= favicon_link_tag '/favicon.ico'
|
14
|
+
|
15
|
+
= stylesheet_link_tag *webpack_asset_paths('vendor', extension: 'css', ignore_missing: true)
|
16
|
+
= stylesheet_link_tag *webpack_asset_paths('application', extension: 'css')
|
17
|
+
= javascript_include_tag *webpack_asset_paths('vendor', extension: 'js', ignore_missing: true)
|
18
|
+
= javascript_include_tag *webpack_asset_paths('application', extension: 'js')
|
19
|
+
|
20
|
+
body.no-js class=body_class
|
21
|
+
= render 'blocks/header'
|
22
|
+
script.no-js-script
|
23
|
+
| document.body.classList.remove('no-js');
|
24
|
+
|
25
|
+
main.main
|
26
|
+
= render 'shared/messages'
|
27
|
+
= yield
|
28
|
+
|
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
|
35
|
+
|
36
|
+
#fb-root data-turbolinks-permanent=""
|
37
|
+
#vk_api_transport data-turbolinks-permanent=""
|
38
|
+
|
39
|
+
= render 'blocks/counters'
|
@@ -1,8 +1,8 @@
|
|
1
1
|
.rs-news-index
|
2
|
-
|
2
|
+
h1= t('rs.news')
|
3
3
|
- @news.each do |news|
|
4
4
|
.rs-news-date= l(news.time.to_date)
|
5
|
-
|
5
|
+
a.rs-news-title href=news_path(news)= news.name
|
6
6
|
- if !RocketCMS.config.news_image_styles.nil? && news.image?
|
7
7
|
.rs-news-image= image_tag news.image.url(:thumb)
|
8
8
|
.rs-news-excerpt= news.excerpt
|
@@ -0,0 +1,11 @@
|
|
1
|
+
.rs-news-show
|
2
|
+
h1.rs-news-title= @news.name
|
3
|
+
.rs-news-date
|
4
|
+
= l(@news.time.to_date)
|
5
|
+
.rs-news-text
|
6
|
+
= @news.excerpt
|
7
|
+
- if !RocketCMS.config.news_image_styles.nil? && @news.image?
|
8
|
+
.rs-news-image
|
9
|
+
= image_tag @news.image.url(:main)
|
10
|
+
.rs-news-content
|
11
|
+
= render 'shared/obj', obj: @news
|
File without changes
|
@@ -1,21 +1,21 @@
|
|
1
1
|
.rs-search-results
|
2
|
-
|
2
|
+
h1 Результаты поиска
|
3
3
|
= form_tag search_path, method: :get, class: 'nav_search' do
|
4
4
|
= text_field_tag 'query', params[:query], placeholder: "Поиск"
|
5
5
|
= submit_tag 'Найти'
|
6
|
-
|
6
|
+
ol
|
7
7
|
- any = false
|
8
8
|
- @results.each do |r|
|
9
9
|
- any = true
|
10
|
-
|
10
|
+
li
|
11
11
|
-if RocketCMS.mongoid?
|
12
12
|
- u = app_url(r)
|
13
13
|
- next if u.nil?
|
14
14
|
- next if u.respond_to?(:enabled) && !u.searchable.enabled
|
15
15
|
- any = true
|
16
16
|
.title
|
17
|
-
|
18
|
-
|
17
|
+
a href=u
|
18
|
+
strong= raw (r._highlight.nil? || r._highlight['name'].nil?) ? r.name : r._highlight['name'].join(' ... ')
|
19
19
|
(#{r.class.model_name.human})
|
20
20
|
.text
|
21
21
|
= raw (r._highlight.nil? || r._highlight['content'].nil?) ? (r.content.blank? ? '' : SmartExcerpt.truncate(r.content)) : r._highlight['content'].join(' ... ')
|
@@ -26,8 +26,8 @@
|
|
26
26
|
- next if r.searchable.respond_to?(:enabled) && !r.searchable.enabled
|
27
27
|
- any = true
|
28
28
|
.title
|
29
|
-
|
30
|
-
|
29
|
+
a href=u
|
30
|
+
strong= raw highlight(r.searchable.name, params[:query], highlighter: '<em>\1</em>')
|
31
31
|
(#{r.searchable.class.model_name.human})
|
32
32
|
.text
|
33
33
|
- ex = excerpt(strip_tags(r.searchable.content), params[:query], radius: 150)
|
@@ -35,7 +35,7 @@
|
|
35
35
|
= raw strip_tags(SmartExcerpt.h.smart_truncate(r.searchable.content, words: 20))
|
36
36
|
- else
|
37
37
|
= raw highlight(ex, params[:query], highlighter: '<em>\1</em>')
|
38
|
-
|
38
|
+
span.more= link_to '', u
|
39
39
|
- unless any
|
40
40
|
.rs-search-no-results К сожалению, ничего не найдено
|
41
41
|
|
@@ -1,3 +1,3 @@
|
|
1
1
|
- if user_signed_in? && respond_to?(:can?) && can?(:access, :rails_admin) && can?(:edit, obj)
|
2
|
-
|
2
|
+
.admin_link
|
3
3
|
= link_to t('rs.edit'), rails_admin.edit_path(obj.class.model_name.i18n_key.to_s.gsub('/', '~'), obj.id), 'data-no-turbolink' => "true", 'data-turbolinks' => "false"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
- unless !obj.respond_to?(:keywords) || obj.keywords.blank?
|
2
|
-
|
2
|
+
meta name="keywords" content=obj.keywords
|
3
3
|
- unless !obj.respond_to?(:description) || obj.description.blank?
|
4
|
-
|
4
|
+
meta name="description" content=obj.description}
|
5
5
|
- unless !obj.respond_to?(:robots) || obj.robots.blank?
|
6
|
-
|
6
|
+
meta name="robots" content=obj.robots
|
@@ -0,0 +1,8 @@
|
|
1
|
+
- if defined?(title) && !title.blank?
|
2
|
+
meta property='og:title' content=title
|
3
|
+
- if defined?(image) && !image.blank?
|
4
|
+
meta property='og:image' content="http://#{request.host_with_port}#{image}"
|
5
|
+
- if defined?(desc) && !desc.blank?
|
6
|
+
meta property='og:description' content=desc
|
7
|
+
- if defined?(url) && !url.blank?
|
8
|
+
meta property='og:url' content=url
|
@@ -5,10 +5,13 @@ module RocketCms
|
|
5
5
|
class LayoutGenerator < Rails::Generators::Base
|
6
6
|
source_root File.expand_path("../../../..", __FILE__)
|
7
7
|
include Generators::Utils::InstanceMethods
|
8
|
-
|
8
|
+
|
9
9
|
desc 'RocketCMS Layout generator'
|
10
10
|
def layout
|
11
|
-
template('app/views/layouts/application.
|
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
15
|
end
|
13
16
|
end
|
14
17
|
end
|
@@ -8,9 +8,10 @@ require 'capistrano/bundler'
|
|
8
8
|
require 'capistrano/rails/assets'
|
9
9
|
require 'capistrano/rails/migrations'
|
10
10
|
#require "whenever/capistrano"
|
11
|
+
require 'capistrano/webpack'
|
11
12
|
|
12
|
-
require 'capistrano/rtrack'
|
13
|
-
require 'capistrano/npm'
|
13
|
+
#require 'capistrano/rtrack'
|
14
|
+
#require 'capistrano/npm'
|
14
15
|
|
15
16
|
require 'capistrano/puma'
|
16
17
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'rails_admin/custom_show_in_app'
|
2
2
|
|
3
|
-
RailsAdminSettings.track_history!
|
3
|
+
# RailsAdminSettings.track_history!
|
4
4
|
|
5
5
|
RailsAdmin.config do |config|
|
6
6
|
config.parent_controller = '::ApplicationController'
|
@@ -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 :
|
17
|
+
config.authorize_with :cancan
|
18
18
|
<% if RocketCMS.mongoid? %>
|
19
19
|
## == MongoidAudit
|
20
20
|
# config.audit_with :mongoid_audit, 'HistoryTracker'
|
@@ -37,8 +37,8 @@ RailsAdmin.config do |config|
|
|
37
37
|
edit
|
38
38
|
delete
|
39
39
|
|
40
|
-
history_index
|
41
|
-
history_show
|
40
|
+
# history_index
|
41
|
+
# history_show
|
42
42
|
|
43
43
|
nested_set do
|
44
44
|
visible do
|
@@ -7,7 +7,7 @@ set :branch, ENV["REVISION"] || "master"
|
|
7
7
|
set :deploy_to, "<%= deploy_to %>"
|
8
8
|
|
9
9
|
#set :rvm_type, :user
|
10
|
-
#set :rvm_ruby_version, "2.
|
10
|
+
#set :rvm_ruby_version, "2.5.0@#{fetch :application}"
|
11
11
|
set :use_sudo, false
|
12
12
|
|
13
13
|
set :keep_releases, 20
|
@@ -17,38 +17,5 @@ set :linked_files, %w{config/mongoid.yml config/secrets.yml}
|
|
17
17
|
<% else %>
|
18
18
|
set :linked_files, %w{config/database.yml config/secrets.yml}
|
19
19
|
<% end %>
|
20
|
-
set :linked_dirs, %w{log tmp vendor/bundle public/
|
21
|
-
|
22
|
-
Rake::Task["puma:check"].clear
|
23
|
-
Rake::Task["puma:config"].clear
|
24
|
-
namespace :puma do
|
25
|
-
task :check do
|
26
|
-
end
|
27
|
-
task :config do
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
namespace :deploy do
|
32
|
-
desc "webpack"
|
33
|
-
task :webpack do
|
34
|
-
on roles(:app) do
|
35
|
-
within release_path do
|
36
|
-
with rails_env: fetch(:rails_env) do
|
37
|
-
execute :rake, "webpack:compile"
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
after "deploy:updated", "deploy:webpack"
|
45
|
-
|
46
|
-
namespace :db do
|
47
|
-
desc "Create the indexes defined on your mongoid models"
|
48
|
-
task :create_mongoid_indexes do
|
49
|
-
on roles(:app) do
|
50
|
-
execute :rake, "db:mongoid:create_indexes"
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
20
|
+
set :linked_dirs, %w{log tmp vendor/bundle public/system public/uploads public/ckeditor_assets public/sitemap}
|
54
21
|
|
@@ -8,39 +8,45 @@
|
|
8
8
|
"start": "./node_modules/.bin/webpack-dev-server --config config/webpack.config.js --hot --inline"
|
9
9
|
},
|
10
10
|
"dependencies": {
|
11
|
-
"autoprefixer": "^
|
12
|
-
"axios": "^0.
|
11
|
+
"autoprefixer": "^8.1.0",
|
12
|
+
"axios": "^0.18.0",
|
13
13
|
"babel-cli": "^6.26.0",
|
14
14
|
"babel-core": "^6.26.0",
|
15
15
|
"babel-loader": "^7.1.2",
|
16
|
-
"babel-plugin-
|
16
|
+
"babel-plugin-syntax-dynamic-import": "^6.18.0",
|
17
17
|
"babel-plugin-transform-runtime": "^6.23.0",
|
18
|
-
"babel-preset-
|
18
|
+
"babel-preset-env": "^1.6.1",
|
19
19
|
"babel-preset-stage-0": "^6.24.1",
|
20
20
|
"babel-runtime": "^6.26.0",
|
21
|
-
"bootstrap": "^4.0.0",
|
22
21
|
"compression-webpack-plugin": "^1.1.3",
|
23
|
-
"css-hot-loader": "^1.3.6",
|
24
22
|
"css-loader": "^0.28.9",
|
25
|
-
"extract-text-webpack-plugin": "^
|
23
|
+
"extract-text-webpack-plugin": "^4.0.0-beta.0",
|
24
|
+
"extracted-loader": "1.0.7",
|
26
25
|
"file-loader": "^1.1.6",
|
27
|
-
"font-awesome": "^4.7.0",
|
28
|
-
"handlebars": "^4.0.11",
|
29
|
-
"handlebars-loader": "^1.6.0",
|
30
26
|
"html-loader": "^0.5.5",
|
31
27
|
"jquery": "^3.3.1",
|
32
28
|
"js-cookie": "^2.2.0",
|
29
|
+
"lodash-es": "^4.17.5",
|
33
30
|
"node-sass": "^4.7.2",
|
31
|
+
"normalize.css": "^8.0.0",
|
34
32
|
"postcss-functions": "^3.0.0",
|
35
33
|
"postcss-loader": "^2.0.10",
|
34
|
+
"pug": "^2.0.1",
|
35
|
+
"pug-loader": "github:glebtv/pug-loader",
|
36
36
|
"rails-ujs": "^5.1.4",
|
37
37
|
"sass-loader": "^6.0.6",
|
38
38
|
"stats-webpack-plugin": "^0.6.2",
|
39
|
-
"style-loader": "^0.
|
39
|
+
"style-loader": "^0.20.3",
|
40
|
+
"svg-inline-loader": "^0.8.0",
|
40
41
|
"turbolinks": "^5.1.1",
|
41
|
-
"url-loader": "^0.
|
42
|
-
"
|
43
|
-
"
|
44
|
-
"
|
42
|
+
"url-loader": "^1.0.1",
|
43
|
+
"vue": "^2.5.15",
|
44
|
+
"vue-loader": "^14.2.1",
|
45
|
+
"vue-template-compiler": "^2.5.15",
|
46
|
+
"webpack": "^4.1.1",
|
47
|
+
"webpack-cli": "^2.0.11",
|
48
|
+
"webpack-dev-server": "^3.1.1",
|
49
|
+
"webpack-hot-middleware": "^2.21.0",
|
50
|
+
"webpack-manifest-plugin": "^2.0.0-rc.2"
|
45
51
|
}
|
46
52
|
}
|