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

Inherits:
Component
  • Object
show all
Defined in:
app/concepts/matestack/ui/bootstrap/components/section_card.rb

Instance Method Summary collapse

Instance Method Details

#responseObject



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

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