App shell

The frame of every screen.

Helper
app_shell do |shell|
  shell.with_banner(text, kind: :test)  # or :sandbox
  shell.with_sidebar(brand:, brand_href: "/") do |sidebar|
    sidebar.with_brand_logo { … }
    sidebar.with_item(label, href:, icon: nil, current: nil)
    sidebar.with_heading(text)
    sidebar.with_footer { … }
  end
  # page content
end

Use it once, in the application layout, around yield. The banner names any environment that is not the real one (:test yellow, :sandbox violet); real data shows none. Sidebar items mark themselves current with current_page? unless you pass current:; with_heading groups the items after it.

Give html and body height: 100%. Below 760px wide, collapse or move the sidebar in your layout.

DEVELOPMENT DATA — kept separate from live data

Conteúdo da página

Slots

SlotWhat goes in it
bannerEnvBanner: text and kind (:test, :sandbox)
sidebarbrand, brand_href; with_item, with_heading, with_brand_logo, with_footer