Sha256: 98636207e8064a4c2409ee10d149ea9d04c34bbeae595664bc08ca2e7fb603c8

Contents?: true

Size: 589 Bytes

Versions: 29

Compression:

Stored size: 589 Bytes

Contents

# frozen_string_literal: true
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

29 entries across 29 versions & 1 rubygems

Version Path
activeadmin-4.0.0.beta12 lib/active_admin/resource/sidebars.rb
activeadmin-3.2.5 lib/active_admin/resource/sidebars.rb
activeadmin-4.0.0.beta11 lib/active_admin/resource/sidebars.rb
activeadmin-3.2.4 lib/active_admin/resource/sidebars.rb
activeadmin-4.0.0.beta10 lib/active_admin/resource/sidebars.rb
activeadmin-4.0.0.beta9 lib/active_admin/resource/sidebars.rb
activeadmin-3.2.3 lib/active_admin/resource/sidebars.rb
activeadmin-4.0.0.beta8 lib/active_admin/resource/sidebars.rb
activeadmin-4.0.0.beta7 lib/active_admin/resource/sidebars.rb
activeadmin-3.2.2 lib/active_admin/resource/sidebars.rb
activeadmin-4.0.0.beta6 lib/active_admin/resource/sidebars.rb
activeadmin-3.2.1 lib/active_admin/resource/sidebars.rb
activeadmin-4.0.0.beta5 lib/active_admin/resource/sidebars.rb
activeadmin-4.0.0.beta4 lib/active_admin/resource/sidebars.rb
activeadmin-4.0.0.beta3 lib/active_admin/resource/sidebars.rb
activeadmin-4.0.0.beta2 lib/active_admin/resource/sidebars.rb
activeadmin-4.0.0.beta1 lib/active_admin/resource/sidebars.rb
activeadmin-3.2.0 lib/active_admin/resource/sidebars.rb
activeadmin-3.1.0 lib/active_admin/resource/sidebars.rb
activeadmin-3.0.0 lib/active_admin/resource/sidebars.rb