comfortable_mexican_sofa 1.4.11 → 1.4.12
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/app/assets/javascripts/comfortable_mexican_sofa/application.js +1 -1
- data/app/assets/stylesheets/comfortable_mexican_sofa/form.css +2 -2
- data/comfortable_mexican_sofa.gemspec +1 -1
- data/lib/comfortable_mexican_sofa/form_builder.rb +13 -5
- data/lib/comfortable_mexican_sofa/view_methods.rb +0 -5
- data/test/functional/cms_admin/pages_controller_test.rb +5 -5
- metadata +8 -8
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.4.
|
1
|
+
1.4.12
|
@@ -67,13 +67,13 @@
|
|
67
67
|
#cms_body #form_blocks .no_tags code {
|
68
68
|
color: #B85042;
|
69
69
|
}
|
70
|
-
#cms_body .form_element.
|
70
|
+
#cms_body .form_element.field_date_time .label,
|
71
71
|
#cms_body .form_element.field_integer .label,
|
72
72
|
#cms_body .form_element.field_string .label,
|
73
73
|
#cms_body .form_element.field_text .label {
|
74
74
|
border-color: #48699C;
|
75
75
|
}
|
76
|
-
#cms_body .form_element.
|
76
|
+
#cms_body .form_element.page_date_time .label,
|
77
77
|
#cms_body .form_element.page_integer .label,
|
78
78
|
#cms_body .form_element.page_string .label,
|
79
79
|
#cms_body .form_element.page_text .label,
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{comfortable_mexican_sofa}
|
8
|
-
s.version = "1.4.
|
8
|
+
s.version = "1.4.12"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Oleg Khabarov", "The Working Group Inc"]
|
@@ -60,16 +60,24 @@ class ComfortableMexicanSofa::FormBuilder < ActionView::Helpers::FormBuilder
|
|
60
60
|
css_class = options[:css_class] || tag.class.to_s.demodulize.underscore
|
61
61
|
|
62
62
|
field_css_class = case tag
|
63
|
-
when ComfortableMexicanSofa::Tag::
|
64
|
-
'
|
63
|
+
when ComfortableMexicanSofa::Tag::PageDateTime, ComfortableMexicanSofa::Tag::FieldDateTime
|
64
|
+
'date'
|
65
65
|
when ComfortableMexicanSofa::Tag::PageText, ComfortableMexicanSofa::Tag::FieldText
|
66
66
|
'code'
|
67
|
+
when ComfortableMexicanSofa::Tag::PageRichText
|
68
|
+
'rich_text'
|
67
69
|
end
|
68
70
|
|
69
71
|
options[:content_field_method] ||= :text_field_tag
|
70
72
|
field =
|
71
73
|
options[:field] ||
|
72
|
-
@template.send(
|
74
|
+
@template.send(
|
75
|
+
options[:content_field_method],
|
76
|
+
'page[blocks_attributes][][content]',
|
77
|
+
tag.content,
|
78
|
+
:id => nil,
|
79
|
+
:class => field_css_class
|
80
|
+
)
|
73
81
|
|
74
82
|
%(
|
75
83
|
<div class='form_element #{css_class}'>
|
@@ -83,7 +91,7 @@ class ComfortableMexicanSofa::FormBuilder < ActionView::Helpers::FormBuilder
|
|
83
91
|
end
|
84
92
|
|
85
93
|
def field_date_time(tag)
|
86
|
-
default_tag_field(tag
|
94
|
+
default_tag_field(tag)
|
87
95
|
end
|
88
96
|
|
89
97
|
def field_integer(tag)
|
@@ -99,7 +107,7 @@ class ComfortableMexicanSofa::FormBuilder < ActionView::Helpers::FormBuilder
|
|
99
107
|
end
|
100
108
|
|
101
109
|
def page_date_time(tag)
|
102
|
-
default_tag_field(tag
|
110
|
+
default_tag_field(tag)
|
103
111
|
end
|
104
112
|
|
105
113
|
def page_integer(tag)
|
@@ -10,11 +10,6 @@ module ComfortableMexicanSofa::ViewMethods
|
|
10
10
|
content_tag(:span, *args)
|
11
11
|
end
|
12
12
|
|
13
|
-
# Rails 3.0 doesn't have this helper defined
|
14
|
-
def datetime_field_tag(name, value = nil, options = {})
|
15
|
-
text_field_tag(name, value, options.stringify_keys.update('type' => 'datetime'))
|
16
|
-
end
|
17
|
-
|
18
13
|
# Injects some content somewhere inside cms admin area
|
19
14
|
def cms_hook(name, options = {})
|
20
15
|
ComfortableMexicanSofa::ViewHooks.render(name, self, options)
|
@@ -48,7 +48,7 @@ class CmsAdmin::PagesControllerTest < ActionController::TestCase
|
|
48
48
|
def test_get_new_with_field_datetime
|
49
49
|
cms_layouts(:default).update_attribute(:content, '{{cms:field:test_label:datetime}}')
|
50
50
|
get :new, :site_id => cms_sites(:default)
|
51
|
-
assert_select "input[type='
|
51
|
+
assert_select "input[type='text'][name='page[blocks_attributes][][content]'][class='date']"
|
52
52
|
assert_select "input[type='hidden'][name='page[blocks_attributes][][label]'][value='test_label']"
|
53
53
|
end
|
54
54
|
|
@@ -69,14 +69,14 @@ class CmsAdmin::PagesControllerTest < ActionController::TestCase
|
|
69
69
|
def test_get_new_with_field_text
|
70
70
|
cms_layouts(:default).update_attribute(:content, '{{cms:field:test_label:text}}')
|
71
71
|
get :new, :site_id => cms_sites(:default)
|
72
|
-
assert_select "textarea[name='page[blocks_attributes][][content]']"
|
72
|
+
assert_select "textarea[name='page[blocks_attributes][][content]'][class='code']"
|
73
73
|
assert_select "input[type='hidden'][name='page[blocks_attributes][][label]'][value='test_label']"
|
74
74
|
end
|
75
75
|
|
76
76
|
def test_get_new_with_page_datetime
|
77
77
|
cms_layouts(:default).update_attribute(:content, '{{cms:page:test_label:datetime}}')
|
78
78
|
get :new, :site_id => cms_sites(:default)
|
79
|
-
assert_select "input[type='
|
79
|
+
assert_select "input[type='text'][name='page[blocks_attributes][][content]'][class='date']"
|
80
80
|
assert_select "input[type='hidden'][name='page[blocks_attributes][][label]'][value='test_label']"
|
81
81
|
end
|
82
82
|
|
@@ -97,14 +97,14 @@ class CmsAdmin::PagesControllerTest < ActionController::TestCase
|
|
97
97
|
def test_get_new_with_page_text
|
98
98
|
cms_layouts(:default).update_attribute(:content, '{{cms:page:test_label}}')
|
99
99
|
get :new, :site_id => cms_sites(:default)
|
100
|
-
assert_select "textarea[name='page[blocks_attributes][][content]']"
|
100
|
+
assert_select "textarea[name='page[blocks_attributes][][content]'][class='code']"
|
101
101
|
assert_select "input[type='hidden'][name='page[blocks_attributes][][label]'][value='test_label']"
|
102
102
|
end
|
103
103
|
|
104
104
|
def test_get_new_with_rich_page_text
|
105
105
|
cms_layouts(:default).update_attribute(:content, '{{cms:page:test_label:rich_text}}')
|
106
106
|
get :new, :site_id => cms_sites(:default)
|
107
|
-
assert_select "textarea[name='page[blocks_attributes][][content]']"
|
107
|
+
assert_select "textarea[name='page[blocks_attributes][][content]'][class='rich_text']"
|
108
108
|
assert_select "input[type='hidden'][name='page[blocks_attributes][][label]'][value='test_label']"
|
109
109
|
end
|
110
110
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: comfortable_mexican_sofa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.12
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -15,7 +15,7 @@ default_executable:
|
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rails
|
18
|
-
requirement: &
|
18
|
+
requirement: &70106784163860 !ruby/object:Gem::Requirement
|
19
19
|
none: false
|
20
20
|
requirements:
|
21
21
|
- - ! '>='
|
@@ -23,10 +23,10 @@ dependencies:
|
|
23
23
|
version: 3.0.0
|
24
24
|
type: :runtime
|
25
25
|
prerelease: false
|
26
|
-
version_requirements: *
|
26
|
+
version_requirements: *70106784163860
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: active_link_to
|
29
|
-
requirement: &
|
29
|
+
requirement: &70106784163220 !ruby/object:Gem::Requirement
|
30
30
|
none: false
|
31
31
|
requirements:
|
32
32
|
- - ! '>='
|
@@ -34,10 +34,10 @@ dependencies:
|
|
34
34
|
version: 1.0.0
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
|
-
version_requirements: *
|
37
|
+
version_requirements: *70106784163220
|
38
38
|
- !ruby/object:Gem::Dependency
|
39
39
|
name: paperclip
|
40
|
-
requirement: &
|
40
|
+
requirement: &70106784162660 !ruby/object:Gem::Requirement
|
41
41
|
none: false
|
42
42
|
requirements:
|
43
43
|
- - ! '>='
|
@@ -45,7 +45,7 @@ dependencies:
|
|
45
45
|
version: 2.3.14
|
46
46
|
type: :runtime
|
47
47
|
prerelease: false
|
48
|
-
version_requirements: *
|
48
|
+
version_requirements: *70106784162660
|
49
49
|
description: ''
|
50
50
|
email: oleg@theworkinggroup.ca
|
51
51
|
executables: []
|
@@ -347,7 +347,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
347
347
|
version: '0'
|
348
348
|
segments:
|
349
349
|
- 0
|
350
|
-
hash: -
|
350
|
+
hash: -4032257811876113166
|
351
351
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
352
352
|
none: false
|
353
353
|
requirements:
|