rocket_cms 0.5.12 → 0.5.14

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 376c4a888ed2f61a005754d6754f664df0fee369
4
- data.tar.gz: 133212b0bfa1b35279265f98a4891ad70c31ce69
3
+ metadata.gz: d9499c0e7e982e4b9c50d2064f491ff3d06fc07c
4
+ data.tar.gz: 3d357ed381f1072a05eb5a2c17558690947b4ca9
5
5
  SHA512:
6
- metadata.gz: a52b3b29affe890f3eb379a71083214e2cb42149ca6684031a47df5cb0bdfb67351a90c0ed244413666a9be27740dbbdd6c7d68843dc31b789cd96363522d22c
7
- data.tar.gz: b4702630cb19810726b97e7235c80f02f1986462eab42ffa54ce5b33e77dae4f774f0bd25327f31008fea888e3cd5918b58f8a16b377b1258dfaa841825c3b35
6
+ metadata.gz: 2b73b7d89b18c299f97f3e66f7dd58a8b65280df3f95e3fa61baf916cefa2c3db3550723866b0cb792c6de6fa8119eab08e6c9bd8b860bc6f7345c0b47973fdf
7
+ data.tar.gz: 8bd306e7791fca71f0675ab814c00c356d49f479abed35d2c1b6882ee1ec244cbe1477a79fbdd2ff18a21c50768caa824120640e73ec073ec3e4238f2839d96e
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rocket_cms (0.5.12)
4
+ rocket_cms (0.5.14)
5
5
  addressable
6
6
  coffee-rails
7
7
  devise
@@ -27,27 +27,27 @@ PATH
27
27
  GEM
28
28
  remote: https://rubygems.org/
29
29
  specs:
30
- actionmailer (4.1.6)
31
- actionpack (= 4.1.6)
32
- actionview (= 4.1.6)
30
+ actionmailer (4.1.7)
31
+ actionpack (= 4.1.7)
32
+ actionview (= 4.1.7)
33
33
  mail (~> 2.5, >= 2.5.4)
34
- actionpack (4.1.6)
35
- actionview (= 4.1.6)
36
- activesupport (= 4.1.6)
34
+ actionpack (4.1.7)
35
+ actionview (= 4.1.7)
36
+ activesupport (= 4.1.7)
37
37
  rack (~> 1.5.2)
38
38
  rack-test (~> 0.6.2)
39
- actionview (4.1.6)
40
- activesupport (= 4.1.6)
39
+ actionview (4.1.7)
40
+ activesupport (= 4.1.7)
41
41
  builder (~> 3.1)
42
42
  erubis (~> 2.7.0)
43
- activemodel (4.1.6)
44
- activesupport (= 4.1.6)
43
+ activemodel (4.1.7)
44
+ activesupport (= 4.1.7)
45
45
  builder (~> 3.1)
46
- activerecord (4.1.6)
47
- activemodel (= 4.1.6)
48
- activesupport (= 4.1.6)
46
+ activerecord (4.1.7)
47
+ activemodel (= 4.1.7)
48
+ activesupport (= 4.1.7)
49
49
  arel (~> 5.0.0)
50
- activesupport (4.1.6)
50
+ activesupport (4.1.7)
51
51
  i18n (~> 0.6, >= 0.6.9)
52
52
  json (~> 1.7, >= 1.7.7)
53
53
  minitest (~> 5.1)
@@ -64,7 +64,7 @@ GEM
64
64
  coffee-script-source
65
65
  execjs
66
66
  coffee-script-source (1.8.0)
67
- devise (3.4.0)
67
+ devise (3.4.1)
68
68
  bcrypt (~> 3.0)
69
69
  orm_adapter (~> 0.1)
70
70
  railties (>= 3.2.6, < 5)
@@ -75,7 +75,7 @@ GEM
75
75
  execjs (2.2.2)
76
76
  font-awesome-rails (4.2.0.0)
77
77
  railties (>= 3.2, < 5.0)
78
- geocoder (1.2.5)
78
+ geocoder (1.2.6)
79
79
  glebtv-ckeditor (4.4.3.4)
80
80
  mime-types
81
81
  orm_adapter (~> 0.5.0)
