Module: Adminterface::Extensions::Views::Pages::Index

Defined in:
lib/adminterface/extensions/views/pages/index.rb

Constant Summary collapse

FILTER_OPTS =
%w[sidebar table_tools aside].freeze

Instance Method Summary collapse

Instance Method Details

#build_pageObject



19
20
21
# File 'lib/adminterface/extensions/views/pages/index.rb', line 19

def build_page
  super.add_child(build_aside)
end

#build_table_toolsObject



23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/adminterface/extensions/views/pages/index.rb', line 23

def build_table_tools
  return unless any_table_tools?

  div class: "table_tools" do
    build_scopes
    build_table_tools_filters
    div class: "scope_ctrls" do
      build_batch_actions_selector
      build_index_list
      build_table_tools_filter_toggler
    end
  end
end

#main_contentObject



8
9
10
11
12
13
14
15
16
17
# File 'lib/adminterface/extensions/views/pages/index.rb', line 8

def main_content
  unless FILTER_OPTS.include?(filter_position)
    raise "Invalid layouts -> filter. Available options are: #{FILTER_OPTS.join(", ")}"
  end

  build_table_tools
  wrap_with_batch_action_form do
    build_collection
  end
end