Sha256: b5a620c5e65de97f23ad644b7bd0566f07aeb5db82f277d0409c3aa4030ba497

Contents?: true

Size: 764 Bytes

Versions: 48

Compression:

Stored size: 764 Bytes

Contents

# frozen_string_literal: true

module Spotlight
  ##
  # Exhibit home page
  class HomePage < Spotlight::Page
    extend FriendlyId
    friendly_id :title, use: %i[slugged scoped finders history], scope: %i[exhibit locale] do |config|
      config.reserved_words&.concat(%w[update_all])
    end

    before_save :publish
    before_create :default_content

    class << self
      def default_title_text
        I18n.t('spotlight.pages.index.home_pages.title')
      end
    end

    def should_display_title?
      display_title?
    end

    def display_sidebar?
      display_sidebar
    end

    private

    def publish
      self.published = true
    end

    def default_content
      self.title ||= Spotlight::HomePage.default_title_text
    end
  end
end

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
blacklight-spotlight-4.3.6 app/models/spotlight/home_page.rb
blacklight-spotlight-4.3.5 app/models/spotlight/home_page.rb
blacklight-spotlight-4.3.4 app/models/spotlight/home_page.rb
blacklight-spotlight-4.3.3 app/models/spotlight/home_page.rb
blacklight-spotlight-4.3.2 app/models/spotlight/home_page.rb
blacklight-spotlight-4.3.1 app/models/spotlight/home_page.rb
blacklight-spotlight-4.3.0 app/models/spotlight/home_page.rb
blacklight-spotlight-4.2.0 app/models/spotlight/home_page.rb
blacklight-spotlight-4.1.2 app/models/spotlight/home_page.rb
blacklight-spotlight-4.1.1 app/models/spotlight/home_page.rb
blacklight-spotlight-4.1.0 app/models/spotlight/home_page.rb
blacklight-spotlight-4.0.3 app/models/spotlight/home_page.rb
blacklight-spotlight-4.0.2 app/models/spotlight/home_page.rb
blacklight-spotlight-4.0.1 app/models/spotlight/home_page.rb
blacklight-spotlight-4.0.0 app/models/spotlight/home_page.rb
blacklight-spotlight-3.6.0.beta10 app/models/spotlight/home_page.rb
blacklight-spotlight-3.6.0.beta9 app/models/spotlight/home_page.rb
blacklight-spotlight-3.6.0.beta8 app/models/spotlight/home_page.rb
blacklight-spotlight-3.5.0.4 app/models/spotlight/home_page.rb
blacklight-spotlight-3.6.0.beta7 app/models/spotlight/home_page.rb