Sha256: 816a68dc2edd84ca75eed1c680b93a3b2813d33473c438f9ebb68d58ee0dd54c

Contents?: true

Size: 1.56 KB

Versions: 10

Compression:

Stored size: 1.56 KB

Contents

# -*- encoding : utf-8 -*-
class Card; module Set; class All; module Bootstrap;
# Set: All cards (Bootstrap, Form)
#
module Form;
extend Card::Set
def self.source_location; "/Users/ethan/dev/decko/gem/card/mod/bootstrap/set/all/bootstrap/form.rb"; end
module HtmlFormat; parent.send :register_set_format, Card::Format::HtmlFormat, self; extend Card::Set::AbstractFormat
  def button_tag content_or_options=nil, options={}, &block
    bootstrapify_button(block_given? ? content_or_options : options)
    super(content_or_options, options, &block)
  end

  def bootstrapify_button options
    situation = options.delete(:situation) || "primary"
    options[:class] = [options[:class], "btn", "btn-#{situation}"].compact * " "
  end

  def type_field args={}
    args[:class] ||= ""
    args[:class] += " form-control"
    super(args)
  end

  def bootstrap_options options
    options[:class] ||= ""
    options[:class] += " form-control"
    options
  end

  FIELD_HELPERS = %w[hidden_field color_field date_field datetime_field
                     datetime_local_field email_field month_field number_field
                     password_field phone_field range_field search_field
                     telephone_field text_area text_field time_field
                     url_field week_field file_field].freeze

  FIELD_HELPERS.each do |method_name|
    define_method(method_name) do |name, options={}|
      form.send(method_name, name, bootstrap_options(options))
    end
  end
end
end;end;end;end;end;
# ~~ generated from /Users/ethan/dev/decko/gem/card/mod/bootstrap/set/all/bootstrap/form.rb ~~

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
card-1.100.0 tmpsets/set/mod028-bootstrap/all/bootstrap/form.rb
card-1.99.4 tmpsets/set/mod026-bootstrap/all/bootstrap/form.rb
card-1.99.3 tmpsets/set/mod026-bootstrap/all/bootstrap/form.rb
card-1.99.2 tmpsets/set/mod026-bootstrap/all/bootstrap/form.rb
card-1.99.1 tmpsets/set/mod026-bootstrap/all/bootstrap/form.rb
card-1.99.0 tmpsets/set/mod026-bootstrap/all/bootstrap/form.rb
card-1.98.3 tmpsets/set/mod026-bootstrap/all/bootstrap/form.rb
card-1.98.2 tmpsets/set/mod026-bootstrap/all/bootstrap/form.rb
card-1.98.1 tmpsets/set/mod026-bootstrap/all/bootstrap/form.rb
card-1.98.0 tmpsets/set/mod026-bootstrap/all/bootstrap/form.rb