Class: Maglove::Widget::LegacyCard
- Defined in:
- lib/maglove/widget/card.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from V1
#drop_container, #widget_options
Methods inherited from Base
#initialize, #style_string, #widget_options
Constructor Details
This class inherits a constructor from Maglove::Widget::Base
Instance Method Details
#defaults ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 |
# 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 ⇒ Object
10 11 12 |
# File 'lib/maglove/widget/card.rb', line 10 def identifier "card" end |
#render(&block) ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/maglove/widget/card.rb', line 27 def render(&block) super do haml_tag :div, class: "card #{[:style]}", style: style_string(, :margin_bottom, :background_color, :border_radius) do haml_tag :a, href: ([:href] or "#") do haml_tag [:title_heading_type], class: "card-title" do haml_concat([:title]) end if [:subtitle] != "" haml_tag [:subtitle_heading_type], class: "card-subtitle" do haml_concat([:subtitle]) end end haml_tag :hr, class: "solid dark-maroon" yield self if block_given? end end end end |