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
52
# 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
        t
        ext_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



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

def build_flash_messages
  arbre_content_for :flash_messages do
    super
  end
end


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

def build_footer
  arbre_content_for :footer do
    super
  end
end

#build_main_content_wrapperObject



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

def build_main_content_wrapper
  arbre_content_for :main_content do
    super
  end
end

#build_sidebarObject



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

def build_sidebar
  arbre_content_for :sidebar do
    super
  end
end

#build_title_barObject



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

def build_title_bar
  arbre_content_for :title_bar do
    super
  end
end

#build_unsupported_browserObject



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

def build_unsupported_browser
  arbre_content_for :unsupported_browser do
    super
  end
end