class Maglove::Widget::LegacyCard

Public Instance Methods

defaults() click to toggle source
# File lib/maglove/widget/card.rb, line 14
def defaults
  {
    background_color: "#fff",
    margin_bottom: "10px",
    border_radius: "2px",
    title: "Card Title",
    subtitle: "This is the card subtitle",
    title_heading_type: "h2",
    subtitle_heading_type: "h4",
    style: ""
  }
end
identifier() click to toggle source
# File lib/maglove/widget/card.rb, line 10
def identifier
  "card"
end
render() { |self| ... } click to toggle source
Calls superclass method Maglove::Widget::V1#render
# File lib/maglove/widget/card.rb, line 27
def render(&block)
  super do
    haml_tag :div, class: "card #{options[:style]}", style: style_string(options, :margin_bottom, :background_color, :border_radius) do
      haml_tag :a, href: (options[:href] or "#") do
        haml_tag options[:title_heading_type], class: "card-title" do
          haml_concat(options[:title])
        end
        if options[:subtitle] != ""
          haml_tag options[:subtitle_heading_type], class: "card-subtitle" do
            haml_concat(options[:subtitle])
          end
        end
        haml_tag :hr, class: "solid dark-maroon"
        yield self if block_given?
      end
    end
  end
end