@@ -95,15 +95,15 @@ GEM
95
95
  kaminari (0.16.1)
96
96
  actionpack (>= 3.0.0)
97
97
  activesupport (>= 3.0.0)
98
- mail (2.6.1)
98
+ mail (2.6.3)
99
99
  mime-types (>= 1.16, < 3)
100
100
  mime-types (2.4.3)
101
- mini_portile (0.6.0)
102
- minitest (5.4.2)
101
+ mini_portile (0.6.1)
102
+ minitest (5.4.3)
103
103
  multi_json (1.10.1)
104
104
  nested_form (0.3.2)
105
- nokogiri (1.6.3.1)
106
- mini_portile (= 0.6.0)
105
+ nokogiri (1.6.4.1)
106
+ mini_portile (~> 0.6.0)
107
107
  orm_adapter (0.5.0)
108
108
  rack (1.5.2)
109
109
  rack-pjax (0.8.0)
@@ -111,15 +111,15 @@ GEM
111
111
  rack (~> 1.1)
112
112
  rack-test (0.6.2)
113
113
  rack (>= 1.0)
114
- rails (4.1.6)
115
- actionmailer (= 4.1.6)
116
- actionpack (= 4.1.6)
117
- actionview (= 4.1.6)
118
- activemodel (= 4.1.6)
119
- activerecord (= 4.1.6)
120
- activesupport (= 4.1.6)
114
+ rails (4.1.7)
115
+ actionmailer (= 4.1.7)
116
+ actionpack (= 4.1.7)
117
+ actionview (= 4.1.7)
118
+ activemodel (= 4.1.7)
119
+ activerecord (= 4.1.7)
120
+ activesupport (= 4.1.7)
121
121
  bundler (>= 1.3.0, < 2.0)
122
- railties (= 4.1.6)
122
+ railties (= 4.1.7)
123
123
  sprockets-rails (~> 2.0)
124
124
  rails_admin (0.6.5)
125
125
  builder (~> 3.1)
@@ -135,20 +135,20 @@ GEM
135
135
  remotipart (~> 1.0)
136
136
  safe_yaml (~> 1.0)
137
137
  sass-rails (~> 4.0)
138
- rails_admin_nested_set (0.3.6)
138
+ rails_admin_nested_set (0.3.8)
139
139
  rails_admin_settings (0.9.0.pre.6)
140
140
  rails_admin_toggleable (0.4.1)
141
- railties (4.1.6)
142
- actionpack (= 4.1.6)
143
- activesupport (= 4.1.6)
141
+ railties (4.1.7)
142
+ actionpack (= 4.1.7)
143
+ activesupport (= 4.1.7)
144
144
  rake (>= 0.8.7)
145
145
  thor (>= 0.18.1, < 2.0)
146
146
  rake (10.3.2)
147
147
  remotipart (1.2.1)
148
- responders (1.1.1)
148
+ responders (1.1.2)
149
149
  railties (>= 3.2, < 4.2)
150
150
  safe_yaml (1.0.4)
151
- sass (3.4.6)
151
+ sass (3.4.8)
152
152
  sass-rails (4.0.1)
153
153
  railties (>= 4.0.0, < 5.0)
154
154
  sass (>= 3.1.10)
@@ -163,7 +163,7 @@ GEM
163
163
  smart_excerpt (0.1.4)
164
164
  activesupport
165
165
  htmlentities
166
- sprockets (2.12.2)
166
+ sprockets (2.12.3)
167
167
  hike (~> 1.2)
168
168
  multi_json (~> 1.0)
169
169
  rack (~> 1.0)
@@ -176,7 +176,7 @@ GEM
176
176
  thor (0.19.1)
177
177
  thread_safe (0.3.4)
178
178
  tilt (1.4.1)
179
- turbolinks (2.4.0)
179
+ turbolinks (2.5.2)
180
180
  coffee-rails
181
181
  tzinfo (1.2.2)
182
182
  thread_safe (~> 0.1)
