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 CHANGED
@@ -1 +1 @@
1
- 1.4.11
1
+ 1.4.12
@@ -91,7 +91,7 @@ $.CMS = function(){
91
91
  },
92
92
 
93
93
  enable_date_picker: function(){
94
- $('input[type=datetime], input[type=text].datetime').datepicker();
94
+ $('input[type=text].date').datepicker({ dateFormat: 'yy-mm-dd' });
95
95
  },
96
96
 
97
97
  tree_methods: function(){
@@ -67,13 +67,13 @@
67
67
  #cms_body #form_blocks .no_tags code {
68
68
  color: #B85042;
69
69
  }
70
- #cms_body .form_element.field_datetime .label,
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.page_datetime .label,
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.11"
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::PageRichText
64
- 'rich_text'
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(options[:content_field_method], 'page[blocks_attributes][][content]', tag.content, :id => nil, :class => field_css_class)
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, :content_field_method => :datetime_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, :content_field_method => :datetime_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='datetime'][name='page[blocks_attributes][][content]']"
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='datetime'][name='page[blocks_attributes][][content]']"
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.11
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: &70254947803580 !ruby/object:Gem::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: *70254947803580
26
+ version_requirements: *70106784163860
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: active_link_to
29
- requirement: &70254947803000 !ruby/object:Gem::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: *70254947803000
37
+ version_requirements: *70106784163220
38
38
  - !ruby/object:Gem::Dependency
39
39
  name: paperclip
40
- requirement: &70254947802440 !ruby/object:Gem::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: *70254947802440
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: -3773802276572835291
350
+ hash: -4032257811876113166
351
351
  required_rubygems_version: !ruby/object:Gem::Requirement
352
352
  none: false
353
353
  requirements: