Module: BasePatch

Included in:
ActiveAdmin::Views::Pages::Base
Defined in:
lib/activeadmin_custom_layout/layout/pages/base.rb

Instance Method Summary collapse

Instance Method Details

#add_classes_to_bodyObject



12
13
14
15
16
17
# File 'lib/activeadmin_custom_layout/layout/pages/base.rb', line 12

def add_classes_to_body
  super
  content_for :body_classes do
    @body.class_names
  end
end

#buildObject



3
4
5
6
7
8
9
10
# File 'lib/activeadmin_custom_layout/layout/pages/base.rb', line 3

def build
  self.aa_data = {
    action: params[:action],
    controller: params[:controller].tr('/', '_'),
    url: request.path
  }
  super
end

#build_active_admin_headObject



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
# File 'lib/activeadmin_custom_layout/layout/pages/base.rb', line 19

def build_active_admin_head
  within @head do
    arbre_content_for :title do
      insert_tag Arbre::HTML::Title, [title, render_or_call_method_or_proc_on(self, active_admin_namespace.site_title)].compact.join(" | ")
    end

    active_admin_application.stylesheets.each do |style, options|
      arbre_content_for :stylesheets do
        text_node stylesheet_link_tag(style, options).html_safe
      end
    end

    active_admin_application.javascripts.each do |path|
      arbre_content_for :javascripts do
        text_node(javascript_include_tag(path))
      end
    end

    if active_admin_namespace.favicon
      arbre_content_for :favicon do
        text_node(favicon_link_tag(active_admin_namespace.favicon))
      end
    end

    active_admin_namespace.meta_tags.each do |name, content|
      arbre_content_for :meta_tags do
        text_node(tag(:meta, name: name, content: content))
      end
    end

    text_node csrf_meta_tag
  end
end

#build_flash_messagesObject



65
66
67
68
69
# File 'lib/activeadmin_custom_layout/layout/pages/base.rb', line 65

def build_flash_messages
  arbre_content_for :flash_messages do
    super
  end
end


83
84
85
86
87
# File 'lib/activeadmin_custom_layout/layout/pages/base.rb', line 83

def build_footer
  arbre_content_for :footer do
    super
  end
end

#build_main_content_wrapperObject



71
72
73
74
75
# File 'lib/activeadmin_custom_layout/layout/pages/base.rb', line 71

def build_main_content_wrapper
  arbre_content_for :main_content do
    super
  end
end

#build_sidebarObject



77
78
79
80
81
# File 'lib/activeadmin_custom_layout/layout/pages/base.rb', line 77

def build_sidebar
  arbre_content_for :sidebar do
    super
  end
end

#build_title_barObject



59
60
61
62
63
# File 'lib/activeadmin_custom_layout/layout/pages/base.rb', line 59

def build_title_bar
  arbre_content_for :title_bar do
    super
  end
end

#build_unsupported_browserObject



53
54
55
56
57
# File 'lib/activeadmin_custom_layout/layout/pages/base.rb', line 53

def build_unsupported_browser
  arbre_content_for :unsupported_browser do
    super
  end
end