Sha256: 9c09dbfe65f52b303eb01117dd0f3515731909748f9a098b36c3d938773f0f14

Contents?: true

Size: 559 Bytes

Versions: 13

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

13 entries across 13 versions & 1 rubygems

Version Path
activeadmin-2.8.0 lib/active_admin/resource/sidebars.rb
activeadmin-2.7.0 lib/active_admin/resource/sidebars.rb
activeadmin-2.6.1 lib/active_admin/resource/sidebars.rb
activeadmin-2.6.0 lib/active_admin/resource/sidebars.rb
activeadmin-2.5.0 lib/active_admin/resource/sidebars.rb
activeadmin-2.4.0 lib/active_admin/resource/sidebars.rb
activeadmin-2.3.1 lib/active_admin/resource/sidebars.rb
activeadmin-2.3.0 lib/active_admin/resource/sidebars.rb
activeadmin-2.2.0 lib/active_admin/resource/sidebars.rb
activeadmin-2.1.0 lib/active_admin/resource/sidebars.rb
activeadmin-2.0.0 lib/active_admin/resource/sidebars.rb
activeadmin-2.0.0.rc2 lib/active_admin/resource/sidebars.rb
activeadmin-2.0.0.rc1 lib/active_admin/resource/sidebars.rb