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.53.0 lib/avo/sidebar.rb
avo-2.52.0 lib/avo/sidebar.rb
avo-2.49.0 lib/avo/sidebar.rb
avo-2.48.0 lib/avo/sidebar.rb
avo-2.47.0 lib/avo/sidebar.rb
avo-2.46.0 lib/avo/sidebar.rb
avo-2.45.0 lib/avo/sidebar.rb
avo-2.44.0 lib/avo/sidebar.rb
avo-2.43.0 lib/avo/sidebar.rb
avo-2.42.2 lib/avo/sidebar.rb
avo-2.42.1 lib/avo/sidebar.rb
avo-2.42.0 lib/avo/sidebar.rb
avo-2.41.0 lib/avo/sidebar.rb
avo-2.40.0 lib/avo/sidebar.rb
avo-2.39.0 lib/avo/sidebar.rb
avo-2.38.0 lib/avo/sidebar.rb
avo-2.37.2 lib/avo/sidebar.rb
avo-2.37.1 lib/avo/sidebar.rb
avo-2.37.0 lib/avo/sidebar.rb
avo-2.36.3 lib/avo/sidebar.rb