comfortable_mexican_sofa 1.12.10 → 1.12.11
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 +5 -5
- data/.travis.yml +6 -13
- data/Gemfile +1 -3
- data/README.md +6 -1
- data/_config.yml +1 -0
- data/app/assets/javascripts/comfy/admin/cms/base.js.coffee +1 -1
- data/app/assets/javascripts/comfy/admin/cms/lib/diff.js.coffee +1 -1
- data/app/models/comfy/cms/site.rb +7 -1
- data/app/views/comfy/admin/cms/pages/_form.html.haml +1 -1
- data/config/locales/pt-BR.yml +3 -3
- data/lib/comfortable_mexican_sofa/version.rb +1 -1
- data/test/models/site_test.rb +46 -29
- metadata +4 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 9f70c039dbce8b042c0357c1fdea1934dbcd867702aa78a8194955db4174d82a
|
|
4
|
+
data.tar.gz: a50c14e1e7c81012e630ecd3feec5f0ef49595f01b6158719f0b1d23ceaaa43f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fac42de19669e82b6b9e91d58a3ba755b5e982a36f906c81e32532f547a7351936651a7044321a1edb5237324ffacf149a8b80fa3ce009f0696a7c7866f4238a
|
|
7
|
+
data.tar.gz: 4dbf87a9a70967c876da2119a25f54f15eed2e04032f64dd6f08e5d4e7421bfa59c38a8b17a8cccf1f9cec759d78549a9c496264ff868b37d31aa109b0380802
|
data/.travis.yml
CHANGED
|
@@ -6,10 +6,9 @@ before_script:
|
|
|
6
6
|
script:
|
|
7
7
|
- rake ci
|
|
8
8
|
rvm:
|
|
9
|
-
- 2.
|
|
10
|
-
- 2.
|
|
11
|
-
- 2.2
|
|
12
|
-
- 2.3.1
|
|
9
|
+
- 2.2.7
|
|
10
|
+
- 2.3.5
|
|
11
|
+
- 2.4.2
|
|
13
12
|
gemfile:
|
|
14
13
|
- test/gemfiles/Gemfile.rails.4.1
|
|
15
14
|
- test/gemfiles/Gemfile.rails.4.2
|
|
@@ -19,13 +18,7 @@ branches:
|
|
|
19
18
|
- master
|
|
20
19
|
matrix:
|
|
21
20
|
fast_finish: true
|
|
22
|
-
include:
|
|
23
|
-
- rvm: 2.3.1
|
|
24
|
-
gemfile: test/gemfiles/Gemfile.rails.master
|
|
25
21
|
exclude:
|
|
26
|
-
- rvm: 2.
|
|
27
|
-
gemfile: test/gemfiles/Gemfile.rails.
|
|
28
|
-
|
|
29
|
-
gemfile: test/gemfiles/Gemfile.rails.5.0
|
|
30
|
-
allow_failures:
|
|
31
|
-
- gemfile: test/gemfiles/Gemfile.rails.master
|
|
22
|
+
- rvm: 2.4.2
|
|
23
|
+
gemfile: test/gemfiles/Gemfile.rails.4.1
|
|
24
|
+
|
data/Gemfile
CHANGED
|
@@ -5,8 +5,6 @@ gemspec
|
|
|
5
5
|
# apps can also use will_paginate so there's no dependency in gemspec
|
|
6
6
|
gem 'kaminari'
|
|
7
7
|
|
|
8
|
-
gem 'rails', '~> 5.0.0'
|
|
9
|
-
|
|
10
8
|
group :development do
|
|
11
9
|
gem 'awesome_print'
|
|
12
10
|
gem 'better_errors'
|
|
@@ -15,7 +13,7 @@ end
|
|
|
15
13
|
|
|
16
14
|
group :test do
|
|
17
15
|
gem 'rails-controller-testing'
|
|
18
|
-
|
|
16
|
+
|
|
19
17
|
gem 'sqlite3', :platform => [:ruby, :mswin, :mingw]
|
|
20
18
|
gem 'jdbc-sqlite3', :platform => :jruby
|
|
21
19
|
gem 'activerecord-jdbcsqlite3-adapter', :platform => :jruby
|
data/README.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# ComfortableMexicanSofa
|
|
2
|
-
[](http://rubygems.org/gems/comfortable_mexican_sofa)
|
|
2
|
+
[](http://rubygems.org/gems/comfortable_mexican_sofa)
|
|
3
|
+
[](http://rubygems.org/gems/comfortable_mexican_sofa)
|
|
4
|
+
[](https://travis-ci.org/comfy/comfortable-mexican-sofa)
|
|
5
|
+
[](https://gemnasium.com/comfy/comfortable-mexican-sofa)
|
|
6
|
+
[](https://codeclimate.com/github/comfy/comfortable-mexican-sofa)
|
|
7
|
+
[](https://coveralls.io/r/comfy/comfortable-mexican-sofa?branch=master)
|
|
3
8
|
|
|
4
9
|
ComfortableMexicanSofa is a powerful Rails 4/5 CMS Engine
|
|
5
10
|
|
data/_config.yml
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
theme: jekyll-theme-tactile
|
|
@@ -3,7 +3,7 @@ window.CMS ||= {}
|
|
|
3
3
|
window.CMS.code_mirror_instances = [ ]
|
|
4
4
|
|
|
5
5
|
$ -> window.CMS.init()
|
|
6
|
-
$(document).on 'page:load', -> window.CMS.init()
|
|
6
|
+
$(document).on 'page:load turbolinks:load', -> window.CMS.init()
|
|
7
7
|
|
|
8
8
|
window.CMS.init = ->
|
|
9
9
|
window.CMS.current_path = window.location.pathname
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#= require comfy/admin/cms/lib/diff/diff_match_patch.min
|
|
2
2
|
#= require comfy/admin/cms/lib/diff/pretty_text_diff.min
|
|
3
3
|
|
|
4
|
-
$(document).on 'page:load ready', ->
|
|
4
|
+
$(document).on 'page:load ready turbolinks:load', ->
|
|
5
5
|
$("table.diff").prettyTextDiff ->
|
|
6
6
|
cleanup: true
|
|
7
7
|
originalContainer: 'tr td.original'
|
|
@@ -37,10 +37,16 @@ class Comfy::Cms::Site < ActiveRecord::Base
|
|
|
37
37
|
def self.find_site(host, path = nil)
|
|
38
38
|
return Comfy::Cms::Site.first if Comfy::Cms::Site.count == 1
|
|
39
39
|
cms_site = nil
|
|
40
|
+
|
|
41
|
+
public_cms_path = ComfortableMexicanSofa.configuration.public_cms_path
|
|
42
|
+
if path && public_cms_path != "/"
|
|
43
|
+
path = path.sub(%r{\A#{public_cms_path}}, "")
|
|
44
|
+
end
|
|
45
|
+
|
|
40
46
|
Comfy::Cms::Site.where(:hostname => real_host_from_aliases(host)).each do |site|
|
|
41
47
|
if site.path.blank?
|
|
42
48
|
cms_site = site
|
|
43
|
-
elsif "#{path.to_s.split('?')[0]}/"
|
|
49
|
+
elsif "#{path.to_s.split('?')[0]}/" =~ %r{^/#{Regexp.escape(site.path.to_s)}/}
|
|
44
50
|
cms_site = site
|
|
45
51
|
break
|
|
46
52
|
end
|
|
@@ -33,6 +33,6 @@
|
|
|
33
33
|
= render 'comfy/admin/cms/partials/page_form_after', :form => form
|
|
34
34
|
|
|
35
35
|
= form.form_group :class => 'form-actions' do
|
|
36
|
-
= form.submit t('.preview'), :name => 'preview', :id => nil, :class => 'btn btn-default'
|
|
36
|
+
= form.submit t('.preview'), :name => 'preview', :id => nil, :class => 'btn btn-default', :data => { :disable_with => false }
|
|
37
37
|
= form.submit t(@page.new_record?? '.create' : '.update'), :class => 'btn btn-primary'
|
|
38
38
|
= link_to t('.cancel'), comfy_admin_cms_site_pages_path, :class => 'btn btn-link'
|
data/config/locales/pt-BR.yml
CHANGED
|
@@ -109,9 +109,9 @@ pt-BR:
|
|
|
109
109
|
revision: &revision
|
|
110
110
|
zero: '%{count} Revisão'
|
|
111
111
|
one: '%{count} Revisão'
|
|
112
|
-
few: '%{count}
|
|
113
|
-
many: '%{count}
|
|
114
|
-
other: '%{count}
|
|
112
|
+
few: '%{count} Revisões'
|
|
113
|
+
many: '%{count} Revisões'
|
|
114
|
+
other: '%{count} Revisões'
|
|
115
115
|
form:
|
|
116
116
|
select_parent_layout: Selecione o Leiaute Pai
|
|
117
117
|
select_app_layout: Selecione o Leiaute da Aplicação
|
data/test/models/site_test.rb
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
require_relative '../test_helper'
|
|
2
2
|
|
|
3
3
|
class CmsSiteTest < ActiveSupport::TestCase
|
|
4
|
-
|
|
4
|
+
|
|
5
5
|
def test_fixtures_validity
|
|
6
6
|
Comfy::Cms::Site.all.each do |site|
|
|
7
7
|
assert site.valid?, site.errors.inspect
|
|
8
8
|
end
|
|
9
9
|
end
|
|
10
|
-
|
|
10
|
+
|
|
11
11
|
def test_validation
|
|
12
12
|
site = Comfy::Cms::Site.new
|
|
13
13
|
assert site.invalid?
|
|
14
14
|
assert_has_errors_on site, [:identifier, :label, :hostname]
|
|
15
|
-
|
|
15
|
+
|
|
16
16
|
site = Comfy::Cms::Site.new(:identifier => 'test', :hostname => 'http://site.host')
|
|
17
17
|
assert site.invalid?
|
|
18
18
|
assert_has_errors_on site, :hostname
|
|
19
|
-
|
|
19
|
+
|
|
20
20
|
site = Comfy::Cms::Site.new(:identifier => comfy_cms_sites(:default).identifier, :hostname => 'site.host')
|
|
21
21
|
assert site.invalid?
|
|
22
22
|
assert_has_errors_on site, :identifier
|
|
23
|
-
|
|
23
|
+
|
|
24
24
|
site = Comfy::Cms::Site.new(:identifier => 'test', :hostname => 'site.host')
|
|
25
25
|
assert site.valid?, site.errors.inspect
|
|
26
|
-
|
|
26
|
+
|
|
27
27
|
site = Comfy::Cms::Site.new(:identifier => 'test', :hostname => 'localhost:3000')
|
|
28
28
|
assert site.valid?, site.errors.inspect
|
|
29
29
|
end
|
|
30
|
-
|
|
30
|
+
|
|
31
31
|
def test_validation_path_uniqueness
|
|
32
32
|
s1 = comfy_cms_sites(:default)
|
|
33
33
|
s2 = Comfy::Cms::Site.new(
|
|
@@ -37,7 +37,7 @@ class CmsSiteTest < ActiveSupport::TestCase
|
|
|
37
37
|
)
|
|
38
38
|
assert s2.invalid?
|
|
39
39
|
assert_has_errors_on s2, :hostname
|
|
40
|
-
|
|
40
|
+
|
|
41
41
|
s2 = Comfy::Cms::Site.new(
|
|
42
42
|
:identifier => 'test',
|
|
43
43
|
:hostname => s1.hostname,
|
|
@@ -45,33 +45,33 @@ class CmsSiteTest < ActiveSupport::TestCase
|
|
|
45
45
|
)
|
|
46
46
|
assert s2.valid?
|
|
47
47
|
end
|
|
48
|
-
|
|
48
|
+
|
|
49
49
|
def test_identifier_assignment
|
|
50
50
|
site = Comfy::Cms::Site.new(:hostname => 'my-site.host')
|
|
51
51
|
assert site.valid?
|
|
52
52
|
assert_equal 'my-site-host', site.identifier
|
|
53
53
|
end
|
|
54
|
-
|
|
54
|
+
|
|
55
55
|
def test_hostname_assignment
|
|
56
56
|
site = Comfy::Cms::Site.new(:identifier => 'test-site')
|
|
57
57
|
assert site.valid?
|
|
58
58
|
assert_equal 'test-site', site.hostname
|
|
59
59
|
end
|
|
60
|
-
|
|
60
|
+
|
|
61
61
|
def test_label_assignment
|
|
62
62
|
site = Comfy::Cms::Site.new(:identifier => 'test', :hostname => 'my-site.host')
|
|
63
63
|
assert site.valid?
|
|
64
64
|
assert_equal 'Test', site.label
|
|
65
65
|
end
|
|
66
|
-
|
|
66
|
+
|
|
67
67
|
def test_clean_path
|
|
68
68
|
site = Comfy::Cms::Site.create!(:identifier => 'test_a', :hostname => 'test.host', :path => '/en///test//')
|
|
69
69
|
assert_equal '/en/test', site.path
|
|
70
|
-
|
|
70
|
+
|
|
71
71
|
site = Comfy::Cms::Site.create!(:identifier => 'test_b', :hostname => 'my-site.host', :path => '/')
|
|
72
72
|
assert_equal '', site.path
|
|
73
73
|
end
|
|
74
|
-
|
|
74
|
+
|
|
75
75
|
def test_creation
|
|
76
76
|
assert_difference 'Comfy::Cms::Site.count' do
|
|
77
77
|
Comfy::Cms::Site.create!(
|
|
@@ -81,7 +81,7 @@ class CmsSiteTest < ActiveSupport::TestCase
|
|
|
81
81
|
)
|
|
82
82
|
end
|
|
83
83
|
end
|
|
84
|
-
|
|
84
|
+
|
|
85
85
|
def test_cascading_destroy
|
|
86
86
|
assert_difference 'Comfy::Cms::Site.count', -1 do
|
|
87
87
|
assert_difference 'Comfy::Cms::Layout.count', -3 do
|
|
@@ -95,7 +95,7 @@ class CmsSiteTest < ActiveSupport::TestCase
|
|
|
95
95
|
end
|
|
96
96
|
end
|
|
97
97
|
end
|
|
98
|
-
|
|
98
|
+
|
|
99
99
|
def test_scope_mirrored
|
|
100
100
|
site = comfy_cms_sites(:default)
|
|
101
101
|
assert !site.is_mirrored
|
|
@@ -103,59 +103,76 @@ class CmsSiteTest < ActiveSupport::TestCase
|
|
|
103
103
|
site.update_columns(:is_mirrored => true)
|
|
104
104
|
assert_equal 1, Comfy::Cms::Site.mirrored.count
|
|
105
105
|
end
|
|
106
|
-
|
|
106
|
+
|
|
107
107
|
def test_find_site
|
|
108
108
|
site_a = comfy_cms_sites(:default)
|
|
109
109
|
assert_equal 'test.host', site_a.hostname
|
|
110
110
|
assert_nil site_a.path
|
|
111
|
-
|
|
111
|
+
|
|
112
112
|
assert_equal site_a, Comfy::Cms::Site.find_site('test.host')
|
|
113
113
|
assert_equal site_a, Comfy::Cms::Site.find_site('test.host', '/some/path')
|
|
114
114
|
assert_equal site_a, Comfy::Cms::Site.find_site('test99.host', '/some/path')
|
|
115
|
-
|
|
115
|
+
|
|
116
116
|
site_b = Comfy::Cms::Site.create!(:identifier => 'test_a', :hostname => 'test2.host', :path => 'en')
|
|
117
117
|
site_c = Comfy::Cms::Site.create!(:identifier => 'test_b', :hostname => 'test2.host', :path => 'fr')
|
|
118
|
-
|
|
118
|
+
|
|
119
119
|
assert_equal site_a, Comfy::Cms::Site.find_site('test.host')
|
|
120
120
|
assert_equal site_a, Comfy::Cms::Site.find_site('test.host', '/some/path')
|
|
121
121
|
assert_equal site_a, Comfy::Cms::Site.find_site('test.host', '/some/path')
|
|
122
122
|
assert_nil Comfy::Cms::Site.find_site('test99.host', '/some/path')
|
|
123
|
-
|
|
123
|
+
|
|
124
124
|
assert_nil Comfy::Cms::Site.find_site('test2.host')
|
|
125
125
|
assert_nil Comfy::Cms::Site.find_site('test2.host', '/some/path')
|
|
126
126
|
assert_equal site_b, Comfy::Cms::Site.find_site('test2.host', '/en')
|
|
127
127
|
assert_equal site_b, Comfy::Cms::Site.find_site('test2.host', '/en?a=b')
|
|
128
128
|
assert_equal site_b, Comfy::Cms::Site.find_site('test2.host', '/en/some/path?a=b')
|
|
129
|
-
|
|
129
|
+
|
|
130
130
|
assert_nil Comfy::Cms::Site.find_site('test2.host', '/english/some/path')
|
|
131
|
-
|
|
131
|
+
|
|
132
132
|
assert_equal site_c, Comfy::Cms::Site.find_site('test2.host', '/fr')
|
|
133
133
|
assert_equal site_c, Comfy::Cms::Site.find_site('test2.host', '/fr?a=b')
|
|
134
134
|
assert_equal site_c, Comfy::Cms::Site.find_site('test2.host', '/fr/some/path')
|
|
135
135
|
assert_equal site_c, Comfy::Cms::Site.find_site('test2.host', '/fr/some/path?a=b')
|
|
136
136
|
end
|
|
137
|
-
|
|
137
|
+
|
|
138
|
+
def find_site_with_base_path
|
|
139
|
+
base_path = '/base_path'
|
|
140
|
+
ComfortableMexicanSofa.configuration.public_cms_path = base_path
|
|
141
|
+
site_d = Comfy::Cms::Site.create!(:identifier => 'test_d', :hostname => 'test3.host', :path => 'de')
|
|
142
|
+
site_e = Comfy::Cms::Site.create!(:identifier => 'test_e', :hostname => 'test3.host', :path => 'sp')
|
|
143
|
+
|
|
144
|
+
assert_equal site_d, Comfy::Cms::Site.find_site('test3.host', "#{base_path}/de")
|
|
145
|
+
assert_equal site_d, Comfy::Cms::Site.find_site('test3.host', "#{base_path}/de/some/path")
|
|
146
|
+
assert_nil Comfy::Cms::Site.find_site('test99.host', "#{base_path}/de/some/path")
|
|
147
|
+
|
|
148
|
+
assert_nil Comfy::Cms::Site.find_site('test3.host')
|
|
149
|
+
assert_equal site_e, Comfy::Cms::Site.find_site('test3.host', "#{base_path}/sp/some/path")
|
|
150
|
+
assert_equal site_e, Comfy::Cms::Site.find_site('test3.host', "#{base_path}/sp")
|
|
151
|
+
assert_equal site_e, Comfy::Cms::Site.find_site('test3.host', "#{base_path}/sp?a=b")
|
|
152
|
+
assert_equal site_e, Comfy::Cms::Site.find_site('test3.host', "#{base_path}/sp/some/path?a=b")
|
|
153
|
+
end
|
|
154
|
+
|
|
138
155
|
def test_find_site_with_site_alias
|
|
139
156
|
site_a = comfy_cms_sites(:default)
|
|
140
157
|
site_b = Comfy::Cms::Site.create!(:identifier => 'site_b', :hostname => 'test2.host')
|
|
141
|
-
|
|
158
|
+
|
|
142
159
|
ComfortableMexicanSofa.config.hostname_aliases = {
|
|
143
160
|
'test.host' => 'alias_a.host',
|
|
144
161
|
'test2.host' => %w(alias_b.host alias_c.host)
|
|
145
162
|
}
|
|
146
|
-
|
|
163
|
+
|
|
147
164
|
assert_equal site_a, Comfy::Cms::Site.find_site('alias_a.host')
|
|
148
165
|
assert_equal site_b, Comfy::Cms::Site.find_site('alias_b.host')
|
|
149
166
|
assert_equal site_b, Comfy::Cms::Site.find_site('alias_c.host')
|
|
150
167
|
end
|
|
151
|
-
|
|
168
|
+
|
|
152
169
|
def test_url
|
|
153
170
|
assert_equal '//test.host/', comfy_cms_sites(:default).url
|
|
154
171
|
end
|
|
155
|
-
|
|
172
|
+
|
|
156
173
|
def test_url_with_public_cms_path
|
|
157
174
|
ComfortableMexicanSofa.config.public_cms_path = '/custom'
|
|
158
175
|
assert_equal '//test.host/custom/', comfy_cms_sites(:default).url
|
|
159
176
|
end
|
|
160
|
-
|
|
177
|
+
|
|
161
178
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: comfortable_mexican_sofa
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.12.
|
|
4
|
+
version: 1.12.11
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Oleg Khabarov
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2018-06-20 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|
|
@@ -226,6 +226,7 @@ files:
|
|
|
226
226
|
- LICENSE
|
|
227
227
|
- README.md
|
|
228
228
|
- Rakefile
|
|
229
|
+
- _config.yml
|
|
229
230
|
- app/assets/fonts/comfy/admin/cms/lib/redactor-font.eot
|
|
230
231
|
- app/assets/images/comfy/admin/cms/arrow_bottom.gif
|
|
231
232
|
- app/assets/images/comfy/admin/cms/arrow_right.gif
|
|
@@ -670,7 +671,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
670
671
|
version: '0'
|
|
671
672
|
requirements: []
|
|
672
673
|
rubyforge_project:
|
|
673
|
-
rubygems_version: 2.
|
|
674
|
+
rubygems_version: 2.7.6
|
|
674
675
|
signing_key:
|
|
675
676
|
specification_version: 4
|
|
676
677
|
summary: Rails 4/5 CMS Engine
|