Class: TinyAdmin::Views::DefaultLayout

Inherits:
BasicLayout
  • Object
show all
Defined in:
lib/tiny_admin/views/default_layout.rb

Instance Attribute Summary collapse

Attributes inherited from BasicLayout

#content, #params, #widgets

Instance Method Summary collapse

Methods inherited from BasicLayout

#label_for, #update_attributes

Methods included from Utils

#humanize, #params_to_s, #prepare_page, #to_class

Instance Attribute Details

#flash_componentObject

Returns the value of attribute flash_component.



6
7
8
# File 'lib/tiny_admin/views/default_layout.rb', line 6

def flash_component
  @flash_component
end

#head_componentObject

Returns the value of attribute head_component.



6
7
8
# File 'lib/tiny_admin/views/default_layout.rb', line 6

def head_component
  @head_component
end

#messagesObject

Returns the value of attribute messages.



6
7
8
# File 'lib/tiny_admin/views/default_layout.rb', line 6

def messages
  @messages
end

Returns the value of attribute navbar_component.



6
7
8
# File 'lib/tiny_admin/views/default_layout.rb', line 6

def navbar_component
  @navbar_component
end

#optionsObject

Returns the value of attribute options.



6
7
8
# File 'lib/tiny_admin/views/default_layout.rb', line 6

def options
  @options
end

#titleObject

Returns the value of attribute title.



6
7
8
# File 'lib/tiny_admin/views/default_layout.rb', line 6

def title
  @title
end

Instance Method Details

#view_template(&block) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/tiny_admin/views/default_layout.rb', line 8

def view_template(&block)
  extra_styles = TinyAdmin.settings.extra_styles
  flash_component&.messages = messages
  head_component&.update_attributes(page_title: title, style_links: style_links, extra_styles: extra_styles)

  doctype
  html {
    render head_component if head_component

    body(class: body_class) {
      render navbar_component if navbar_component

      main_content {
        render flash_component if flash_component

        yield_content(&block)
      }

      render_scripts
    }
  }
end