Sha256: 9c5d4f39606f0d878a580d5dde26ae6c170ca59df52838d09cdbf45ee15b4f80

Contents?: true

Size: 734 Bytes

Versions: 14

Compression:

Stored size: 734 Bytes

Contents

# frozen_string_literal: true
module ActiveAdmin

  class SidebarSection
    include ActiveAdmin::OptionalDisplay

    attr_accessor :name, :options, :block

    def initialize(name, options = {}, &block)
      @name = name.to_s
      @options = options
      @block = block
      normalize_display_options!
    end

    # The id gets used for the div in the view
    def id
      "#{name.downcase.underscore}_sidebar_section".parameterize
    end

    # If a block is not passed in, the name of the partial to render
    def partial_name
      options[:partial] || "#{name.downcase.tr(' ', '_')}_sidebar"
    end

    def custom_class
      options[:class]
    end

    def priority
      options[:priority] || 10
    end
  end

end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
activeadmin-4.0.0.beta14 lib/active_admin/sidebar_section.rb
activeadmin-4.0.0.beta13 lib/active_admin/sidebar_section.rb
activeadmin-4.0.0.beta12 lib/active_admin/sidebar_section.rb
activeadmin-4.0.0.beta11 lib/active_admin/sidebar_section.rb
activeadmin-4.0.0.beta10 lib/active_admin/sidebar_section.rb
activeadmin-4.0.0.beta9 lib/active_admin/sidebar_section.rb
activeadmin-4.0.0.beta8 lib/active_admin/sidebar_section.rb
activeadmin-4.0.0.beta7 lib/active_admin/sidebar_section.rb
activeadmin-4.0.0.beta6 lib/active_admin/sidebar_section.rb
activeadmin-4.0.0.beta5 lib/active_admin/sidebar_section.rb
activeadmin-4.0.0.beta4 lib/active_admin/sidebar_section.rb
activeadmin-4.0.0.beta3 lib/active_admin/sidebar_section.rb
activeadmin-4.0.0.beta2 lib/active_admin/sidebar_section.rb
activeadmin-4.0.0.beta1 lib/active_admin/sidebar_section.rb