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.36.2 lib/avo/sidebar.rb
avo-2.36.1 lib/avo/sidebar.rb
avo-2.36.0 lib/avo/sidebar.rb
avo-2.35.0 lib/avo/sidebar.rb
avo-2.34.7.pre.1 lib/avo/sidebar.rb
avo-2.34.6 lib/avo/sidebar.rb
avo-2.34.5 lib/avo/sidebar.rb
avo-2.34.4 lib/avo/sidebar.rb
avo-2.34.4.pre.1 lib/avo/sidebar.rb
avo-2.34.3 lib/avo/sidebar.rb
avo-2.34.2 lib/avo/sidebar.rb
avo-2.34.1 lib/avo/sidebar.rb
avo-2.34.0 lib/avo/sidebar.rb
avo-2.33.3 lib/avo/sidebar.rb
avo-2.33.3.pre.2 lib/avo/sidebar.rb
avo-2.33.3.pre.1 lib/avo/sidebar.rb
avo-2.33.2 lib/avo/sidebar.rb
avo-2.33.1 lib/avo/sidebar.rb
avo-2.33.0 lib/avo/sidebar.rb
avo-2.32.6 lib/avo/sidebar.rb