Sha256: f6fe054cce083678d497741663daadf448a0ccf19a4a55b95feca131bbb37bed

Contents?: true

Size: 964 Bytes

Versions: 9

Compression:

Stored size: 964 Bytes

Contents

module Trestle
  module CardHelper
    def card(options={}, &block)
      content_tag(:div, options.slice(:id, :data).merge(class: ["card", options[:class]].compact)) do
        safe_join([
          (content_tag(:div, options[:header], class: "card-header") if options[:header]),
          content_tag(:div, class: "card-body", &block),
          (content_tag(:div, options[:footer], class: "card-footer") if options[:footer])
        ].compact)
      end
    end

    def panel(options={}, &block)
      ActiveSupport::Deprecation.warn("The panel helper is deprecated and will be removed in future versions of Trestle. Please use the card helper instead.")
      card(options.merge(header: options[:title]), &block)
    end

    def well(options={}, &block)
      ActiveSupport::Deprecation.warn("The well helper is deprecated and will be removed in future versions of Trestle. Please use the card helper instead.")
      card(options, &block)
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
trestle-0.9.8 app/helpers/trestle/card_helper.rb
trestle-0.9.7 app/helpers/trestle/card_helper.rb
trestle-0.9.6 app/helpers/trestle/card_helper.rb
trestle-0.9.5 app/helpers/trestle/card_helper.rb
trestle-0.9.4 app/helpers/trestle/card_helper.rb
trestle-0.9.3 app/helpers/trestle/card_helper.rb
trestle-0.9.2 app/helpers/trestle/card_helper.rb
trestle-0.9.1 app/helpers/trestle/card_helper.rb
trestle-0.9.0 app/helpers/trestle/card_helper.rb