mbleigh-uberkit 0.0.3 → 0.0.4

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.
Files changed (4) hide show
  1. data/Rakefile +15 -0
  2. data/VERSION.yml +4 -0
  3. data/lib/uberkit/forms/builder.rb +19 -4
  4. metadata +14 -9
data/Rakefile ADDED
@@ -0,0 +1,15 @@
1
+ begin
2
+ require 'jeweler'
3
+ Jeweler::Tasks.new do |s|
4
+ s.name = "uberkit"
5
+ s.summary = "A Rails plugin for a common set of UI tools and helpers for building interfaces."
6
+ s.email = "michael@intridea.com"
7
+ s.homepage = "http://github.com/mbleigh/uberkit"
8
+ s.description = "UberKit is a set of tools for common UI problems in Rails including menus and forms."
9
+ s.authors = ["Michael Bleigh"]
10
+ s.files = FileList["[A-Z]*", "{lib,rails}/**/*"]
11
+ end
12
+ rescue LoadError
13
+ puts "Jeweler, or one of its dependencies, is not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
14
+ end
15
+
data/VERSION.yml ADDED
@@ -0,0 +1,4 @@
1
+ ---
2
+ :major: 0
3
+ :minor: 0
4
+ :patch: 4
@@ -4,7 +4,7 @@ class Uberkit::Forms::Builder < ActionView::Helpers::FormBuilder
4
4
  include ActionView::Helpers::UrlHelper
5
5
  include ActionView::Helpers::TagHelper
6
6
 
7
- helpers = field_helpers + %w(date_select datetime_select time_select select html_area state_select country_select) - %w(hidden_field label fields_for)
7
+ helpers = field_helpers + %w(date_select datetime_select time_select select html_area state_select country_select check_box) - %w(hidden_field label fields_for)
8
8
 
9
9
  helpers.each do |name|
10
10
  define_method(name) do |field, *args|
@@ -28,6 +28,21 @@ class Uberkit::Forms::Builder < ActionView::Helpers::FormBuilder
28
28
  ret
29
29
  end
30
30
  end
31
+
32
+ def check_box(field, options = {}, checked_value = "1", unchecked_value = "0")
33
+ label_text = options.delete(:label) || field.to_s.titleize
34
+ help = options.delete(:help)
35
+ description = options.delete(:description)
36
+
37
+ content_tag(:div, :class => "check_box_row#{' require' if options.delete(:required)}#{' labelless' if label_text.blank?}") do
38
+ ret = super(field, options, checked_value, unchecked_value)
39
+ ret << label(field, label_text)
40
+ ret << content_tag(:span, help, :class => 'help') unless help.blank?
41
+ ret << content_tag(:span, description, :class => 'description') unless description.blank?
42
+ ret << "<br/>"
43
+ ret
44
+ end
45
+ end
31
46
 
32
47
  def submit(text)
33
48
  content_tag(:button, text, :type => "submit")
@@ -44,9 +59,9 @@ class Uberkit::Forms::Builder < ActionView::Helpers::FormBuilder
44
59
  end
45
60
 
46
61
  def fieldset(legend=nil,&block)
47
- concat("<fieldset>#{"<legend>#{legend}</legend>" if legend}",block.binding)
62
+ concat("<fieldset>#{"<legend>#{legend}</legend>" if legend}")
48
63
  yield
49
- concat("</fieldset>",block.binding)
64
+ concat("</fieldset>")
50
65
  end
51
66
 
52
67
  def output_buffer
@@ -58,4 +73,4 @@ class Uberkit::Forms::Builder < ActionView::Helpers::FormBuilder
58
73
  end
59
74
 
60
75
  def is_haml?; false end
61
- end
76
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mbleigh-uberkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Bleigh
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-07-14 00:00:00 -07:00
12
+ date: 2009-03-26 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -19,23 +19,28 @@ executables: []
19
19
 
20
20
  extensions: []
21
21
 
22
- extra_rdoc_files: []
23
-
22
+ extra_rdoc_files:
23
+ - README
24
24
  files:
25
25
  - MIT-LICENSE
26
+ - Rakefile
26
27
  - README
28
+ - VERSION.yml
29
+ - lib/uberkit
27
30
  - lib/uberkit/displayer.rb
28
- - lib/uberkit/menu.rb
29
31
  - lib/uberkit/form.rb
32
+ - lib/uberkit/forms
30
33
  - lib/uberkit/forms/builder.rb
31
34
  - lib/uberkit/forms/helper.rb
35
+ - lib/uberkit/menu.rb
32
36
  - lib/uberkit.rb
33
37
  - rails/init.rb
34
- has_rdoc: false
35
- homepage: http://www.actsascommunity.com/projects/uberkit
38
+ has_rdoc: true
39
+ homepage: http://github.com/mbleigh/uberkit
36
40
  post_install_message:
37
- rdoc_options: []
38
-
41
+ rdoc_options:
42
+ - --inline-source
43
+ - --charset=UTF-8
39
44
  require_paths:
40
45
  - lib
41
46
  required_ruby_version: !ruby/object:Gem::Requirement