module Adminterface::Extensions::Views::Pages::Index
Constants
- FILTER_OPTS
Public Instance Methods
build_page()
click to toggle source
Calls superclass method
# File lib/adminterface/extensions/views/pages/index.rb, line 19 def build_page super.add_child(build_aside) end
build_table_tools()
click to toggle source
# 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_content()
click to toggle source
# 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
Private Instance Methods
action_items_for_action()
click to toggle source
Calls superclass method
# File lib/adminterface/extensions/views/pages/index.rb, line 39 def action_items_for_action if filter_position.eql?("aside") items = super << aside_filter_action items.sort_by { |x| [x.group, x.priority] } else super end end
aside_filter_action()
click to toggle source
# File lib/adminterface/extensions/views/pages/index.rb, line 48 def aside_filter_action ActiveAdmin::ActionItem.new(:filter, only: :index, group: 90) do localizer = ActiveAdmin::Localizers.resource(active_admin_config) link_to localizer.t(:filter_model), "#", id: "filters-toggler", data: {"bs-toggle": "collapse", "bs-target": "#filters"}, title: I18n.t(:filters, scope: "active_admin.sidebars") end end
build_aside()
click to toggle source
# File lib/adminterface/extensions/views/pages/index.rb, line 58 def build_aside return if filter_sections.blank? return unless filter_position.eql?("aside") div id: "filters", class: "collapse aside" do button "", type: "button", id: "filters-close", class: "btn-close", href: "#", "data-bs-toggle": "collapse", "data-bs-target": "#filters" filter_sections.collect { |x| sidebar_section(x) } end end
build_table_tools_filter_toggler()
click to toggle source
# File lib/adminterface/extensions/views/pages/index.rb, line 77 def build_table_tools_filter_toggler return if filter_sections.blank? return unless filter_position.eql?("table_tools") div id: "filters-toggler" do a span(I18n.t("active_admin.sidebars.filters")), href: "#", class: "filter_toggler #{table_tools_css_classes[:btn]}", 'data-bs-toggle': "collapse", 'data-bs-target': "#filters" end end
build_table_tools_filters()
click to toggle source
# File lib/adminterface/extensions/views/pages/index.rb, line 68 def build_table_tools_filters return if filter_sections.blank? return unless filter_position.eql?("table_tools") div id: "filters", class: "collapse table-tools" do filter_sections.collect { |x| sidebar_section(x) } end end
filter_position()
click to toggle source
# File lib/adminterface/extensions/views/pages/index.rb, line 122 def filter_position filter_components[:position] end
filter_section?(section)
click to toggle source
# File lib/adminterface/extensions/views/pages/index.rb, line 88 def filter_section?(section) section.name.to_sym == :filters end
filter_sections()
click to toggle source
# File lib/adminterface/extensions/views/pages/index.rb, line 92 def filter_sections sections = [] available_sidebar_sections.collect do |section| next unless filter_section?(section) sections.push section end sections end