humpyard_form 0.0.2 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +12 -12
- data/README.rdoc +1 -1
- data/VERSION +1 -1
- data/app/views/humpyard_form/_boolean_input.html.haml +1 -0
- data/app/views/humpyard_form/_image_file_input.html.haml +1 -1
- data/config/locales/en.yml +3 -3
- data/lib/humpyard_form.rb +2 -0
- data/lib/humpyard_form/form_builder.rb +7 -3
- metadata +10 -28
data/Gemfile
CHANGED
@@ -1,19 +1,19 @@
|
|
1
|
-
source 'http://
|
1
|
+
source 'http://rubygems.org'
|
2
2
|
|
3
|
-
gem "rails", '>=
|
4
|
-
gem 'haml', '>=
|
5
|
-
gem 'compass', '>=
|
3
|
+
gem "rails", '>=3.0.0'
|
4
|
+
gem 'haml', '>=3.0.0'
|
5
|
+
gem 'compass', '>=0.10.0'
|
6
|
+
gem 'globalize3', '>=0.0.7'
|
6
7
|
|
7
8
|
group :test do
|
8
9
|
gem 'test-unit'
|
9
|
-
gem 'rspec-rails', '>=
|
10
|
-
gem 'capybara', '>=
|
11
|
-
gem 'database_cleaner', '>=
|
12
|
-
gem 'cucumber
|
13
|
-
gem 'cucumber',
|
14
|
-
gem 'pickle', '>= 0.2
|
15
|
-
gem '
|
16
|
-
gem 'factory_girl', '>= 1.2.3'
|
10
|
+
gem 'rspec-rails', '>=2.0.0.beta.22'
|
11
|
+
gem 'capybara', '>=0.3.7'
|
12
|
+
gem 'database_cleaner', '>=0.5.2'
|
13
|
+
gem 'cucumber', '>=0.8.5'
|
14
|
+
gem 'cucumber-rails', '>=0.3.2'
|
15
|
+
gem 'pickle', '>= 0.4.2'
|
16
|
+
gem 'factory_girl', '>= 1.3.2'
|
17
17
|
gem 'markup_validity', '>= 1.1.0'
|
18
18
|
gem 'sqlite3-ruby', :require => 'sqlite3'
|
19
19
|
gem 'thin'
|
data/README.rdoc
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.4
|
@@ -1 +1,2 @@
|
|
1
|
+
%input{:type => "hidden", :name => "#{form.namespace}[#{name}]", :value => 0}
|
1
2
|
%input{:type => "checkbox", :name => "#{form.namespace}[#{name}]", :value => "#{options[:value] || 1}", :class => "boolean ui-widget-content ui-corner-all field-highlight", :checked => form.object.send(name) ? 'checked' : false, :required => options[:required] ? true : false}
|
@@ -3,7 +3,7 @@
|
|
3
3
|
- style = form.object.send(name).styles[:thumb]
|
4
4
|
= image_tag form.object.send(name).url(:thumb), :size => style.geometry.match(/(\d+x\d+)/)[1]
|
5
5
|
- else
|
6
|
-
= image_tag form.object.send(name).
|
6
|
+
= image_tag form.object.send(name).url
|
7
7
|
[
|
8
8
|
= form.object.send("#{name}_file_name")
|
9
9
|
= form.object.send("#{name}_file_size")
|
data/config/locales/en.yml
CHANGED
data/lib/humpyard_form.rb
CHANGED
@@ -42,9 +42,11 @@ end
|
|
42
42
|
require File.expand_path('../humpyard_form/config', __FILE__)
|
43
43
|
require File.expand_path('../humpyard_form/engine', __FILE__)
|
44
44
|
require File.expand_path('../humpyard_form/compass', __FILE__)
|
45
|
+
require File.expand_path('../humpyard_form/form_builder', __FILE__)
|
45
46
|
|
46
47
|
require 'i18n'
|
47
48
|
I18n.load_path += Dir.glob("#{File.dirname(__FILE__)}/../config/locales/*.yml")
|
49
|
+
I18n.backend.reload!
|
48
50
|
puts "=> #{I18n.t 'humpyard_form.start', :version => HumpyardForm::VERSION}"
|
49
51
|
|
50
52
|
require File.expand_path('../humpyard_form/action_controller/base', __FILE__)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module HumpyardForm
|
2
2
|
####
|
3
3
|
# HumpyardForm::FormHelper is a helper for forms
|
4
|
-
class FormBuilder
|
4
|
+
class FormBuilder < ::ActionView::Helpers::FormBuilder
|
5
5
|
attr_reader :object, :options, :html_options, :url, :form_type
|
6
6
|
|
7
7
|
@@file_methods = [ :file?, :public_filename ]
|
@@ -25,7 +25,7 @@ module HumpyardForm
|
|
25
25
|
@html_options[:method] = :post
|
26
26
|
end
|
27
27
|
end
|
28
|
-
|
28
|
+
|
29
29
|
def namespace
|
30
30
|
if @options[:as]
|
31
31
|
@options[:as]
|
@@ -53,7 +53,7 @@ module HumpyardForm
|
|
53
53
|
|
54
54
|
def translation_info(method) #:nodoc:
|
55
55
|
if @object.respond_to?(:translated_attribute_names) and @object.translated_attribute_names.include?(method)
|
56
|
-
tmp = @object.translation_class.new
|
56
|
+
tmp = @object.class.translation_class.new
|
57
57
|
if tmp
|
58
58
|
column = tmp.column_for_attribute(method) if tmp.respond_to?(:column_for_attribute)
|
59
59
|
if column
|
@@ -222,6 +222,10 @@ module HumpyardForm
|
|
222
222
|
raise "Cannot infer group association for #{method} grouped by #{group_by}, there were #{possible_associations.empty? ? 'no' : possible_associations.size} possible associations. Please specify using :group_association"
|
223
223
|
end
|
224
224
|
|
225
|
+
|
226
|
+
|
227
|
+
|
228
|
+
|
225
229
|
# Returns a hash to be used by radio and select inputs when a boolean field
|
226
230
|
# is provided.
|
227
231
|
#
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 4
|
9
|
+
version: 0.0.4
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Sven G. Broenstrup
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-
|
18
|
+
date: 2010-09-18 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -41,8 +41,7 @@ dependencies:
|
|
41
41
|
- 3
|
42
42
|
- 0
|
43
43
|
- 0
|
44
|
-
|
45
|
-
version: 3.0.0.beta3
|
44
|
+
version: 3.0.0
|
46
45
|
requirement: *id002
|
47
46
|
prerelease: false
|
48
47
|
- !ruby/object:Gem::Dependency
|
@@ -56,9 +55,7 @@ dependencies:
|
|
56
55
|
- 3
|
57
56
|
- 0
|
58
57
|
- 0
|
59
|
-
|
60
|
-
- 4
|
61
|
-
version: 3.0.0.rc.4
|
58
|
+
version: 3.0.0
|
62
59
|
requirement: *id003
|
63
60
|
prerelease: false
|
64
61
|
- !ruby/object:Gem::Dependency
|
@@ -72,37 +69,22 @@ dependencies:
|
|
72
69
|
- 0
|
73
70
|
- 10
|
74
71
|
- 0
|
75
|
-
|
76
|
-
version: 0.10.0.rc5
|
72
|
+
version: 0.10.0
|
77
73
|
requirement: *id004
|
78
74
|
prerelease: false
|
79
75
|
- !ruby/object:Gem::Dependency
|
80
76
|
type: :runtime
|
81
|
-
name:
|
77
|
+
name: globalize3
|
82
78
|
version_requirements: &id005 !ruby/object:Gem::Requirement
|
83
|
-
requirements:
|
84
|
-
- - ">="
|
85
|
-
- !ruby/object:Gem::Version
|
86
|
-
segments:
|
87
|
-
- 1
|
88
|
-
- 1
|
89
|
-
- 1
|
90
|
-
version: 1.1.1
|
91
|
-
requirement: *id005
|
92
|
-
prerelease: false
|
93
|
-
- !ruby/object:Gem::Dependency
|
94
|
-
type: :runtime
|
95
|
-
name: globalize2
|
96
|
-
version_requirements: &id006 !ruby/object:Gem::Requirement
|
97
79
|
requirements:
|
98
80
|
- - ">="
|
99
81
|
- !ruby/object:Gem::Version
|
100
82
|
segments:
|
101
83
|
- 0
|
102
|
-
- 2
|
103
84
|
- 0
|
104
|
-
|
105
|
-
|
85
|
+
- 7
|
86
|
+
version: 0.0.7
|
87
|
+
requirement: *id005
|
106
88
|
prerelease: false
|
107
89
|
description: HumpyardForm is an form builder for Rails 3 applications. It is developed as part of the humpyard cms
|
108
90
|
email: info@humpyard.org
|