Class: Views::Databasium::Application

Inherits:
Base show all
Includes:
Phlex::Rails::Helpers::ContentFor, Phlex::Rails::Helpers::Flash, Phlex::Rails::Helpers::JavascriptImportmapTags, Phlex::Rails::Helpers::StylesheetLinkTag, Phlex::Rails::Helpers::TurboFrameTag, Phlex::Rails::Layout
Defined in:
app/views/layouts/databasium/application.rb

Instance Method Summary collapse

Methods inherited from Components::Base

#before_template

Methods included from Databasium::HeroiconHelper

#heroicon

Instance Method Details

#view_template(&block) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'app/views/layouts/databasium/application.rb', line 11

def view_template(&block)
  doctype

  html do
    head do
      title { content_for?(:title) ? yield(:title) : "Databasium" }
      meta charset: "utf-8"
      csrf_meta_tags
      csp_meta_tag
      yield :head
      stylesheet_link_tag "databasium",
                          "data-turbo-track": Rails.env.production? ? "reload" : ""
      javascript_importmap_tags "databasium/application"
    end
    body(
      class: "flex h-dvh overflow-hidden bg-background text-main-text scrollbar-thin",
      data: {
        controller: "layout"
      }
    ) do
      render Components::Databasium::Global::Error.new
      render Components::Databasium::Global::Flash.new(
               success: flash[:success],
               error: flash[:error]
             )
      render Components::Databasium::Global::Sidebar.new(sidebar: content_for(:sidebar))
      turbo_frame_tag(
        "main",
        class: "flex flex-1 flex-col overflow-hidden",
        data: {
          controller: "toggle model table"
        }
      ) do
        render Components::Databasium::Global::HeaderActions.new(
                 actions: content_for(:header_actions)
               )
        div(class: "flex min-h-0 min-w-0 flex-1 flex-col") do
          yield block_given? ? block : block.call
        end
      end
    end
  end
end