Sha256: 1e544a6dc60635e16e76c3d68728946d51d03349a134f6fed521505bc44f26bc

Contents?: true

Size: 559 Bytes

Versions: 4

Compression:

Stored size: 559 Bytes

Contents

require "active_admin/helpers/optional_display"

module ActiveAdmin

  class Resource
    module Sidebars

      def sidebar_sections
        @sidebar_sections ||= []
      end

      def clear_sidebar_sections!
        @sidebar_sections = []
      end

      def sidebar_sections_for(action, render_context = nil)
        sidebar_sections.select { |section| section.display_on?(action, render_context) }
          .sort_by(&:priority)
      end

      def sidebar_sections?
        !!@sidebar_sections && @sidebar_sections.any?
      end

    end
  end

end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
date_n_time_picker_activeadmin-0.1.2 vendor/bundle/ruby/2.6.0/gems/activeadmin-2.9.0/lib/active_admin/resource/sidebars.rb
date_n_time_picker_activeadmin-0.1.1 vendor/bundle/ruby/2.6.0/gems/activeadmin-2.9.0/lib/active_admin/resource/sidebars.rb
activeadmin-2.9.0 lib/active_admin/resource/sidebars.rb
activeadmin-2.8.1 lib/active_admin/resource/sidebars.rb