@@ -0,0 +1,9 @@
1
+ module ManualSlug
2
+ extend ActiveSupport::Concern
3
+ if RocketCMS.mongoid?
4
+ include ManualSlug::Mongoid
5
+ else
6
+ include ManualSlug::ActiveRecord
7
+ end
8
+ end
9
+
@@ -0,0 +1,21 @@
1
+ module ManualSlug::ActiveRecord
2
+ extend ActiveSupport::Concern
3
+
4
+ included do
5
+ extend FriendlyId
6
+ end
7
+
8
+ def text_slug
9
+ slug
10
+ end
11
+ def text_slug=(s)
12
+ self.slug = s
13
+ end
14
+
15
+ module ClassMethods
16
+ def manual_slug(field, options = {}, callback = true)
17
+ friendly_id field, use: [:slugged, :finders]
18
+ end
19
+ end
20
+ end
21
+
@@ -0,0 +1,39 @@
1
+ module ManualSlug::Mongoid
2
+ extend ActiveSupport::Concern
3
+ include Mongoid::Slug
4
+
5
+ def text_slug
6
+ self._slugs.empty? ? '' : self._slugs.last
7
+ end
8
+ def text_slug=(slug)
9
+ if slug.blank?
10
+ self._slugs = []
11
+ else
12
+ self._slugs.delete(slug)
13
+ self._slugs << slug
14
+ end
15
+ end
16
+
17
+ module ClassMethods
18
+ def manual_slug(field, options = {}, callback = true)
19
+ options.merge!(permanent: true, history: true)
20
+ slug field, options
21
+
22
+ # we will create slugs manually when needed
23
+ skip_callback :create, :before, :build_slug
24
+
25
+ before_validation do
26
+ self._slugs = self._slugs.map{ |s| s.strip }.select {|s| !s.blank? }
27
+
28
+ if self._slugs.empty?
29
+ self.build_slug
30
+ end
31
+
32
+ true
33
+ end if callback
34
+ end
35
+ end
36
+
37
+ end
38
+
39
+
@@ -4,8 +4,6 @@ module RocketCMS
4
4
  module Menu
5
5
  extend ActiveSupport::Concern
6
6
  included do
7
- extend FriendlyId
8
- friendly_id :report_slug, use: [:slugged, :finders]
9
7
  has_paper_trail
10
8
  validates_lengths_from_database
11
9
  end
@@ -4,13 +4,10 @@ module RocketCMS
4
4
  module News
5
5
  extend ActiveSupport::Concern
6
6
  included do
7
- extend FriendlyId
8
-
9
7
  unless RocketCMS.configuration.news_image_styles.nil?
10
8
  has_attached_file :image, styles: RocketCMS.configuration.news_image_styles
11
9
  validates_attachment_content_type :image, content_type: %w(image/gif image/jpeg image/jpg image/png), if: :image?
12
10
  end
13
- friendly_id :report_slug, use: [:slugged, :finders]
14
11
 
15
12
  has_paper_trail
16
13
 
@@ -6,12 +6,8 @@ module RocketCMS
6
6
 
7
7
  included do
8
8
  acts_as_nested_set
9
-
10
- extend FriendlyId
11
- friendly_id :name, use: [:slugged, :finders]
12
9
  has_paper_trail
13
10
  validates_lengths_from_database only: [:name, :title, :content, :excerpt, :h1, :keywords, :robots, :og_title, :regexp, :redirect, :fullpath]
14
-
15
11
  scope :sorted, -> { order(lft: :asc) }
16
12
  end
17
13
  end
@@ -5,6 +5,7 @@ module RocketCMS
5
5
  include RocketCMS::Model
6
6
  include Enableable
7
7
  include RocketCMS.orm_specific('Menu')
8
+ include ManualSlug
8
9
  included do
9
10
  after_save do
10
11
  Rails.cache.delete 'menus'
@@ -13,6 +14,7 @@ module RocketCMS
13
14
  Rails.cache.delete 'menus'
14
15
  end
15
16
  has_and_belongs_to_many :pages, inverse_of: :menus
17
+ manual_slug :name
16
18
  end
17
19
  end
18
20
  end
@@ -3,10 +3,8 @@ module RocketCMS
3
3
  module Mongoid
4
4
  module Menu
5
5
  extend ActiveSupport::Concern
6
- include ManualSlug
7
6
  included do
