rocket_cms 0.6.3 → 0.6.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/app/models/concerns/mappable.rb +10 -8
- data/app/views/rails_admin/main/_check_boxes.html.haml +1 -1
- data/app/views/rails_admin/main/_enum_check_boxes.html.haml +2 -0
- data/app/views/rails_admin/main/_enum_radio_buttons.html.haml +2 -0
- data/lib/rocket_cms/admin.rb +5 -4
- data/lib/rocket_cms/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e5353eebe00fca900bbae6b353137de684e512a6
|
4
|
+
data.tar.gz: c34c7fbbcecc3a777f8472e0bd2afa37ce27a224
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af8f6ab7d941bf58a482ddea75b1c7d716e9bee7b719355bffed940d95bd5d0e4a87fe2412beda58744468fb91c54e36b655c2433de968da402fc411c287d13e
|
7
|
+
data.tar.gz: 5b9148db5dcfd0cc23d142b52e05f190c8ec42321a6f67aa1ba8f4b4ba702717fe135ef3cbda203a46f1a307b31cc4104a1a12c1a0569284b6e5ffaddbcbd478
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rocket_cms (0.6.
|
4
|
+
rocket_cms (0.6.4)
|
5
5
|
addressable
|
6
6
|
coffee-rails
|
7
7
|
devise
|
@@ -95,7 +95,7 @@ GEM
|
|
95
95
|
haml (4.0.6)
|
96
96
|
tilt
|
97
97
|
hike (1.2.3)
|
98
|
-
htmlentities (4.3.
|
98
|
+
htmlentities (4.3.3)
|
99
99
|
i18n (0.7.0)
|
100
100
|
jquery-rails (4.0.2)
|
101
101
|
rails-dom-testing (~> 1.0)
|
@@ -13,20 +13,22 @@ module Mappable
|
|
13
13
|
|
14
14
|
field :lat, type: Float
|
15
15
|
field :lon, type: Float
|
16
|
-
else
|
17
|
-
def coordinates
|
18
|
-
if latitude.nil? || longitude.nil?
|
19
|
-
nil
|
20
|
-
else
|
21
|
-
[longitude, latitude]
|
22
|
-
end
|
23
|
-
end
|
24
16
|
end
|
25
17
|
|
26
18
|
geocoded_by :geo_address
|
27
19
|
after_validation :do_geocode
|
28
20
|
end
|
29
21
|
|
22
|
+
if RocketCMS.active_record?
|
23
|
+
def coordinates
|
24
|
+
if latitude.nil? || longitude.nil?
|
25
|
+
nil
|
26
|
+
else
|
27
|
+
[longitude, latitude]
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
30
32
|
def do_geocode
|
31
33
|
if geo_address.blank?
|
32
34
|
if RocketCMS.mongoid?
|
@@ -1,5 +1,5 @@
|
|
1
1
|
- if params[:associations].nil?
|
2
|
-
=
|
2
|
+
= render 'rails_admin/main/enum_check_boxes', field: field, form: form
|
3
3
|
- else
|
4
4
|
:ruby
|
5
5
|
related_id = params[:associations] && params[:associations][field.name.to_s]
|
@@ -0,0 +1,2 @@
|
|
1
|
+
- values = form.object.class.send(field.method_name).values.map { |v| [t("enumerize.#{form.object.class.name.downcase}.#{field.method_name}.#{v}", default: t("enumerize.defaults.#{field.method_name}.#{v}")), v] }
|
2
|
+
= form.collection_check_boxes field.method_name, values, :last, :first, {}, {} { |i| i.label( class: 'checkbox' ) { i.check_box + i.text } }
|
@@ -0,0 +1,2 @@
|
|
1
|
+
- values = form.object.class.send(field.method_name).values.map { |v| [t("enumerize.#{form.object.class.name.downcase}.#{field.method_name}.#{v}", default: t("enumerize.defaults.#{field.method_name}.#{v}")), v] }
|
2
|
+
= form.collection_radio_buttons field.method_name, values, :last, :first, {}, {} { |i| i.label(class: 'radio') { i.radio_button + i.text } }
|
data/lib/rocket_cms/admin.rb
CHANGED
@@ -1,23 +1,24 @@
|
|
1
1
|
module RocketCMS
|
2
2
|
class << self
|
3
|
-
def map_config
|
3
|
+
def map_config(is_active = true)
|
4
4
|
Proc.new {
|
5
|
-
active
|
5
|
+
active is_active
|
6
6
|
label I18n.t('rs.map')
|
7
7
|
field :address, :string
|
8
8
|
field :map_address, :string
|
9
9
|
field :map_hint, :string
|
10
10
|
field :coordinates, :string do
|
11
11
|
read_only true
|
12
|
+
formatted_value{ bindings[:object].coordinates.to_json }
|
12
13
|
end
|
13
14
|
field :lat
|
14
15
|
field :lon
|
15
16
|
}
|
16
17
|
end
|
17
18
|
|
18
|
-
def seo_config
|
19
|
+
def seo_config(is_active = false)
|
19
20
|
Proc.new {
|
20
|
-
active
|
21
|
+
active is_active
|
21
22
|
label "SEO"
|
22
23
|
field :h1, :string
|
23
24
|
field :title, :string
|
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.6.
|
4
|
+
version: 0.6.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- glebtv
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-12-
|
11
|
+
date: 2014-12-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -399,6 +399,8 @@ files:
|
|
399
399
|
- app/views/news/show.html.haml
|
400
400
|
- app/views/pages/show.html.haml
|
401
401
|
- app/views/rails_admin/main/_check_boxes.html.haml
|
402
|
+
- app/views/rails_admin/main/_enum_check_boxes.html.haml
|
403
|
+
- app/views/rails_admin/main/_enum_radio_buttons.html.haml
|
402
404
|
- app/views/rails_admin/main/_form_raw.html.haml
|
403
405
|
- app/views/search/index.html.haml
|
404
406
|
- app/views/shared/_admin_link.html.haml
|