Module: SolidusAdmin::Layout::PageHelpers

Included in:
Orders::Show::Address::Component, Orders::Show::Component, Products::Show::Component, UI::Pages::Index::Component
Defined in:
app/components/solidus_admin/layout/page_helpers.rb

Instance Method Summary collapse

Instance Method Details

#page(**attrs, &block) ⇒ Object



4
5
6
7
# File 'app/components/solidus_admin/layout/page_helpers.rb', line 4

def page(**attrs, &block)
  tag.div(capture(&block), class: "px-4 relative", "data-controller": stimulus_id, **attrs) +
    tag.div(render(component("layout/feedback").new), class: "flex justify-center py-10")
end


48
49
50
# File 'app/components/solidus_admin/layout/page_helpers.rb', line 48

def page_footer(&block)
  tag.div(capture(&block), class: "mt-4 py-4 px-2 pb-8 border-t border-gray-100 flex")
end


52
53
54
# File 'app/components/solidus_admin/layout/page_helpers.rb', line 52

def page_footer_actions(&block)
  tag.div(capture(&block), class: "flex gap-2 grow")
end

#page_header(&block) ⇒ Object



32
33
34
# File 'app/components/solidus_admin/layout/page_helpers.rb', line 32

def page_header(&block)
  tag.header(capture(&block), class: "py-6 flex items-center gap-4")
end

#page_header_actions(&block) ⇒ Object



9
10
11
12
13
# File 'app/components/solidus_admin/layout/page_helpers.rb', line 9

def page_header_actions(&block)
  tag.div(safe_join([
    capture(&block),
  ]), class: "flex gap-2 items-center")
end

#page_header_back(back_path) ⇒ Object



15
16
17
18
19
20
21
22
23
# File 'app/components/solidus_admin/layout/page_helpers.rb', line 15

def page_header_back(back_path)
  render component("ui/button").new(
    tag: :a,
    title: t(".back"),
    icon: "arrow-left-line",
    scheme: :secondary,
    href: back_path
  )
end

#page_header_title(title, &block) ⇒ Object



25
26
27
28
29
30
# File 'app/components/solidus_admin/layout/page_helpers.rb', line 25

def page_header_title(title, &block)
  tag.h1(safe_join([
    tag.span(title, class: "font-semibold text-xl"),
    (capture(&block) if block_given?) || "",
  ]), class: "flex-1 text-2xl font-bold")
end

#page_with_sidebar(&block) ⇒ Object



36
37
38
# File 'app/components/solidus_admin/layout/page_helpers.rb', line 36

def page_with_sidebar(&block)
  tag.div(capture(&block), class: "flex gap-4 items-start pb-4")
end

#page_with_sidebar_aside(&block) ⇒ Object



44
45
46
# File 'app/components/solidus_admin/layout/page_helpers.rb', line 44

def page_with_sidebar_aside(&block)
  tag.aside(capture(&block), class: "justify-center items-start gap-4 flex flex-col w-full max-w-sm")
end

#page_with_sidebar_main(&block) ⇒ Object



40
41
42
# File 'app/components/solidus_admin/layout/page_helpers.rb', line 40

def page_with_sidebar_main(&block)
  tag.div(capture(&block), class: "justify-center items-start gap-4 flex flex-col w-full")
end