Class: Matestack::Ui::Bootstrap::Components::Card

Inherits:
BaseComponent
  • Object
show all
Defined in:
lib/matestack/ui/bootstrap/components/card.rb

Instance Method Summary collapse

Methods included from Registry

#bs_accordion, #bs_alert, #bs_avatar, #bs_badge, #bs_breadcrumb, #bs_btn, #bs_btn_group, #bs_card, #bs_carousel, #bs_close, #bs_col, #bs_collapse, #bs_container, #bs_dropdown, #bs_figure, #bs_form_checkbox, #bs_form_input, #bs_form_radio, #bs_form_select, #bs_form_submit, #bs_form_switch, #bs_icon, #bs_list_group, #bs_modal, #bs_navbar, #bs_page_heading, #bs_pagination, #bs_popover, #bs_progress, #bs_row, #bs_scrollspy, #bs_section_card, #bs_sidebar, #bs_smart_collection, #bs_spinner, #bs_tab_nav, #bs_tab_nav_content, #bs_toast, #bs_tooltip

Instance Method Details

#responseObject



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/matestack/ui/bootstrap/components/card.rb', line 19

def response
  div card_attributes do
    if context.header || slots && slots[:header]
      header_partial
    end

    img_partial :top unless context.img_pos == :bottom
    div class: context.content_wrapper_class do
      body_partial if context.title || context.body || slots && slots[:body]

      # custom body components
      # needed a div otherwise it will be displayed below footer
      div class: "p-3 pt-1" do yield if block_given? end

      img_partial :bottom if context.img_pos == :bottom

      footer_partial if context.footer || slots && slots[:footer]
    end
  end
end