Module: Protege::Components::LayoutHelper

Included in:
ComponentsHelper
Defined in:
app/helpers/protege/components/layout_helper.rb

Overview

Page-scaffolding UI elements shared across engine views — the app shell (body, header, content region, main column), page headers and containers, navigation, and the theme toggle. A flat helper module among peers, all aggregated by Protege::ApplicationHelper and mixed into the view together.

Colors use CSS custom properties (--surface, --border, --text, --text-muted, --text-faint) defined in tailwind/application.css so dark mode works via a single .dark class toggle.

Instance Method Summary collapse

Instance Method Details

#app_body { ... } ⇒ ActiveSupport::SafeBuffer

Render the app <body> — a full-height flex column holding the fixed header and the content region (so the layout template carries no structural classes of its own). The block is the main content.

Yields:

  • the main content

Returns:

  • (ActiveSupport::SafeBuffer)

    the body markup



21
22
23
# File 'app/helpers/protege/components/layout_helper.rb', line 21

def app_body(&main)
  tag.body(class: 'h-full flex flex-col antialiased') { app_header + app_content(&main) }
end

#app_content { ... } ⇒ ActiveSupport::SafeBuffer

Render the app content region below the header — the full-height flex row holding the optional sidebar and the main column. The sidebar is drawn from the :sidebar content buffer (a view's content_for :sidebar), so pages opt in just by defining it; the block is the main content.

Yields:

  • the main content

Returns:

  • (ActiveSupport::SafeBuffer)

    the content-region markup



31
32
33
# File 'app/helpers/protege/components/layout_helper.rb', line 31

def app_content(&main)
  tag.div(class: 'flex min-h-0 flex-1') { app_sidebar + app_main(&main) }
end