rocket_cms 0.8.1 → 0.8.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +19 -10
- data/lib/rocket_cms/admin.rb +8 -1
- data/lib/rocket_cms/configuration.rb +3 -1
- data/lib/rocket_cms/models/news.rb +4 -1
- data/lib/rocket_cms/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 85127d2a64925a154b5706dfdd94bcc6464d2d73
|
4
|
+
data.tar.gz: 78e5708f752c78f568a192cdc47725a55515b401
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f569cab052ba36f563690352d6c8813550ace4ea10a1cc25a3441301041abb1248e0bf6c025f88a7fb3786d3d52ad633786c891ed9e0e90f4b183fec49182267
|
7
|
+
data.tar.gz: a9370d8fa9bf3eb8582c72e530b02e807efab2d6791d60d49b91fbe4776840451ab7a51aeb37532a866bd3ccab00aae9447012c6504922733707fba56bb8adcc
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,13 +1,10 @@
|
|
1
1
|
# RocketCMS
|
2
2
|
|
3
|
-
|
3
|
+
Rails + RailsAdmin + Mongoid/PostgreSQL + Elasticsearch CMS
|
4
4
|
|
5
5
|
Very opinionated and tuned for our needs.
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
**Before 1.0 API and class names should be considered unstable and can change at
|
10
|
-
any time!**
|
7
|
+
**Before 1.0 API and class names should be considered unstable and can change at any time!**
|
11
8
|
|
12
9
|
## Installation
|
13
10
|
|
@@ -60,13 +57,13 @@ generator creates a new RVM gemset, so after cd'ing to app dir, you should run `
|
|
60
57
|
|
61
58
|
### Localization
|
62
59
|
|
63
|
-
All models included in the gem support localization via either hstore_translate or built-in Mongoid localize: true option.
|
60
|
+
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.
|
64
61
|
|
65
62
|
You can get a nice admin UI for editing locales by adding [rails_admin_hstore_translate](https://github.com/glebtv/rails_admin_hstore_translate) or [rails_admin_mongoid_localize_field](https://github.com/sudosu/rails_admin_mongoid_localize_field)
|
66
63
|
|
67
64
|
Add to: ```app/models/page.rb```
|
68
65
|
|
69
|
-
```
|
66
|
+
```ruby
|
70
67
|
class Page < ActiveRecord::Base
|
71
68
|
include RocketCMS::Models::Page
|
72
69
|
RocketCMS.apply_patches self
|
@@ -80,7 +77,7 @@ end
|
|
80
77
|
|
81
78
|
Wrap your routes with locale scope:
|
82
79
|
|
83
|
-
```
|
80
|
+
```ruby
|
84
81
|
scope "(:locale)", locale: /en|ru/ do
|
85
82
|
get 'contacts' => 'contacts#new', as: :contacts
|
86
83
|
post 'contacts' => 'contacts#create', as: :create_contacts
|
@@ -89,7 +86,7 @@ end
|
|
89
86
|
|
90
87
|
Add to application_controller.rb:
|
91
88
|
|
92
|
-
```
|
89
|
+
```ruby
|
93
90
|
class ApplicationController < ActionController::Base
|
94
91
|
include RocketCMS::Controller
|
95
92
|
include RsLocalizeable
|
@@ -98,7 +95,7 @@ end
|
|
98
95
|
|
99
96
|
Enable localization in RocketCMS:
|
100
97
|
|
101
|
-
```
|
98
|
+
```ruby
|
102
99
|
RocketCMS.configure do |rc|
|
103
100
|
rc.news_image_styles = {small: '107x126#'}
|
104
101
|
rc.contacts_captcha = true
|
@@ -108,6 +105,18 @@ RocketCMS.configure do |rc|
|
|
108
105
|
end
|
109
106
|
```
|
110
107
|
|
108
|
+
Add ```rails_admin_hstore_translate``` or ```hstore_translate``` gem if using PostgreSQL:
|
109
|
+
|
110
|
+
```ruby
|
111
|
+
gem 'rails_admin_hstore_translate'
|
112
|
+
```
|
113
|
+
|
114
|
+
or
|
115
|
+
|
116
|
+
```ruby
|
117
|
+
gem 'hstore_translate'
|
118
|
+
```
|
119
|
+
|
111
120
|
### Documentation
|
112
121
|
|
113
122
|
It's basically Mongoid + Rails Admin + some of our common models and controllers, capistrano config, etc.
|
data/lib/rocket_cms/admin.rb
CHANGED
@@ -125,7 +125,9 @@ module RocketCMS
|
|
125
125
|
navigation_label I18n.t('rs.cms')
|
126
126
|
|
127
127
|
field :enabled, :toggle
|
128
|
-
field :time
|
128
|
+
field :time do
|
129
|
+
sort_reverse true
|
130
|
+
end
|
129
131
|
field :name
|
130
132
|
unless RocketCMS.config.news_image_styles.nil?
|
131
133
|
field :image
|
@@ -133,6 +135,11 @@ module RocketCMS
|
|
133
135
|
field :excerpt
|
134
136
|
RocketCMS.apply_patches self
|
135
137
|
|
138
|
+
list do
|
139
|
+
RocketCMS.apply_patches self
|
140
|
+
sort_by :time
|
141
|
+
end
|
142
|
+
|
136
143
|
edit do
|
137
144
|
field :content, :ck_editor
|
138
145
|
RocketCMS.apply_patches self
|
@@ -14,6 +14,7 @@ module RocketCMS
|
|
14
14
|
attr_accessor :news_image_styles
|
15
15
|
attr_accessor :news_per_page
|
16
16
|
attr_accessor :news_excerpt
|
17
|
+
attr_accessor :news_content_required
|
17
18
|
|
18
19
|
attr_accessor :error_layout
|
19
20
|
attr_accessor :menu_max_depth
|
@@ -35,6 +36,7 @@ module RocketCMS
|
|
35
36
|
}
|
36
37
|
@news_per_page = 10
|
37
38
|
@news_excerpt = 12
|
39
|
+
@news_content_required = true
|
38
40
|
|
39
41
|
@error_layout = 'application'
|
40
42
|
@menu_max_depth = 2
|
@@ -58,4 +60,4 @@ module RocketCMS
|
|
58
60
|
end
|
59
61
|
end
|
60
62
|
end
|
61
|
-
end
|
63
|
+
end
|
@@ -17,7 +17,10 @@ module RocketCMS
|
|
17
17
|
validates_attachment_content_type :image, content_type: /\Aimage\/.*\Z/, if: :image?
|
18
18
|
end
|
19
19
|
|
20
|
-
validates_presence_of :name
|
20
|
+
validates_presence_of :name
|
21
|
+
if RocketCMS.config.news_content_required
|
22
|
+
validates_presence_of :content
|
23
|
+
end
|
21
24
|
before_validation do
|
22
25
|
self.time = Time.now if self.time.blank?
|
23
26
|
end
|
data/lib/rocket_cms/version.rb
CHANGED
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.8.
|
4
|
+
version: 0.8.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- glebtv
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|