bc-htmlful 0.0.5 → 0.0.6

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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.5
1
+ 0.0.6
data/bc-htmlful.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{bc-htmlful}
8
- s.version = "0.0.5"
8
+ s.version = "0.0.6"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Duarte Henriques", "Vasco Andrade e Silva"]
12
- s.date = %q{2010-02-26}
12
+ s.date = %q{2010-04-29}
13
13
  s.description = %q{Form dynamic fields}
14
14
  s.email = %q{info@byclosure.com}
15
15
  s.extra_rdoc_files = [
@@ -32,7 +32,7 @@ Gem::Specification.new do |s|
32
32
  s.homepage = %q{http://github.com/Byclosure/}
33
33
  s.rdoc_options = ["--charset=UTF-8"]
34
34
  s.require_paths = ["lib"]
35
- s.rubygems_version = %q{1.3.5}
35
+ s.rubygems_version = %q{1.3.6}
36
36
  s.summary = %q{Form dynamic fields}
37
37
 
38
38
  if s.respond_to? :specification_version then
@@ -32,6 +32,8 @@ module Htmlful
32
32
  attributes.each do |attribute|
33
33
  if is_date(sub_object, attribute)
34
34
  concat sub_form.input(attribute, :as => :string, :wrapper_html => {:class => 'datepick'})
35
+ elsif is_datetime(sub_object, attribute)
36
+ concat sub_form.input(attribute, :include_blank => false)
35
37
  elsif is_document(sub_object, attribute)
36
38
  if is_document_empty?(sub_object, attribute)
37
39
  concat content_tag(:li, content_tag(:p, t(:no_document)))
@@ -52,6 +54,8 @@ module Htmlful
52
54
  attributes.each do |attribute|
53
55
  if is_date(sub_object, attribute)
54
56
  concat sub_form.input(attribute, :as => :string, :wrapper_html => {:class => 'datepick ignore'})
57
+ elsif is_datetime(sub_object, attribute)
58
+ concat sub_form.input(attribute, :include_blank => false)
55
59
  else
56
60
  concat sub_form.input(attribute) # takes care of everything else
57
61
  end
@@ -188,6 +192,11 @@ module Htmlful
188
192
  col = resource.column_for_attribute(attribute)
189
193
  col && col.type == :date
190
194
  end
195
+
196
+ def is_datetime(resource, attribute)
197
+ col = resource.column_for_attribute(attribute)
198
+ col && col.type == :datetime
199
+ end
191
200
 
192
201
  # taken from formtastic
193
202
  @@file_methods = [:file?, :public_filename]
metadata CHANGED
@@ -1,7 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bc-htmlful
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 0
8
+ - 6
9
+ version: 0.0.6
5
10
  platform: ruby
6
11
  authors:
7
12
  - Duarte Henriques
@@ -10,7 +15,7 @@ autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
17
 
13
- date: 2010-02-26 00:00:00 +00:00
18
+ date: 2010-04-29 00:00:00 +01:00
14
19
  default_executable:
15
20
  dependencies: []
16
21
 
@@ -48,18 +53,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
48
53
  requirements:
49
54
  - - ">="
50
55
  - !ruby/object:Gem::Version
56
+ segments:
57
+ - 0
51
58
  version: "0"
52
- version:
53
59
  required_rubygems_version: !ruby/object:Gem::Requirement
54
60
  requirements:
55
61
  - - ">="
56
62
  - !ruby/object:Gem::Version
63
+ segments:
64
+ - 0
57
65
  version: "0"
58
- version:
59
66
  requirements: []
60
67
 
61
68
  rubyforge_project:
62
- rubygems_version: 1.3.5
69
+ rubygems_version: 1.3.6
63
70
  signing_key:
64
71
  specification_version: 3
65
72
  summary: Form dynamic fields