rocket_cms 0.18.1 → 0.18.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 +1 -1
- data/README.md +19 -7
- data/app/assets/javascripts/rocket_cms.js.coffee +0 -7
- data/app/assets/stylesheets/rocket_cms.css.sass +0 -6
- data/app/views/blocks/_footer.slim +2 -0
- data/app/views/blocks/_header.slim +2 -0
- data/app/views/layouts/application.html.slim +16 -10
- data/lib/generators/rocket_cms/templates/.babelrc +5 -0
- data/lib/generators/rocket_cms/templates/package.json +43 -0
- data/lib/generators/rocket_cms/templates/webpack.config.js +144 -0
- data/lib/generators/rocket_cms/templates/webpack/application.es6 +16 -0
- data/lib/generators/rocket_cms/templates/webpack/application.sass +6 -0
- data/lib/generators/rocket_cms/templates/webpack/errors/errors.handlebars +9 -0
- data/lib/generators/rocket_cms/templates/webpack/errors/index.es6 +30 -0
- data/lib/generators/rocket_cms/templates/webpack/errors/index.sass +49 -0
- data/lib/generators/rocket_cms/templates/webpack/flash/index.es6 +12 -0
- data/{app/assets/stylesheets/rocket_cms/flash.css.sass → lib/generators/rocket_cms/templates/webpack/flash/index.sass} +6 -7
- data/lib/generators/rocket_cms/webpack_generator.rb +30 -0
- data/lib/rocket_cms/version.rb +1 -1
- data/template.rb +26 -242
- metadata +14 -9
- data/app/assets/javascripts/head.load.js +0 -707
- data/app/assets/javascripts/jquery.placeholder.js +0 -157
- data/app/assets/javascripts/rocket_cms/flash.js.coffee +0 -3
- data/app/assets/javascripts/rocket_cms/map.js.coffee +0 -22
- data/app/assets/stylesheets/rocket_cms/normalize.css.scss +0 -461
- data/app/views/blocks/_footer.html.haml +0 -1
- data/app/views/layouts/application.html.haml +0 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c86a852924655f2f7c4ec11a1c876a96d7933291
|
4
|
+
data.tar.gz: 5c11727b7db6866cd1d3c83eaf28b20cdc7c7b24
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 788a1142273b99e2f097046bb8723ea9e9a6e4fe9bdd0852da3900c0c3b0e1def3d5d4cf3031d691a766f48eb9cac7821a63d040f01967b445017d475fbb4b5c
|
7
|
+
data.tar.gz: 296b53fcd66a432a9f89b18115d13c412148041d67277d064a26096219e7e8c74d7e6a61d2024b31510540274fc7a7462055f36096cc5db3495bbdc1b76dd497
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,10 +1,23 @@
|
|
1
1
|
# RocketCMS
|
2
2
|
|
3
|
-
|
3
|
+
What's in the box when you generate a new app:
|
4
4
|
|
5
|
-
|
5
|
+
- Rails 5.1
|
6
|
+
- ActiveRecord + PostgreSQL or Mongoid 6
|
7
|
+
- Elasticsearch (optional)
|
8
|
+
- RailsAdmin
|
9
|
+
- Webpack via webpack-rails with fully customizeable webpack.config.js
|
10
|
+
- JS packages via package.json
|
11
|
+
- Capistrano deploy (including puma and webpack)
|
12
|
+
- Puma in production and in development
|
13
|
+
- Windows support
|
14
|
+
- Basic CMS models and controllers (Pages + SEO, News, Contact form with mailer, menu)
|
15
|
+
- Menu via SimpleNavigation
|
16
|
+
- Ckeditor with image upload support
|
17
|
+
- L10n and i18n support
|
6
18
|
|
7
|
-
|
19
|
+
|
20
|
+
## Installation (existing app)
|
8
21
|
|
9
22
|
Add this line to your application's Gemfile:
|
10
23
|
|
@@ -35,9 +48,8 @@ For activerecord, generate migrations and run them
|
|
35
48
|
rails g rocket_cms:migration
|
36
49
|
rake db:migrate
|
37
50
|
|
38
|
-
## Usage
|
39
51
|
|
40
|
-
###
|
52
|
+
### Generating a new app
|
41
53
|
|
42
54
|
Make sure you have rails 4.1/4.2/5.0 installed
|
43
55
|
|
@@ -50,11 +62,11 @@ If not, uninstall rails and install again
|
|
50
62
|
|
51
63
|
Then, for mongoid:
|
52
64
|
|
53
|
-
rails new my_app -T -O -m https://raw.githubusercontent.com/rs-pro/rocket_cms/master/template.rb
|
65
|
+
rails new my_app -T -O -m https://raw.githubusercontent.com/rs-pro/rocket_cms/master/template.rb --yarn
|
54
66
|
|
55
67
|
for ActiveRecord:
|
56
68
|
|
57
|
-
rails new my_app -T --database=postgresql -m https://raw.githubusercontent.com/rs-pro/rocket_cms/master/template.rb
|
69
|
+
rails new my_app -T --database=postgresql -m https://raw.githubusercontent.com/rs-pro/rocket_cms/master/template.rb --yarn
|
58
70
|
|
59
71
|
generator creates a new RVM gemset, so after cd'ing to app dir, you should run `bundle install` again if you use rvm.
|
60
72
|
|
@@ -7,16 +7,22 @@ html lang="ru"
|
|
7
7
|
= yield :meta
|
8
8
|
= csrf_meta_tags
|
9
9
|
= favicon_link_tag '/favicon.ico'
|
10
|
-
= stylesheet_link_tag
|
11
|
-
=
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
10
|
+
= stylesheet_link_tag *webpack_asset_paths('vendor', extension: 'css')
|
11
|
+
= stylesheet_link_tag *webpack_asset_paths('application', extension: 'css')
|
12
|
+
= javascript_include_tag *webpack_asset_paths('vendor', extension: 'js')
|
13
|
+
= javascript_include_tag *webpack_asset_paths('application', extension: 'js')
|
14
|
+
|
15
|
+
body.no-js
|
16
|
+
= render 'blocks/header'
|
17
|
+
script.no-js-script
|
18
|
+
| document.body.classList.remove('no-js');
|
19
|
+
.no-js-error.alert.alert-error
|
20
|
+
| К сожалению, в вашем браузере отключен JavaScript
|
21
|
+
span Включите его, чтобы зайти на сайт
|
22
|
+
a class="btn-transparent" target="_blank" href="https://yandex.ru/support/common/browsers-settings/browsers-java-js-settings.xml" Включить JavaScript
|
23
|
+
|
24
|
+
.container
|
25
|
+
= yield
|
20
26
|
#footer
|
21
27
|
= render 'blocks/footer'
|
22
28
|
|
@@ -0,0 +1,43 @@
|
|
1
|
+
{
|
2
|
+
"name": "<%= app_name.camelize %>",
|
3
|
+
"version": "0.0.1",
|
4
|
+
"license": "UNLICENSED",
|
5
|
+
"private": true,
|
6
|
+
"repository": "git@rscz.ru:rocket-science/<%= app_name.downcase %>.git",
|
7
|
+
"dependencies": {
|
8
|
+
"autoprefixer": "^6.5.3",
|
9
|
+
"axios": "^0.16.1",
|
10
|
+
"babel-cli": "^6.18.0",
|
11
|
+
"babel-core": "^6.18.2",
|
12
|
+
"babel-loader": "^7.0.0",
|
13
|
+
"babel-plugin-lodash": "^3.2.9",
|
14
|
+
"babel-plugin-transform-runtime": "^6.15.0",
|
15
|
+
"babel-preset-es2015": "^6.18.0",
|
16
|
+
"babel-preset-stage-0": "^6.16.0",
|
17
|
+
"babel-runtime": "^6.20.0",
|
18
|
+
"bootstrap": "4.0.0-alpha.6",
|
19
|
+
"compression-webpack-plugin": "^0.4.0",
|
20
|
+
"css-loader": "^0.28.0",
|
21
|
+
"extract-text-webpack-plugin": "^2.0.0-rc.3",
|
22
|
+
"file-loader": "^0.11.1",
|
23
|
+
"font-awesome": "^4.7.0",
|
24
|
+
"handlebars": "^4.0.6",
|
25
|
+
"handlebars-loader": "^1.4.0",
|
26
|
+
"html-loader": "^0.4.4",
|
27
|
+
"jquery": "^3.1.1",
|
28
|
+
"jquery-ujs": "^1.2.2",
|
29
|
+
"js-cookie": "^2.1.3",
|
30
|
+
"node-sass": "^4.0.0",
|
31
|
+
"postcss-functions": "^2.1.0",
|
32
|
+
"postcss-loader": "^1.3.0",
|
33
|
+
"sass-loader": "^6.0.0",
|
34
|
+
"stats-webpack-plugin": "^0.6.0",
|
35
|
+
"style-loader": "^0.16.1",
|
36
|
+
"turbolinks": "^5.0.0",
|
37
|
+
"url-loader": "^0.5.7",
|
38
|
+
"webpack": "^2.2.1",
|
39
|
+
"webpack-dev-server": "^2.3.0",
|
40
|
+
"webpack-hot-middleware": "^2.7.1"
|
41
|
+
}
|
42
|
+
}
|
43
|
+
|
@@ -0,0 +1,144 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
var path = require('path');
|
4
|
+
var webpack = require('webpack');
|
5
|
+
var functions = require('postcss-functions');
|
6
|
+
var StatsPlugin = require('stats-webpack-plugin');
|
7
|
+
|
8
|
+
var ExtractTextPlugin = require("extract-text-webpack-plugin");
|
9
|
+
|
10
|
+
var autoprefixer = require('autoprefixer');
|
11
|
+
var CompressionPlugin = require("compression-webpack-plugin");
|
12
|
+
|
13
|
+
var host = process.env.HOST || 'localhost'
|
14
|
+
var devServerPort = 3808;
|
15
|
+
|
16
|
+
var production = process.env.NODE_ENV === 'production';
|
17
|
+
|
18
|
+
const extractSass = new ExtractTextPlugin({
|
19
|
+
filename: "[name].[contenthash].css",
|
20
|
+
disable: !production
|
21
|
+
});
|
22
|
+
|
23
|
+
//console.log("dir:", __dirname)
|
24
|
+
|
25
|
+
var sassExtractor = () => {
|
26
|
+
return extractSass.extract({
|
27
|
+
use: [{
|
28
|
+
loader: "style-loader"
|
29
|
+
}, {
|
30
|
+
loader: "css-loader",
|
31
|
+
options: {
|
32
|
+
sourceMap: true
|
33
|
+
}
|
34
|
+
}, {
|
35
|
+
loader: "sass-loader",
|
36
|
+
options: {
|
37
|
+
sourceMap: true
|
38
|
+
}
|
39
|
+
}],
|
40
|
+
fallback: "style-loader"
|
41
|
+
})
|
42
|
+
}
|
43
|
+
|
44
|
+
var config = {
|
45
|
+
entry: {
|
46
|
+
// Sources are expected to live in $app_root/webpack
|
47
|
+
vendor: [
|
48
|
+
'babel-polyfill',
|
49
|
+
'axios',
|
50
|
+
'jquery',
|
51
|
+
'lodash',
|
52
|
+
],
|
53
|
+
application: 'application.es6'
|
54
|
+
},
|
55
|
+
|
56
|
+
module: {
|
57
|
+
rules: [
|
58
|
+
{ test: /\.es6/, use: "babel-loader" },
|
59
|
+
{ test: /\.handlebars$/, use: "handlebars-loader" },
|
60
|
+
{ test: /\.(jpe?g|png|gif)$/i, use: "file-loader" },
|
61
|
+
{
|
62
|
+
test: /\.woff($|\?)|\.woff2($|\?)|\.ttf($|\?)|\.eot($|\?)|\.svg($|\?)/,
|
63
|
+
use: production ? 'file-loader' : 'url-loader'
|
64
|
+
},
|
65
|
+
{ test: /\.sass$/, use: sassExtractor() },
|
66
|
+
{ test: /\.scss$/, use: sassExtractor() },
|
67
|
+
{ test: /\.css$/, use: sassExtractor() }
|
68
|
+
]
|
69
|
+
},
|
70
|
+
|
71
|
+
output: {
|
72
|
+
// Build assets directly in to public/webpack/, let webpack know
|
73
|
+
// that all webpacked assets start with webpack/
|
74
|
+
|
75
|
+
// must match config.webpack.output_dir
|
76
|
+
path: path.join(__dirname, '..', 'public', 'webpack'),
|
77
|
+
publicPath: '/webpack/',
|
78
|
+
|
79
|
+
filename: production ? '[name]-[chunkhash].js' : '[name].js'
|
80
|
+
},
|
81
|
+
|
82
|
+
resolve: {
|
83
|
+
modules: [path.resolve(__dirname, "..", "webpack"), path.resolve(__dirname, "..", "node_modules")],
|
84
|
+
extensions: [".js", ".es6", ".css", ".sass", ".scss"],
|
85
|
+
},
|
86
|
+
|
87
|
+
plugins: [
|
88
|
+
extractSass,
|
89
|
+
new StatsPlugin('manifest.json', {
|
90
|
+
chunkModules: false,
|
91
|
+
source: false,
|
92
|
+
chunks: false,
|
93
|
+
modules: false,
|
94
|
+
assets: true
|
95
|
+
}),
|
96
|
+
new webpack.ProvidePlugin({
|
97
|
+
$: "jquery/dist/jquery",
|
98
|
+
jQuery: "jquery/dist/jquery",
|
99
|
+
"window.jQuery": "jquery/dist/jquery",
|
100
|
+
//Tether: "tether",
|
101
|
+
//"window.Tether": "tether",
|
102
|
+
"_": "lodash",
|
103
|
+
"window._": "lodash",
|
104
|
+
//Alert: "exports-loader?Alert!bootstrap/js/dist/alert",
|
105
|
+
//Button: "exports-loader?Button!bootstrap/js/dist/button",
|
106
|
+
})
|
107
|
+
]
|
108
|
+
};
|
109
|
+
|
110
|
+
if (production) {
|
111
|
+
config.plugins.push(
|
112
|
+
new webpack.optimize.CommonsChunkPlugin({name: 'vendor', filename: 'vendor-[chunkhash].js'}),
|
113
|
+
new webpack.optimize.UglifyJsPlugin({
|
114
|
+
compressor: { warnings: false },
|
115
|
+
sourceMap: false
|
116
|
+
}),
|
117
|
+
new webpack.DefinePlugin({ // <--key to reduce React's size
|
118
|
+
'process.env': { NODE_ENV: JSON.stringify('production') }
|
119
|
+
}),
|
120
|
+
new CompressionPlugin({
|
121
|
+
asset: "[path].gz",
|
122
|
+
algorithm: "gzip",
|
123
|
+
test: /\.js$|\.css$/,
|
124
|
+
threshold: 4096,
|
125
|
+
minRatio: 0.8
|
126
|
+
})
|
127
|
+
);
|
128
|
+
} else {
|
129
|
+
config.plugins.push(
|
130
|
+
new webpack.optimize.CommonsChunkPlugin({name: 'vendor', filename: 'vendor.js'}),
|
131
|
+
new webpack.NamedModulesPlugin()
|
132
|
+
)
|
133
|
+
|
134
|
+
config.devServer = {
|
135
|
+
port: devServerPort,
|
136
|
+
headers: { 'Access-Control-Allow-Origin': '*' },
|
137
|
+
};
|
138
|
+
config.output.publicPath = 'http://' + host + ':' + devServerPort + '/webpack/';
|
139
|
+
config.devtool = 'source-map';
|
140
|
+
}
|
141
|
+
|
142
|
+
module.exports = config;
|
143
|
+
|
144
|
+
|
@@ -0,0 +1,16 @@
|
|
1
|
+
//import 'font-awesome/css/font-awesome.css';
|
2
|
+
import 'application.sass';
|
3
|
+
import Errors from 'errors';
|
4
|
+
import 'flash';
|
5
|
+
//import 'bootstrap';
|
6
|
+
|
7
|
+
window.A = {}
|
8
|
+
A.errors = new Errors()
|
9
|
+
A.errors.checkCookie();
|
10
|
+
|
11
|
+
import Turbolinks from "turbolinks";
|
12
|
+
Turbolinks.start()
|
13
|
+
|
14
|
+
document.addEventListener("turbolinks:load", function() {
|
15
|
+
})
|
16
|
+
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<div class="errors">
|
2
|
+
<a class="logo-ta" target="_blank" href="http://travelask.ru"></a>
|
3
|
+
<a class="logo-toyota" target="_blank" href="https://www.toyota.ru"></a>
|
4
|
+
<div class="errors-inner">
|
5
|
+
<h3>{{title}}</h3>
|
6
|
+
<a target="_blank" href="{{link}}">{{anchor}}</a>, {{message}}
|
7
|
+
</div>
|
8
|
+
</div>
|
9
|
+
|
@@ -0,0 +1,30 @@
|
|
1
|
+
import './index.sass';
|
2
|
+
import Cookies from 'js-cookie';
|
3
|
+
import template from './errors.handlebars';
|
4
|
+
|
5
|
+
const COOKIE_ERROR = {
|
6
|
+
title: 'В вашем броузере отключены Cookies',
|
7
|
+
link: 'https://yandex.ru/support/common/browsers-settings/browsers-cookies.xml',
|
8
|
+
anchor: 'Включите их',
|
9
|
+
message: 'чтобы зайти на сайт'
|
10
|
+
}
|
11
|
+
|
12
|
+
class Errors {
|
13
|
+
show(error) {
|
14
|
+
$('body').prepend(template(error));
|
15
|
+
}
|
16
|
+
|
17
|
+
checkCookie() {
|
18
|
+
$(".no-js-error").remove()
|
19
|
+
$(".no-js-script").remove()
|
20
|
+
if (!Cookies.get('cookies_on')) {
|
21
|
+
this.show(COOKIE_ERROR);
|
22
|
+
console.error('cookies not supported');
|
23
|
+
} else {
|
24
|
+
//console.info('cookies supported');
|
25
|
+
}
|
26
|
+
}
|
27
|
+
}
|
28
|
+
|
29
|
+
export default Errors;
|
30
|
+
|
@@ -0,0 +1,49 @@
|
|
1
|
+
.errors
|
2
|
+
position: fixed
|
3
|
+
top: 0
|
4
|
+
left: 0
|
5
|
+
right: 0
|
6
|
+
bottom: 0
|
7
|
+
background: #b70f25 no-repeat 100% 100% / cover
|
8
|
+
color: #fff
|
9
|
+
z-index: 2000
|
10
|
+
.logo-ta
|
11
|
+
top: 55px
|
12
|
+
|
13
|
+
.errors-inner
|
14
|
+
display: table-cell
|
15
|
+
text-align: center
|
16
|
+
vertical-align: middle
|
17
|
+
width: 100vw
|
18
|
+
height: 100vh
|
19
|
+
a
|
20
|
+
color: #fff
|
21
|
+
h3
|
22
|
+
max-width: 720px
|
23
|
+
margin: 0 auto 20px
|
24
|
+
font-size: 44px
|
25
|
+
font-weight: 700
|
26
|
+
span
|
27
|
+
display: block
|
28
|
+
font-size: 34px
|
29
|
+
font-weight: 400
|
30
|
+
margin-bottom: 45px
|
31
|
+
margin-top: 20px
|
32
|
+
|
33
|
+
.btn-transparent
|
34
|
+
height: 66px
|
35
|
+
padding: 22px 25px
|
36
|
+
text-transform: uppercase
|
37
|
+
font-size: 17px
|
38
|
+
text-transform: none
|
39
|
+
&:hover
|
40
|
+
border-color: #fff
|
41
|
+
background: #fff
|
42
|
+
color: #ff0026
|
43
|
+
|
44
|
+
.no-js-error
|
45
|
+
display: none
|
46
|
+
|
47
|
+
body.no-js
|
48
|
+
.no-js-error
|
49
|
+
display: block
|