Class: Matestack::Ui::Bootstrap::Components::SectionCard

Inherits:
BaseComponent
  • Object
show all
Defined in:
lib/matestack/ui/bootstrap/components/section_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



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/matestack/ui/bootstrap/components/section_card.rb', line 7

def response
  section id: context.id, class: "section-card rounded shadow-sm mb-4 bg-white #{options[:class]}" do
    div class: "d-flex flex-row justify-content-between" do
      if context.title.present? || context.subtitle.present?
        div class: "section-card-heading p-4" do
          heading size: 5, class: "mb-0" do
            bs_icon name: context.icon, size: "35" if context.icon.present?
            plain context.title
          end
          small class: "text-muted" do
            plain context.subtitle
          end
        end
      end
      if slots.present? && slots[:actions].present?
        div class: "section-card-actions p-4" do
          slot :actions
        end
      end
    end
    div class: "section-card-content #{'p-4' unless context.content_padding == false} #{'pt-1' if context.title || context.subtitle}" do
      yield if block_given?
    end
  end
end