Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Whitespace

  • Loading branch information...
commit 7fbf61037d4db347342f7a28b9a3719815ac1d49 1 parent af17687
@sodabrew sodabrew authored
View
14 lib/action_view/helpers/text_field_date_helper.rb
@@ -40,8 +40,8 @@ def text_field_date
@options[:discard_day] ||= true if @options[:discard_month] || !order.include?(:day)
# Save this so we can restore it.
- original_datetime_separator_separator = @options[:datetime_separator]
- original_date_separator = @options[:date_separator]
+ original_datetime_separator_separator = @options[:datetime_separator]
+ original_date_separator = @options[:date_separator]
@options[:datetime_separator] = ""
@options[:date_separator] = " "
@@ -71,8 +71,8 @@ def text_field_time
# Save this so we can restore it.
original_datetime_separator = @options[:datetime_separator]
- original_time_separator = @options[:time_separator]
- original_date_separator = @options[:date_separator]
+ original_time_separator = @options[:time_separator]
+ original_date_separator = @options[:date_separator]
@options[:datetime_separator] = ''
@options[:time_separator] = ':'
@@ -85,7 +85,7 @@ def text_field_time
build_text_field_from_types(order).tap do
# Restore.
- @options[:datetime_separator] = original_datetime_separator
+ @options[:datetime_separator] = original_datetime_separator
@options[:date_separator] = original_date_separator
@options[:time_separator] = original_time_separator
end
@@ -131,7 +131,7 @@ def build_text_field_from_types(order)
input = ''
order.reverse.each do |type|
separator = separator(type) unless type == order.first # don't add on last field
- input.insert(0, separator.to_s + send("text_field_#{type}").to_s)
+ input.insert(0, separator.to_s + send("text_field_#{type}").to_s)
end
text_field_tag("", input.html_safe, @html_options).html_safe
end
@@ -163,4 +163,4 @@ def to_time_text_field_tag(options = {}, html_options = {})
include TextFieldDateHelper
end
-end
+end
View
6 lib/formtastic-bootstrap/actions/base.rb
@@ -11,12 +11,12 @@ def wrapper(&block)
end
def default_button_html
- {
+ {
:accesskey => accesskey,
:class => "btn"
- }
+ }
end
end
end
-end
+end
View
10 lib/formtastic-bootstrap/form_builder.rb
@@ -1,5 +1,5 @@
module FormtasticBootstrap
-
+
class FormBuilder < Formtastic::FormBuilder
configure :default_inline_error_class, 'help-inline'
@@ -11,18 +11,18 @@ def self.default_error_class
# self.default_inline_error_class
raise
end
-
+
def self.default_error_class=(error_class)
# self.default_inline_error_class = error_class
# self.default_block_error_class = error_class
raise
end
-
+
def self.default_hint_class
# self.default_inline_hint_class
raise
end
-
+
def self.default_hint_class=(hint_class)
# self.default_inline_hint_class = hint_class
# self.default_block_hint_class = hint_class
@@ -38,4 +38,4 @@ def self.default_hint_class=(hint_class)
end
-end
+end
View
2  lib/formtastic-bootstrap/helpers.rb
@@ -9,7 +9,7 @@ module Helpers
# autoload :FormHelper, 'formtastic/helpers/form_helper'
autoload :InputHelper, 'formtastic-bootstrap/helpers/input_helper'
autoload :InputsHelper, 'formtastic-bootstrap/helpers/inputs_helper'
- # autoload :LabelHelper, 'formtastic/helpers/label_helper'
+ # autoload :LabelHelper, 'formtastic/helpers/label_helper'
# autoload :SemanticFormHelper, 'formtastic/helpers/semantic_form_helper'
# autoload :Reflection, 'formtastic/helpers/reflection'
end
View
8 lib/formtastic-bootstrap/helpers/actions_helper.rb
@@ -4,12 +4,12 @@ module ActionsHelper
include Formtastic::Helpers::ActionsHelper
include FormtasticBootstrap::Helpers::FieldsetWrapper
-
+
def actions(*args, &block)
html_options = args.extract_options!
html_options[:class] ||= "form-actions"
-
+
if block_given?
field_set_and_list_wrapping(html_options, &block)
else
@@ -18,7 +18,7 @@ def actions(*args, &block)
field_set_and_list_wrapping(html_options, contents)
end
end
-
+
end
end
-end
+end
View
4 lib/formtastic-bootstrap/helpers/fieldset_wrapper.rb
@@ -3,7 +3,7 @@ module Helpers
module FieldsetWrapper
include Formtastic::Helpers::FieldsetWrapper
-
+
protected
def field_set_and_list_wrapping(*args, &block) #:nodoc:
@@ -32,4 +32,4 @@ def field_set_and_list_wrapping(*args, &block) #:nodoc:
end
end
-end
+end
View
6 lib/formtastic-bootstrap/helpers/input_helper.rb
@@ -2,11 +2,11 @@ module FormtasticBootstrap
module Helpers
module InputHelper
include Formtastic::Helpers::InputHelper
-
+
def standard_input_class_name(as)
"FormtasticBootstrap::Inputs::#{as.to_s.camelize}Input"
end
-
+
end
end
-end
+end
View
6 lib/formtastic-bootstrap/helpers/inputs_helper.rb
@@ -5,7 +5,7 @@ module InputsHelper
def inputs(*args, &block)
wrap_it = @already_in_an_inputs_block ? true : false
@already_in_an_inputs_block = true
-
+
title = field_set_title_from_args(*args)
html_options = args.extract_options!
html_options[:class] ||= "inputs"
@@ -24,11 +24,11 @@ def inputs(*args, &block)
field_set_and_list_wrapping(*((args << html_options) << contents))
end
end
-
+
@already_in_an_inputs_block = false
out
end
end
end
-end
+end
View
38 lib/formtastic-bootstrap/inputs.rb
@@ -2,33 +2,33 @@ module FormtasticBootstrap
module Inputs
autoload :Base, "formtastic-bootstrap/inputs/base"
- # autoload :Basic
- autoload :BooleanInput, "formtastic-bootstrap/inputs/boolean_input"
+ # autoload :Basic
+ autoload :BooleanInput, "formtastic-bootstrap/inputs/boolean_input"
autoload :CheckBoxesInput, "formtastic-bootstrap/inputs/check_boxes_input"
- autoload :CountryInput, "formtastic-bootstrap/inputs/country_input"
- autoload :DateInput, "formtastic-bootstrap/inputs/date_input"
- autoload :DatePickerInput, "formtastic-bootstrap/inputs/date_picker_input"
- autoload :DatetimePickerInput, "formtastic-bootstrap/inputs/datetime_picker_input"
+ autoload :CountryInput, "formtastic-bootstrap/inputs/country_input"
+ autoload :DateInput, "formtastic-bootstrap/inputs/date_input"
+ autoload :DatePickerInput, "formtastic-bootstrap/inputs/date_picker_input"
+ autoload :DatetimePickerInput, "formtastic-bootstrap/inputs/datetime_picker_input"
autoload :DateSelectInput, "formtastic-bootstrap/inputs/date_select_input"
- autoload :DatetimeInput, "formtastic-bootstrap/inputs/datetime_input"
- autoload :DatetimeSelectInput, "formtastic-bootstrap/inputs/datetime_select_input"
- autoload :EmailInput, "formtastic-bootstrap/inputs/email_input"
- autoload :FileInput, "formtastic-bootstrap/inputs/file_input"
- autoload :HiddenInput, "formtastic-bootstrap/inputs/hidden_input"
- autoload :NumberInput, "formtastic-bootstrap/inputs/number_input"
+ autoload :DatetimeInput, "formtastic-bootstrap/inputs/datetime_input"
+ autoload :DatetimeSelectInput, "formtastic-bootstrap/inputs/datetime_select_input"
+ autoload :EmailInput, "formtastic-bootstrap/inputs/email_input"
+ autoload :FileInput, "formtastic-bootstrap/inputs/file_input"
+ autoload :HiddenInput, "formtastic-bootstrap/inputs/hidden_input"
+ autoload :NumberInput, "formtastic-bootstrap/inputs/number_input"
# autoload :NumericInput # TODO Where does Formtastic actually define this?
- autoload :PasswordInput, "formtastic-bootstrap/inputs/password_input"
- autoload :PhoneInput, "formtastic-bootstrap/inputs/phone_input"
- autoload :RadioInput, "formtastic-bootstrap/inputs/radio_input"
- autoload :RangeInput, "formtastic-bootstrap/inputs/range_input"
- autoload :SearchInput, "formtastic-bootstrap/inputs/search_input"
- autoload :SelectInput, "formtastic-bootstrap/inputs/select_input"
+ autoload :PasswordInput, "formtastic-bootstrap/inputs/password_input"
+ autoload :PhoneInput, "formtastic-bootstrap/inputs/phone_input"
+ autoload :RadioInput, "formtastic-bootstrap/inputs/radio_input"
+ autoload :RangeInput, "formtastic-bootstrap/inputs/range_input"
+ autoload :SearchInput, "formtastic-bootstrap/inputs/search_input"
+ autoload :SelectInput, "formtastic-bootstrap/inputs/select_input"
autoload :StringInput, "formtastic-bootstrap/inputs/string_input"
autoload :TextInput, "formtastic-bootstrap/inputs/text_input"
autoload :TimeInput, "formtastic-bootstrap/inputs/time_input"
# autoload :TimePickerInput # TODO Come back to this.
autoload :TimeSelectInput, "formtastic-bootstrap/inputs/time_select_input"
- autoload :TimeZoneInput, "formtastic-bootstrap/inputs/time_zone_input"
+ autoload :TimeZoneInput, "formtastic-bootstrap/inputs/time_zone_input"
# autoload :Timeish # This seems like a mistake.
autoload :UrlInput, "formtastic-bootstrap/inputs/url_input"
View
2  lib/formtastic-bootstrap/inputs/base.rb
@@ -26,7 +26,7 @@ module Base
autoload :Timeish, "formtastic-bootstrap/inputs/base/timeish"
# autoload :Validations
autoload :Wrapping, "formtastic-bootstrap/inputs/base/wrapping"
-
+
include Html
# include Options
# include Database
View
4 lib/formtastic-bootstrap/inputs/base/errors.rb
@@ -27,7 +27,7 @@ def error_list_html(ignore)
# end
# template.content_tag(:ul, Formtastic::Util.html_safe(list_elements.join("\n")), :class => error_class)
end
-
+
def error_first_html(inline_or_block = :inline)
error_class = if inline_or_block == :inline
options[:error_class] || builder.default_inline_error_class
@@ -45,4 +45,4 @@ def error_none_html(ignore)
end
end
end
-end
+end
View
6 lib/formtastic-bootstrap/inputs/base/hints.rb
@@ -2,7 +2,7 @@ module FormtasticBootstrap
module Inputs
module Base
module Hints
-
+
include Formtastic::Inputs::Base::Hints
def hint_html(inline_or_block = :block)
@@ -13,8 +13,8 @@ def hint_html(inline_or_block = :block)
options[:hint_class] || builder.default_block_hint_class
end
template.content_tag(
- :span,
- Formtastic::Util.html_safe(hint_text),
+ :span,
+ Formtastic::Util.html_safe(hint_text),
:class => hint_class
)
end
View
4 lib/formtastic-bootstrap/inputs/base/html.rb
@@ -7,7 +7,7 @@ module Html
def input_html_options
if errors?
- {
+ {
:class => "error"
}.merge(super)
else
@@ -18,4 +18,4 @@ def input_html_options
end
end
end
-end
+end
View
4 lib/formtastic-bootstrap/inputs/base/labelling.rb
@@ -12,7 +12,7 @@ def label_html_options
# options[:class] << "control-label"
end
end
-
+
def control_label_html_options
label_html_options.tap do |options|
options[:class] << "control-label"
@@ -26,4 +26,4 @@ def control_label_html
end
end
end
-end
+end
View
6 lib/formtastic-bootstrap/inputs/base/stringish.rb
@@ -2,7 +2,7 @@ module FormtasticBootstrap
module Inputs
module Base
module Stringish
-
+
include Formtastic::Inputs::Base::Stringish
def to_html
@@ -10,8 +10,8 @@ def to_html
builder.text_field(method, input_html_options)
end
end
-
+
end
end
end
-end
+end
View
10 lib/formtastic-bootstrap/inputs/base/timeish.rb
@@ -34,9 +34,9 @@ def fragment_input_html_options(fragment)
end
end
- def fragment_class(fragment)
- {
- :year => "span1",
+ def fragment_class(fragment)
+ {
+ :year => "span1",
:month => "span2",
:day => "span1",
:hour => "span1",
@@ -46,10 +46,10 @@ def fragment_class(fragment)
end
def fragment_placeholder(fragment)
- "." + fragment_class(fragment)
+ "." + fragment_class(fragment)
end
end
end
end
-end
+end
View
6 lib/formtastic-bootstrap/inputs/base/wrapping.rb
@@ -39,8 +39,8 @@ def add_on_content(content)
end
def control_group_wrapping(&block)
- template.content_tag(:div,
- template.capture(&block).html_safe,
+ template.content_tag(:div,
+ template.capture(&block).html_safe,
wrapper_html_options
)
end
@@ -51,7 +51,7 @@ def controls_wrapping(&block)
controls_wrapper_html_options
)
end
-
+
def controls_wrapper_html_options
{
:class => "controls"
View
4 lib/formtastic-bootstrap/inputs/number_input.rb
@@ -9,7 +9,7 @@ def to_html
builder.number_field(method, input_html_options)
end
end
-
+
end
end
-end
+end
View
8 lib/formtastic-bootstrap/inputs/radio_input.rb
@@ -33,14 +33,14 @@ def choice_wrapping_html_options(choice)
end
end
- def choice_html(choice)
+ def choice_html(choice)
template.content_tag(:label,
- builder.radio_button(input_name, choice_value(choice), input_html_options.merge(choice_html_options(choice)).merge(:required => false)) <<
+ builder.radio_button(input_name, choice_value(choice), input_html_options.merge(choice_html_options(choice)).merge(:required => false)) <<
choice_label(choice),
label_html_options.merge(choice_label_html_options(choice))
)
end
-
+
end
end
-end
+end
View
4 lib/formtastic-bootstrap/inputs/text_input.rb
@@ -1,7 +1,7 @@
module FormtasticBootstrap
module Inputs
class TextInput < Formtastic::Inputs::TextInput
- include Base
+ include Base
def to_html
bootstrap_wrapping do
@@ -11,4 +11,4 @@ def to_html
end
end
-end
+end

0 comments on commit 7fbf610

Please sign in to comment.
Something went wrong with that request. Please try again.