8
7
  field :name, type: String
9
- manual_slug :name
10
8
  end
11
9
  end
12
10
  end
@@ -6,7 +6,6 @@ module RocketCMS
6
6
  unless RocketCMS.configuration.news_image_styles.nil?
7
7
  include ::Mongoid::Paperclip
8
8
  end
9
- include ManualSlug
10
9
  included do
11
10
  field :time, type: Time
12
11
  index({enabled: 1, time: 1})
@@ -17,7 +16,6 @@ module RocketCMS
17
16
 
18
17
  field :excerpt, type: String, localize: RocketCMS.configuration.localize
19
18
  field :content, type: String, localize: RocketCMS.configuration.localize
20
- manual_slug :report_slug
21
19
 
22
20
  scope :after_now, -> { where(:time.lt => Time.now) }
23
21
  scope :by_date, -> { desc(:time) }
@@ -3,7 +3,6 @@ module RocketCMS
3
3
  module Mongoid
4
4
  module Page
5
5
  extend ActiveSupport::Concern
6
- include ManualSlug
7
6
  included do
8
7
  field :regexp, type: String
9
8
  field :redirect, type: String
@@ -11,7 +10,6 @@ module RocketCMS
11
10
  field :fullpath, type: String
12
11
  has_and_belongs_to_many :menus, inverse_of: :pages
13
12
  acts_as_nested_set
14
- manual_slug :name
15
13
  scope :sorted, -> { asc(:lft) }
16
14
  end
17
15
  end
@@ -6,6 +6,7 @@ module RocketCMS
6
6
  include Seoable
7
7
  include Enableable
8
8
  include RocketCMS.orm_specific('News')
9
+ include ManualSlug
9
10
 
10
11
  if RocketCMS.configuration.search_enabled
11
12
  include RocketCMS::ElasticSearch
@@ -21,6 +22,8 @@ module RocketCMS
21
22
  paginates_per RocketCMS.configuration.news_per_page
22
23
  end
23
24
  smart_excerpt :excerpt, :content, RocketCMS.configuration.news_excerpt
25
+ manual_slug :report_slug
26
+
24
27
  RocketCMS.apply_patches self
25
28
  end
26
29
 
@@ -5,6 +5,7 @@ module RocketCMS
5
5
  include RocketCMS::Model
6
6
  include Enableable
7
7
  include Seoable
8
+ include ManualSlug
8
9
 
9
10
  include RocketCMS.orm_specific('Page')
10
11
 
@@ -19,6 +20,7 @@ module RocketCMS
19
20
  end
20
21
  validates_uniqueness_of :fullpath
21
22
  validates_presence_of :name
23
+ manual_slug :name
22
24
  end
23
25
 
24
26
  def get_fullpath
@@ -1,3 +1,3 @@
1
1
  module RocketCMS
2
- VERSION = "0.5.12"
2
+ VERSION = "0.5.14"
3
3
  end
data/template.rb CHANGED
@@ -196,7 +196,7 @@ Rails.application.routes.draw do
196
196
  mount RailsAdmin::Engine => '/admin', as: 'rails_admin'
197
197
  mount Ckeditor::Engine => '/ckeditor'
198
198
 
199
- get 'contacts' => 'contacts#index', as: :contacts
199
+ get 'contacts' => 'contacts#new', as: :contacts
200
200
  post 'contacts' => 'contacts#create', as: :create_contacts
201
201
  get 'contacts/sent' => 'contacts#sent', as: :contacts_sent
202
202
 
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.12
4
+ version: 0.5.14
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-27 00:00:00.000000000 Z
11
+ date: 2014-11-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -370,6 +370,9 @@ files:
370
370
  - app/models/concerns/boolean_field.rb
371
371
  - app/models/concerns/enableable.rb
372
372
  - app/models/concerns/geocodeable.rb
373
+ - app/models/concerns/manual_slug.rb
374
+ - app/models/concerns/manual_slug/active_record.rb
375
+ - app/models/concerns/manual_slug/mongoid.rb
373
376
  - app/models/concerns/mappable.rb
374
377
  - app/models/concerns/seoable.rb
375
378
  - app/models/concerns/sort_field.rb