Sha256: 8fc174d860be9893fbaf6e74296c3cadaab78be2a52b351e8f29bd1be48d02e8

Contents?: true

Size: 781 Bytes

Versions: 87

Compression:

Stored size: 781 Bytes

Contents

class Avo::Sidebar
  include Avo::Concerns::IsResourceItem
  include Avo::Concerns::VisibleItems
  include Avo::Fields::FieldExtensions::VisibleInDifferentViews

  class_attribute :item_type, default: :sidebar
  delegate :items, :add_item, to: :items_holder

  attr_reader :name
  attr_reader :view
  attr_accessor :items_holder

  def initialize(name: nil, view: nil, **args)
    # Initialize the visibility markers
    super

    @name = name
    @items_holder = Avo::ItemsHolder.new
    @view = view

    show_on args[:show_on] if args[:show_on].present?
    hide_on args[:hide_on] if args[:hide_on].present?
    only_on args[:only_on] if args[:only_on].present?
    except_on args[:except_on] if args[:except_on].present?
  end

  def empty?
    visible_items.blank?
  end
end

Version data entries

87 entries across 87 versions & 1 rubygems

Version Path
avo-2.28.0 lib/avo/sidebar.rb
avo-2.27.2.pre.pr1606 lib/avo/sidebar.rb
avo-2.27.1 lib/avo/sidebar.rb
avo-2.27.0 lib/avo/sidebar.rb
avo-2.26.3.pre.pr1601 lib/avo/sidebar.rb
avo-2.26.2.pre.pr1579 lib/avo/sidebar.rb
avo-2.26.1.pr1584.pre.1 lib/avo/sidebar.rb
avo-2.25.1.pre.1.pr1579 lib/avo/sidebar.rb
avo-2.26.0 lib/avo/sidebar.rb
avo-2.25.0 lib/avo/sidebar.rb
avo-2.24.1 lib/avo/sidebar.rb
avo-2.24.0 lib/avo/sidebar.rb
avo-2.23.3.pre.1.pr1529 lib/avo/sidebar.rb
avo-2.23.2 lib/avo/sidebar.rb
avo-2.23.1 lib/avo/sidebar.rb
avo-2.23.0 lib/avo/sidebar.rb
avo-2.22.0 lib/avo/sidebar.rb
avo-2.21.3.pre.pr1489 lib/avo/sidebar.rb
avo-2.21.2.pre.pr1486 lib/avo/sidebar.rb
avo-2.21.1.pre.pr1484 lib/avo/sidebar.rb