Class: Maquina::Application::SessionsHeader

Inherits:
Phlex::HTML
  • Object
show all
Includes:
Maquina::ApplicationView, Phlex::DeferredRender, Phlex::Rails::Helpers::Translate
Defined in:
app/views/maquina/application/sessions_header.rb

Instance Method Summary collapse

Methods included from Maquina::ApplicationView

#attribute_human_name, #button_to, #image_tag, #link_to, #model_human_name, #svg_icon

Constructor Details

#initialize(brand_icon:, translation_key: "maquina.sessions.new") ⇒ SessionsHeader

Returns a new instance of SessionsHeader.



10
11
12
13
# File 'app/views/maquina/application/sessions_header.rb', line 10

def initialize(brand_icon:, translation_key: "maquina.sessions.new")
  @brand_icon = brand_icon
  @translation_key = translation_key
end

Instance Method Details

#view_templateObject



15
16
17
18
19
20
21
22
23
24
# File 'app/views/maquina/application/sessions_header.rb', line 15

def view_template
  div(class: "sm:mx-auto sm:w-full sm:max-w-md") do
    image_tag(@brand_icon, class: "mx-auto h-12 w-auto", alt: t("application_name"))
    h2(class: "mt-6 text-center text-3xl font-bold tracking-tight text-skin-base") { t("#{@translation_key}.title") }

    p(class: "mt-2 text-center text-sm text-skin-dimmed") do
      t("#{@translation_key}.subtitle", default: "")
    end
  end
end